diff options
Diffstat (limited to 'doc/classes')
40 files changed, 520 insertions, 703 deletions
diff --git a/doc/classes/AudioStreamPlayer.xml b/doc/classes/AudioStreamPlayer.xml index 26fe1278f7..e0bc98e208 100644 --- a/doc/classes/AudioStreamPlayer.xml +++ b/doc/classes/AudioStreamPlayer.xml @@ -55,6 +55,7 @@ </member> <member name="bus" type="StringName" setter="set_bus" getter="get_bus" default="&"Master""> Bus on which this audio is playing. + [b]Note:[/b] When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to [code]"Master"[/code]. </member> <member name="max_polyphony" type="int" setter="set_max_polyphony" getter="get_max_polyphony" default="1"> The maximum number of sounds this node can play at the same time. Playing additional sounds after this value is reached will cut off the oldest sounds. diff --git a/doc/classes/AudioStreamPlayer2D.xml b/doc/classes/AudioStreamPlayer2D.xml index 76666b1f27..f04f95bd72 100644 --- a/doc/classes/AudioStreamPlayer2D.xml +++ b/doc/classes/AudioStreamPlayer2D.xml @@ -57,6 +57,7 @@ </member> <member name="bus" type="StringName" setter="set_bus" getter="get_bus" default="&"Master""> Bus on which this audio is playing. + [b]Note:[/b] When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to [code]"Master"[/code]. </member> <member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" default="2000.0"> Maximum distance from which audio is still hearable. diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml index a49b1e2291..72febf7006 100644 --- a/doc/classes/AudioStreamPlayer3D.xml +++ b/doc/classes/AudioStreamPlayer3D.xml @@ -64,6 +64,7 @@ </member> <member name="bus" type="StringName" setter="set_bus" getter="get_bus" default="&"Master""> The bus on which this audio is playing. + [b]Note:[/b] When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to [code]"Master"[/code]. </member> <member name="doppler_tracking" type="int" setter="set_doppler_tracking" getter="get_doppler_tracking" enum="AudioStreamPlayer3D.DopplerTracking" default="0"> Decides in which step the Doppler effect should be calculated. diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index 1e0b685795..1cd9ca0afb 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -40,29 +40,6 @@ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link> </tutorials> - <methods> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> - </methods> <members> <member name="alignment" type="int" setter="set_text_alignment" getter="get_text_alignment" enum="HorizontalAlignment" default="1"> Text alignment policy for the button's text, use one of the [enum @GlobalScope.HorizontalAlignment] constants. diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 98a498d719..acf08414d0 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -48,17 +48,26 @@ </description> </method> <method name="draw_char" qualifiers="const"> - <return type="float" /> + <return type="void" /> + <argument index="0" name="font" type="Font" /> + <argument index="1" name="pos" type="Vector2" /> + <argument index="2" name="char" type="String" /> + <argument index="3" name="font_size" type="int" default="16" /> + <argument index="4" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> + <description> + Draws a string first character using a custom font. + </description> + </method> + <method name="draw_char_outline" qualifiers="const"> + <return type="void" /> <argument index="0" name="font" type="Font" /> <argument index="1" name="pos" type="Vector2" /> <argument index="2" name="char" type="String" /> - <argument index="3" name="next" type="String" default="""" /> - <argument index="4" name="size" type="int" default="16" /> + <argument index="3" name="font_size" type="int" default="16" /> + <argument index="4" name="size" type="int" default="-1" /> <argument index="5" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> - <argument index="6" name="outline_size" type="int" default="0" /> - <argument index="7" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" /> <description> - Draws a string character using a custom font. Returns the advance, depending on the character width and kerning with an optional next character. + Draws a string first character outline using a custom font. </description> </method> <method name="draw_circle"> @@ -127,7 +136,7 @@ <argument index="4" name="outline" type="float" default="0.0" /> <argument index="5" name="pixel_range" type="float" default="4.0" /> <description> - Draws a textured rectangle region of the multi-channel signed distance field texture at a given position, optionally modulated by a color. See [member FontData.multichannel_signed_distance_field] for more information and caveats about MSDF font rendering. + Draws a textured rectangle region of the multi-channel signed distance field texture at a given position, optionally modulated by a color. See [member FontFile.multichannel_signed_distance_field] for more information and caveats about MSDF font rendering. If [code]outline[/code] is positive, each alpha channel value of pixel in region is set to maximum value of true distance in the [code]outline[/code] radius. Value of the [code]pixel_range[/code] should the same that was used during distance field texture generation. </description> @@ -157,16 +166,34 @@ <argument index="2" name="text" type="String" /> <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> <argument index="4" name="width" type="float" default="-1" /> - <argument index="5" name="max_lines" type="int" default="-1" /> - <argument index="6" name="size" type="int" default="16" /> + <argument index="5" name="font_size" type="int" default="16" /> + <argument index="6" name="max_lines" type="int" default="-1" /> <argument index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> - <argument index="8" name="outline_size" type="int" default="0" /> - <argument index="9" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" /> - <argument index="10" name="flags" type="int" default="99" /> + <argument index="8" name="flags" type="int" default="99" /> + <argument index="9" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="10" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> <description> Breaks [code]text[/code] to the lines and draws it using the specified [code]font[/code] at the [code]position[/code] (top-left corner). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. </description> </method> + <method name="draw_multiline_string_outline" qualifiers="const"> + <return type="void" /> + <argument index="0" name="font" type="Font" /> + <argument index="1" name="pos" type="Vector2" /> + <argument index="2" name="text" type="String" /> + <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> + <argument index="4" name="width" type="float" default="-1" /> + <argument index="5" name="font_size" type="int" default="16" /> + <argument index="6" name="max_lines" type="int" default="-1" /> + <argument index="7" name="size" type="int" default="1" /> + <argument index="8" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> + <argument index="9" name="flags" type="int" default="99" /> + <argument index="10" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="11" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> + <description> + Breaks [code]text[/code] to the lines and draws text outline using the specified [code]font[/code] at the [code]position[/code] (top-left corner). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. + </description> + </method> <method name="draw_multimesh"> <return type="void" /> <argument index="0" name="multimesh" type="MultiMesh" /> @@ -250,11 +277,11 @@ <argument index="2" name="text" type="String" /> <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> <argument index="4" name="width" type="float" default="-1" /> - <argument index="5" name="size" type="int" default="16" /> + <argument index="5" name="font_size" type="int" default="16" /> <argument index="6" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> - <argument index="7" name="outline_size" type="int" default="0" /> - <argument index="8" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" /> - <argument index="9" name="flags" type="int" default="3" /> + <argument index="7" name="flags" type="int" default="3" /> + <argument index="8" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="9" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> <description> Draws [code]text[/code] using the specified [code]font[/code] at the [code]position[/code] (bottom-left corner using the baseline of the font). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. [b]Example using the default project font:[/b] @@ -279,6 +306,23 @@ See also [method Font.draw_string]. </description> </method> + <method name="draw_string_outline" qualifiers="const"> + <return type="void" /> + <argument index="0" name="font" type="Font" /> + <argument index="1" name="pos" type="Vector2" /> + <argument index="2" name="text" type="String" /> + <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> + <argument index="4" name="width" type="float" default="-1" /> + <argument index="5" name="font_size" type="int" default="16" /> + <argument index="6" name="size" type="int" default="1" /> + <argument index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> + <argument index="8" name="flags" type="int" default="3" /> + <argument index="9" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="10" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> + <description> + Draws [code]text[/code] outline using the specified [code]font[/code] at the [code]position[/code] (bottom-left corner using the baseline of the font). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. + </description> + </method> <method name="draw_style_box"> <return type="void" /> <argument index="0" name="style_box" type="StyleBox" /> diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml index 7ca27a35fe..4994ef352e 100644 --- a/doc/classes/CodeEdit.xml +++ b/doc/classes/CodeEdit.xml @@ -592,6 +592,9 @@ <theme_item name="completion_scroll_color" data_type="color" type="Color" default="Color(1, 1, 1, 0.29)"> [Color] of the scrollbar in the code completion popup. </theme_item> + <theme_item name="completion_scroll_hovered_color" data_type="color" type="Color" default="Color(1, 1, 1, 0.4)"> + [Color] of the scrollbar in the code completion popup when hovered. + </theme_item> <theme_item name="completion_selected_color" data_type="color" type="Color" default="Color(0.26, 0.26, 0.27, 1)"> Background highlight [Color] for the current selected option item in the code completion popup. </theme_item> diff --git a/doc/classes/ColorPicker.xml b/doc/classes/ColorPicker.xml index 7c9c4ed4d6..cc9c5877c5 100644 --- a/doc/classes/ColorPicker.xml +++ b/doc/classes/ColorPicker.xml @@ -37,16 +37,15 @@ <member name="color" type="Color" setter="set_pick_color" getter="get_pick_color" default="Color(1, 1, 1, 1)"> The currently selected color. </member> + <member name="color_mode" type="int" setter="set_color_mode" getter="get_color_mode" enum="ColorPicker.ColorModeType" default="0"> + The currently selected color mode. See [enum ColorModeType]. + </member> <member name="deferred_mode" type="bool" setter="set_deferred_mode" getter="is_deferred_mode" default="false"> If [code]true[/code], the color will apply only after the user releases the mouse button, otherwise it will apply immediately even in mouse motion event (which can cause performance issues). </member> <member name="edit_alpha" type="bool" setter="set_edit_alpha" getter="is_editing_alpha" default="true"> If [code]true[/code], shows an alpha channel slider (opacity). </member> - <member name="hsv_mode" type="bool" setter="set_hsv_mode" getter="is_hsv_mode" default="false"> - If [code]true[/code], allows editing the color with Hue/Saturation/Value sliders. - [b]Note:[/b] Cannot be enabled if raw mode is on. - </member> <member name="picker_shape" type="int" setter="set_picker_shape" getter="get_picker_shape" enum="ColorPicker.PickerShapeType" default="0"> The shape of the color space view. See [enum PickerShapeType]. </member> @@ -56,10 +55,6 @@ <member name="presets_visible" type="bool" setter="set_presets_visible" getter="are_presets_visible" default="true"> If [code]true[/code], saved color presets are visible. </member> - <member name="raw_mode" type="bool" setter="set_raw_mode" getter="is_raw_mode" default="false"> - If [code]true[/code], allows the color R, G, B component values to go beyond 1.0, which can be used for certain special operations that require it (like tinting without darkening or rendering sprites in HDR). - [b]Note:[/b] Cannot be enabled if HSV mode is on. - </member> </members> <signals> <signal name="color_changed"> @@ -82,6 +77,20 @@ </signal> </signals> <constants> + <constant name="MODE_RGB" value="0" enum="ColorModeType"> + Allows editing the color with Red/Green/Blue sliders. + </constant> + <constant name="MODE_HSV" value="1" enum="ColorModeType"> + Allows editing the color with Hue/Saturation/Value sliders. + </constant> + <constant name="MODE_RAW" value="2" enum="ColorModeType"> + Allows the color R, G, B component values to go beyond 1.0, which can be used for certain special operations that require it (like tinting without darkening or rendering sprites in HDR). + </constant> + <constant name="MODE_OKHSL" value="3" enum="ColorModeType"> + Allows editing the color with Hue/Saturation/Lightness sliders. + OKHSL is a new color space similar to HSL but that better match perception by leveraging the Oklab color space which is designed to be simple to use, while doing a good job at predicting perceived lightness, chroma and hue. + [url=https://bottosson.github.io/posts/colorpicker/]Okhsv and Okhsl color spaces[/url] + </constant> <constant name="SHAPE_HSV_RECTANGLE" value="0" enum="PickerShapeType"> HSV Color Model rectangle color space. </constant> diff --git a/doc/classes/Decal.xml b/doc/classes/Decal.xml index c38e1d1499..861b4b480c 100644 --- a/doc/classes/Decal.xml +++ b/doc/classes/Decal.xml @@ -89,15 +89,19 @@ </member> <member name="texture_albedo" type="Texture2D" setter="set_texture" getter="get_texture"> [Texture2D] with the base [Color] of the Decal. Either this or the [member texture_emission] must be set for the Decal to be visible. Use the alpha channel like a mask to smoothly blend the edges of the decal with the underlying object. + [b]Note:[/b] Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for [Decal] textures is set globally with [member ProjectSettings.rendering/textures/decals/filter]. </member> <member name="texture_emission" type="Texture2D" setter="set_texture" getter="get_texture"> [Texture2D] with the emission [Color] of the Decal. Either this or the [member texture_emission] must be set for the Decal to be visible. Use the alpha channel like a mask to smoothly blend the edges of the decal with the underlying object. + [b]Note:[/b] Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for [Decal] textures is set globally with [member ProjectSettings.rendering/textures/decals/filter]. </member> <member name="texture_normal" type="Texture2D" setter="set_texture" getter="get_texture"> [Texture2D] with the per-pixel normal map for the decal. Use this to add extra detail to decals. + [b]Note:[/b] Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for [Decal] textures is set globally with [member ProjectSettings.rendering/textures/decals/filter]. </member> <member name="texture_orm" type="Texture2D" setter="set_texture" getter="get_texture"> [Texture2D] storing ambient occlusion, roughness, and metallic for the decal. Use this to add extra detail to decals. + [b]Note:[/b] Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for [Decal] textures is set globally with [member ProjectSettings.rendering/textures/decals/filter]. </member> <member name="upper_fade" type="float" setter="set_upper_fade" getter="get_upper_fade" default="0.3"> Sets the curve over which the decal will fade as the surface gets further from the center of the [AABB]. Only positive values are valid (negative values will be clamped to [code]0.0[/code]). diff --git a/doc/classes/Font.xml b/doc/classes/Font.xml index dae42ddf34..b19386b398 100644 --- a/doc/classes/Font.xml +++ b/doc/classes/Font.xml @@ -1,93 +1,36 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Font" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Font class is set of font data sources used to draw text. + Base class for fonts and font variations. </brief_description> <description> - Font contains a set of glyphs to represent Unicode characters, as well as the ability to draw it with variable width, ascent, descent and kerning. - [b]Note:[/b] A character is a symbol that represents an item (letter, digit etc.) in an abstract way. - [b]Note:[/b] A glyph is a bitmap or shape used to draw a one or more characters in a context-dependent manner. Glyph indices are bound to the specific font data source. - [b]Note:[/b] If a non of the font data sources contain glyphs for a character used in a string, the character in question will be replaced with a box displaying its hexadecimal code. - [codeblocks] - [gdscript] - var font = Font.new() - font.add_data(load("res://BarlowCondensed-Bold.ttf")) - $"Label".set("custom_fonts/font", font) - $"Label".set("custom_fonts/font_size", 64) - [/gdscript] - [csharp] - var font = new Font(); - font.AddData(ResourceLoader.Load<FontData>("res://BarlowCondensed-Bold.ttf")); - GetNode("Label").Set("custom_fonts/font", font); - GetNode("Label").Set("custom_font_sizes/font_size", 64); - [/csharp] - [/codeblocks] - To control font substitution priority use [FontData] language and script support. - Use language overrides to use same [Font] stack for multiple languages: - [codeblocks] - [gdscript] - # Use Naskh font for Persian and Nastaʼlīq font for Urdu text. - var font_data_fa = load("res://NotoNaskhArabicUI_Regular.ttf"); - font_data_fa.set_language_support_override("fa", true); - font_data_fa.set_language_support_override("ur", false); - - var font_data_ur = load("res://NotoNastaliqUrdu_Regular.ttf"); - font_data_ur.set_language_support_override("fa", false); - font_data_ur.set_language_support_override("ur", true); - [/gdscript] - [csharp] - // Use Naskh font for Persian and Nastaʼlīq font for Urdu text. - var fontDataFA = ResourceLoader.Load<FontData>("res://NotoNaskhArabicUI_Regular.ttf"); - fontDataFA.SetLanguageSupportOverride("fa", true); - fontDataFA.SetLanguageSupportOverride("ur", false); - - var fontDataUR = ResourceLoader.Load<FontData>("res://NotoNastaliqUrdu_Regular.ttf"); - fontDataUR.SetLanguageSupportOverride("fa", false); - fontDataUR.SetLanguageSupportOverride("ur", true); - [/csharp] - [/codeblocks] - Use script overrides to specify supported scripts for bitmap font or for less common scripts not directly supported by TrueType format: - [codeblocks] - [gdscript] - # Use specified font for Egyptian hieroglyphs. - var font_data = load("res://unifont.ttf"); - font_data.set_script_support_override("Egyp", true); - [/gdscript] - [csharp] - // Use specified font for Egyptian hieroglyphs. - var fontData = ResourceLoader.Load<FontData>("res://unifont.ttf"); - fontData.SetScriptSupportOverride("Egyp", true); - [/csharp] - [/codeblocks] + Font is the abstract base class for font, so it shouldn't be used directly. Other types of fonts inherit from it. </description> <tutorials> </tutorials> <methods> - <method name="add_data"> - <return type="void" /> - <argument index="0" name="data" type="FontData" /> - <description> - Add font data source to the set. - </description> - </method> - <method name="clear_data"> - <return type="void" /> + <method name="draw_char" qualifiers="const"> + <return type="float" /> + <argument index="0" name="canvas_item" type="RID" /> + <argument index="1" name="pos" type="Vector2" /> + <argument index="2" name="char" type="int" /> + <argument index="3" name="modulate" type="int" /> + <argument index="4" name="arg4" type="Color" default="Color(1, 1, 1, 1)" /> <description> - Removes all font data sourcers for the set. + Draw a single Unicode character [code]char[/code] into a canvas item using the font, at a given position, with [code]modulate[/code] color. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. + [b]Note:[/b] Do not use this function to draw strings character by character, use [method draw_string] or [TextLine] instead. </description> </method> - <method name="draw_char" qualifiers="const"> + <method name="draw_char_outline" qualifiers="const"> <return type="float" /> <argument index="0" name="canvas_item" type="RID" /> <argument index="1" name="pos" type="Vector2" /> <argument index="2" name="char" type="int" /> - <argument index="3" name="next" type="int" default="0" /> - <argument index="4" name="size" type="int" default="16" /> - <argument index="5" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> - <argument index="6" name="outline_size" type="int" default="0" /> - <argument index="7" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" /> + <argument index="3" name="size" type="int" /> + <argument index="4" name="modulate" type="int" default="-1" /> + <argument index="5" name="arg5" type="Color" default="Color(1, 1, 1, 1)" /> <description> - Draw a single Unicode character [code]char[/code] into a canvas item using the font, at a given position, with [code]modulate[/code] color, and optionally kerning if [code]next[/code] is passed. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. + Draw a single Unicode character [code]char[/code] outline into a canvas item using the font, at a given position, with [code]modulate[/code] color and [code]size[/code] outline size. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. [b]Note:[/b] Do not use this function to draw strings character by character, use [method draw_string] or [TextLine] instead. </description> </method> @@ -98,17 +41,36 @@ <argument index="2" name="text" type="String" /> <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> <argument index="4" name="width" type="float" default="-1" /> - <argument index="5" name="max_lines" type="int" default="-1" /> - <argument index="6" name="size" type="int" default="16" /> + <argument index="5" name="font_size" type="int" default="16" /> + <argument index="6" name="max_lines" type="int" default="-1" /> <argument index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> - <argument index="8" name="outline_size" type="int" default="0" /> - <argument index="9" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" /> - <argument index="10" name="flags" type="int" default="99" /> + <argument index="8" name="flags" type="int" default="99" /> + <argument index="9" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="10" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> <description> Breaks [code]text[/code] to the lines using rules specified by [code]flags[/code] and draws it into a canvas item using the font, at a given position, with [code]modulate[/code] color, optionally clipping the width and aligning horizontally. [code]position[/code] specifies the baseline of the first line, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. See also [method CanvasItem.draw_multiline_string]. </description> </method> + <method name="draw_multiline_string_outline" qualifiers="const"> + <return type="void" /> + <argument index="0" name="canvas_item" type="RID" /> + <argument index="1" name="pos" type="Vector2" /> + <argument index="2" name="text" type="String" /> + <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> + <argument index="4" name="width" type="float" default="-1" /> + <argument index="5" name="font_size" type="int" default="16" /> + <argument index="6" name="max_lines" type="int" default="-1" /> + <argument index="7" name="size" type="int" default="1" /> + <argument index="8" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> + <argument index="9" name="flags" type="int" default="99" /> + <argument index="10" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="11" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> + <description> + Breaks [code]text[/code] to the lines using rules specified by [code]flags[/code] and draws text outline into a canvas item using the font, at a given position, with [code]modulate[/code] color and [code]size[/code] outline size, optionally clipping the width and aligning horizontally. [code]position[/code] specifies the baseline of the first line, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. + See also [method CanvasItem.draw_multiline_string_outline]. + </description> + </method> <method name="draw_string" qualifiers="const"> <return type="void" /> <argument index="0" name="canvas_item" type="RID" /> @@ -116,19 +78,47 @@ <argument index="2" name="text" type="String" /> <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> <argument index="4" name="width" type="float" default="-1" /> - <argument index="5" name="size" type="int" default="16" /> + <argument index="5" name="font_size" type="int" default="16" /> <argument index="6" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> - <argument index="7" name="outline_size" type="int" default="0" /> - <argument index="8" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" /> - <argument index="9" name="flags" type="int" default="3" /> + <argument index="7" name="flags" type="int" default="3" /> + <argument index="8" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="9" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> <description> Draw [code]text[/code] into a canvas item using the font, at a given position, with [code]modulate[/code] color, optionally clipping the width and aligning horizontally. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. See also [method CanvasItem.draw_string]. </description> </method> + <method name="draw_string_outline" qualifiers="const"> + <return type="void" /> + <argument index="0" name="canvas_item" type="RID" /> + <argument index="1" name="pos" type="Vector2" /> + <argument index="2" name="text" type="String" /> + <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> + <argument index="4" name="width" type="float" default="-1" /> + <argument index="5" name="font_size" type="int" default="16" /> + <argument index="6" name="size" type="int" default="1" /> + <argument index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> + <argument index="8" name="flags" type="int" default="3" /> + <argument index="9" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="10" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> + <description> + Draw [code]text[/code] outline into a canvas item using the font, at a given position, with [code]modulate[/code] color and [code]size[/code] outline size, optionally clipping the width and aligning horizontally. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. + See also [method CanvasItem.draw_string_outline]. + </description> + </method> + <method name="find_variation" qualifiers="const"> + <return type="RID" /> + <argument index="0" name="variation_coordinates" type="Dictionary" /> + <argument index="1" name="face_index" type="int" default="0" /> + <argument index="2" name="strength" type="float" default="0.0" /> + <argument index="3" name="transform" type="Transform2D" default="Transform2D(1, 0, 0, 1, 0, 0)" /> + <description> + Returns [TextServer] RID of the font cache for specific variation. + </description> + </method> <method name="get_ascent" qualifiers="const"> <return type="float" /> - <argument index="0" name="size" type="int" default="16" /> + <argument index="0" name="font_size" type="int" default="16" /> <description> Returns the average font ascent (number of pixels above the baseline). [b]Note:[/b] Real ascent of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the ascent of empty line). @@ -137,44 +127,53 @@ <method name="get_char_size" qualifiers="const"> <return type="Vector2" /> <argument index="0" name="char" type="int" /> - <argument index="1" name="next" type="int" default="0" /> - <argument index="2" name="size" type="int" default="16" /> + <argument index="1" name="arg1" type="int" /> <description> Returns the size of a character, optionally taking kerning into account if the next character is provided. [b]Note:[/b] Do not use this function to calculate width of the string character by character, use [method get_string_size] or [TextLine] instead. The height returned is the font height (see also [method get_height]) and has no relation to the glyph height. </description> </method> - <method name="get_data" qualifiers="const"> - <return type="FontData" /> - <argument index="0" name="idx" type="int" /> + <method name="get_descent" qualifiers="const"> + <return type="float" /> + <argument index="0" name="font_size" type="int" default="16" /> <description> - Returns the font data source at index [code]idx[/code]. If the index does not exist, returns [code]null[/code]. + Returns the average font descent (number of pixels below the baseline). + [b]Note:[/b] Real descent of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the descent of empty line). </description> </method> - <method name="get_data_count" qualifiers="const"> + <method name="get_face_count" qualifiers="const"> <return type="int" /> <description> - Returns the number of font data sources. + Returns number of faces in the TrueType / OpenType collection. </description> </method> - <method name="get_data_rid" qualifiers="const"> - <return type="RID" /> - <argument index="0" name="idx" type="int" /> + <method name="get_fallbacks" qualifiers="const"> + <return type="Font[]" /> <description> - Returns TextServer RID of the font data resources. + Returns array of fallback [Font]s. </description> </method> - <method name="get_descent" qualifiers="const"> - <return type="float" /> - <argument index="0" name="size" type="int" default="16" /> + <method name="get_font_name" qualifiers="const"> + <return type="String" /> <description> - Returns the average font descent (number of pixels below the baseline). - [b]Note:[/b] Real descent of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the descent of empty line). + Returns font family name. + </description> + </method> + <method name="get_font_style" qualifiers="const"> + <return type="int" /> + <description> + Returns font style flags, see [enum TextServer.FontStyle]. + </description> + </method> + <method name="get_font_style_name" qualifiers="const"> + <return type="String" /> + <description> + Returns font style name. </description> </method> <method name="get_height" qualifiers="const"> <return type="float" /> - <argument index="0" name="size" type="int" default="16" /> + <argument index="0" name="font_size" type="int" default="16" /> <description> Returns the total average font height (ascent plus descent) in pixels. [b]Note:[/b] Real height of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the height of empty line). @@ -183,18 +182,28 @@ <method name="get_multiline_string_size" qualifiers="const"> <return type="Vector2" /> <argument index="0" name="text" type="String" /> - <argument index="1" name="width" type="float" default="-1" /> - <argument index="2" name="size" type="int" default="16" /> - <argument index="3" name="flags" type="int" default="96" /> + <argument index="1" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> + <argument index="2" name="width" type="float" default="-1" /> + <argument index="3" name="font_size" type="int" default="16" /> + <argument index="4" name="max_lines" type="int" default="-1" /> + <argument index="5" name="flags" type="int" default="96" /> + <argument index="6" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="7" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> <description> Returns the size of a bounding box of a string broken into the lines, taking kerning and advance into account. See also [method draw_multiline_string]. </description> </method> + <method name="get_opentype_features" qualifiers="const"> + <return type="Dictionary" /> + <description> + Returns a set of OpenType feature tags. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. + </description> + </method> <method name="get_rids" qualifiers="const"> - <return type="Array" /> + <return type="RID[]" /> <description> - Returns [Array] of valid [FontData] [RID]s, which can be passed to the [TextServer] methods. + Returns [Array] of valid [Font] [RID]s, which can be passed to the [TextServer] methods. </description> </method> <method name="get_spacing" qualifiers="const"> @@ -207,10 +216,12 @@ <method name="get_string_size" qualifiers="const"> <return type="Vector2" /> <argument index="0" name="text" type="String" /> - <argument index="1" name="size" type="int" default="16" /> - <argument index="2" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> - <argument index="3" name="width" type="float" default="-1" /> + <argument index="1" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> + <argument index="2" name="width" type="float" default="-1" /> + <argument index="3" name="font_size" type="int" default="16" /> <argument index="4" name="flags" type="int" default="3" /> + <argument index="5" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="6" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> <description> Returns the size of a bounding box of a string, taking kerning and advance into account. [b]Note:[/b] Real height of the string is context-dependent and can be significantly different from the value returned by [method get_height]. @@ -224,9 +235,22 @@ If a given character is included in more than one font data source, it appears only once in the returned string. </description> </method> + <method name="get_supported_feature_list" qualifiers="const"> + <return type="Dictionary" /> + <description> + Returns list of OpenType features supported by font. + </description> + </method> + <method name="get_supported_variation_list" qualifiers="const"> + <return type="Dictionary" /> + <description> + Returns list of supported [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]variation coordinates[/url], each coordinate is returned as [code]tag: Vector3i(min_value,max_value,default_value)[/code]. + Font variations allow for continuous change of glyph characteristics along some given design axis, such as weight, width or slant. + </description> + </method> <method name="get_underline_position" qualifiers="const"> <return type="float" /> - <argument index="0" name="size" type="int" default="16" /> + <argument index="0" name="font_size" type="int" default="16" /> <description> Returns average pixel offset of the underline below the baseline. [b]Note:[/b] Real underline position of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate. @@ -234,7 +258,7 @@ </method> <method name="get_underline_thickness" qualifiers="const"> <return type="float" /> - <argument index="0" name="size" type="int" default="16" /> + <argument index="0" name="font_size" type="int" default="16" /> <description> Returns average thickness of the underline. [b]Note:[/b] Real underline thickness of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate. @@ -247,45 +271,34 @@ Returns [code]true[/code] if a Unicode [code]char[/code] is available in the font. </description> </method> - <method name="remove_data"> - <return type="void" /> - <argument index="0" name="idx" type="int" /> + <method name="is_language_supported" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="language" type="String" /> <description> - Removes the font data source at index [code]idx[/code]. If the index does not exist, nothing happens. + Returns [code]true[/code], if font supports given language ([url=https://en.wikipedia.org/wiki/ISO_639-1]ISO 639[/url] code). </description> </method> - <method name="set_data"> - <return type="void" /> - <argument index="0" name="idx" type="int" /> - <argument index="1" name="data" type="FontData" /> + <method name="is_script_supported" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="script" type="String" /> <description> - Sets the font data source at index [code]idx[/code]. If the index does not exist, nothing happens. + Returns [code]true[/code], if font supports given script ([url=https://en.wikipedia.org/wiki/ISO_15924]ISO 15924[/url] code). </description> </method> - <method name="set_spacing"> + <method name="set_cache_capacity"> <return type="void" /> - <argument index="0" name="spacing" type="int" enum="TextServer.SpacingType" /> - <argument index="1" name="value" type="int" /> + <argument index="0" name="single_line" type="int" /> + <argument index="1" name="multi_line" type="int" /> <description> - Sets the spacing for [code]type[/code] (see [enum TextServer.SpacingType]) to [code]value[/code] in pixels (not relative to the font size). + Sets LRU cache capacity for [code]draw_*[/code] methods. </description> </method> - <method name="update_changes"> + <method name="set_fallbacks"> <return type="void" /> + <argument index="0" name="fallbacks" type="Font[]" /> <description> - After editing a font (changing data sources, etc.). Call this function to propagate changes to controls that might use it. + Sets array of fallback [Font]s. </description> </method> </methods> - <members> - <member name="spacing_bottom" type="int" setter="set_spacing" getter="get_spacing" default="0"> - Extra spacing at the bottom of the line in pixels. - </member> - <member name="spacing_top" type="int" setter="set_spacing" getter="get_spacing" default="0"> - Extra spacing at the top of the line in pixels. - </member> - <member name="variation_coordinates" type="Dictionary" setter="set_variation_coordinates" getter="get_variation_coordinates" default="{}"> - Default font [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]variation coordinates[/url]. - </member> - </members> </class> diff --git a/doc/classes/FontData.xml b/doc/classes/FontFile.xml index d32e7b3a94..98abc87b84 100644 --- a/doc/classes/FontData.xml +++ b/doc/classes/FontFile.xml @@ -1,13 +1,32 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="FontData" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="FontFile" inherits="Font" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Font source data and prerendered glyph cache, imported from dynamic or bitmap font. + FontFile source data and prerendered glyph cache, imported from dynamic or bitmap font. + </brief_description> + <description> + [FontFile] contains a set of glyphs to represent Unicode characters imported from a font file, as well as a cache of rasterized glyphs, and a set of fallback [Font]s to use. + Use [FontVariation] to access specific OpenType variation of the font, create simulated bold / slanted version, and draw lines of text. + For more complex text processing, use [FontVariation] in conjunction with [TextLine] or [TextParagraph]. Supported font formats: - Dynamic font importer: TrueType (.ttf), TrueType collection (.ttc), OpenType (.otf), OpenType collection (.otc), WOFF (.woff), WOFF2 (.woff2), Type 1 (.pfb, .pfm). - Bitmap font importer: AngelCode BMFont (.fnt, .font), text and binary (version 3) format variants. - Monospace image font importer: All supported image formats. - </brief_description> - <description> + [b]Note:[/b] A character is a symbol that represents an item (letter, digit etc.) in an abstract way. + [b]Note:[/b] A glyph is a bitmap or shape used to draw a one or more characters in a context-dependent manner. Glyph indices are bound to the specific font data source. + [b]Note:[/b] If a none of the font data sources contain glyphs for a character used in a string, the character in question will be replaced with a box displaying its hexadecimal code. + + [codeblocks] + [gdscript] + var f = load("res://BarlowCondensed-Bold.ttf") + $"Label".set("custom_fonts/font", f) + $"Label".set("custom_fonts/font_size", 64) + [/gdscript] + [csharp] + var f = ResourceLoader.Load<FontFile>("res://BarlowCondensed-Bold.ttf"); + GetNode("Label").Set("custom_fonts/font", f); + GetNode("Label").Set("custom_font_sizes/font_size", 64); + [/csharp] + [/codeblocks] </description> <tutorials> </tutorials> @@ -51,14 +70,7 @@ [b]Note:[/b] This function will not remove glyphs associated with the texture, use [method remove_glyph] to remove them manually. </description> </method> - <method name="find_cache" qualifiers="const"> - <return type="RID" /> - <argument index="0" name="variation_coordinates" type="Dictionary" /> - <description> - Returns existing or creates a new font cache entry for the specified variation coordinates. - </description> - </method> - <method name="get_ascent" qualifiers="const"> + <method name="get_cache_ascent" qualifiers="const"> <return type="float" /> <argument index="0" name="cache_index" type="int" /> <argument index="1" name="size" type="int" /> @@ -72,25 +84,46 @@ Returns number of the font cache entries. </description> </method> - <method name="get_cache_rid" qualifiers="const"> - <return type="RID" /> + <method name="get_cache_descent" qualifiers="const"> + <return type="float" /> + <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="size" type="int" /> + <description> + </description> + </method> + <method name="get_cache_scale" qualifiers="const"> + <return type="float" /> + <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="size" type="int" /> + <description> + </description> + </method> + <method name="get_cache_underline_position" qualifiers="const"> + <return type="float" /> <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="size" type="int" /> <description> - Returns text server font cache entry resource id. </description> </method> - <method name="get_descent" qualifiers="const"> + <method name="get_cache_underline_thickness" qualifiers="const"> <return type="float" /> <argument index="0" name="cache_index" type="int" /> <argument index="1" name="size" type="int" /> <description> - Returns font descent (number of pixels below the baseline). </description> </method> - <method name="get_face_count" qualifiers="const"> + <method name="get_embolden" qualifiers="const"> + <return type="float" /> + <argument index="0" name="cache_index" type="int" /> + <description> + Returns embolden strength, if is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. + </description> + </method> + <method name="get_face_index" qualifiers="const"> <return type="int" /> + <argument index="0" name="cache_index" type="int" /> <description> - Returns number of faces in the TrueType / OpenType collection. + Recturns an active face index in the TrueType / OpenType collection. </description> </method> <method name="get_glyph_advance" qualifiers="const"> @@ -186,14 +219,6 @@ Returns list of language support overrides. </description> </method> - <method name="get_scale" qualifiers="const"> - <return type="float" /> - <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> - <description> - Returns scaling factor of the color bitmap font. - </description> - </method> <method name="get_script_support_override" qualifiers="const"> <return type="bool" /> <argument index="0" name="script" type="String" /> @@ -214,34 +239,6 @@ Returns list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size. </description> </method> - <method name="get_spacing" qualifiers="const"> - <return type="int" /> - <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="spacing_type" type="int" enum="TextServer.SpacingType" /> - <description> - Returns extra spacing added between glyphs in pixels. - </description> - </method> - <method name="get_supported_chars" qualifiers="const"> - <return type="String" /> - <description> - Returns a string containing all the characters available in the font. - </description> - </method> - <method name="get_supported_feature_list" qualifiers="const"> - <return type="Dictionary" /> - <description> - Returns list of OpenType features supported by font. - </description> - </method> - <method name="get_supported_variation_list" qualifiers="const"> - <return type="Dictionary" /> - <description> - Returns list of supported [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]variation coordinates[/url], each coordinate is returned as [code]tag: Vector3i(min_value,max_value,default_value)[/code]. - Font variations allow for continuous change of glyph characteristics along some given design axis, such as weight, width or slant. - </description> - </method> <method name="get_texture_count" qualifiers="const"> <return type="int" /> <argument index="0" name="cache_index" type="int" /> @@ -268,48 +265,18 @@ Returns a copy of the array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty. </description> </method> - <method name="get_underline_position" qualifiers="const"> - <return type="float" /> - <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> - <description> - Returns pixel offset of the underline below the baseline. - </description> - </method> - <method name="get_underline_thickness" qualifiers="const"> - <return type="float" /> + <method name="get_transform" qualifiers="const"> + <return type="Transform2D" /> <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> <description> - Returns thickness of the underline in pixels. + Returns 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs. </description> </method> <method name="get_variation_coordinates" qualifiers="const"> <return type="Dictionary" /> <argument index="0" name="cache_index" type="int" /> <description> - Returns variation coordinates for the specified font cache entry. See [method get_supported_variation_list] for more info. - </description> - </method> - <method name="has_char" qualifiers="const"> - <return type="bool" /> - <argument index="0" name="char" type="int" /> - <description> - Returns [code]true[/code] if a Unicode [code]char[/code] is available in the font. - </description> - </method> - <method name="is_language_supported" qualifiers="const"> - <return type="bool" /> - <argument index="0" name="language" type="String" /> - <description> - Returns [code]true[/code], if font supports given language ([url=https://en.wikipedia.org/wiki/ISO_639-1]ISO 639[/url] code). - </description> - </method> - <method name="is_script_supported" qualifiers="const"> - <return type="bool" /> - <argument index="0" name="script" type="String" /> - <description> - Returns [code]true[/code], if font supports given script ([url=https://en.wikipedia.org/wiki/ISO_15924]ISO 15924[/url] code). + Returns variation coordinates for the specified font cache entry. See [method Font.get_supported_variation_list] for more info. </description> </method> <method name="load_bitmap_font"> @@ -324,8 +291,7 @@ <return type="int" enum="Error" /> <argument index="0" name="path" type="String" /> <description> - Loads a TrueType (.ttf), TrueType collection (.ttc), OpenType (.otf), OpenType collection (.otc), WOFF (.woff), WOFF2 (.woff2) or Type 1 (.pfb, .pfm) dynamic font from file [code]path[/code]. - [b]Note:[/b] Use [member face_index] to select specific face from the collection file. + Loads a TrueType (.ttf), OpenType (.otf), WOFF (.woff), WOFF2 (.woff2) or Type 1 (.pfb, .pfm) dynamic font from file [code]path[/code]. [b]Warning:[/b] This method should only be used in the editor or in cases when you need to load external fonts at run-time, such as fonts located at the [code]user://[/code] directory. </description> </method> @@ -383,8 +349,8 @@ <argument index="1" name="size" type="Vector2i" /> <argument index="2" name="texture_index" type="int" /> <description> - Removes specified texture from font cache entry. - [b]Note:[/b] This function will not remove glyphs associated with the texture, remove them manually, using [method remove_glyph]. + Removes specified texture from the cache entry. + [b]Note:[/b] This function will not remove glyphs associated with the texture. Remove them manually using [method remove_glyph]. </description> </method> <method name="render_glyph"> @@ -393,7 +359,7 @@ <argument index="1" name="size" type="Vector2i" /> <argument index="2" name="index" type="int" /> <description> - Renders specified glyph the the font cache texture. + Renders specified glyph to the font cache texture. </description> </method> <method name="render_range"> @@ -406,22 +372,60 @@ Renders the range of characters to the font cache texture. </description> </method> - <method name="set_ascent"> + <method name="set_cache_ascent"> <return type="void" /> <argument index="0" name="cache_index" type="int" /> <argument index="1" name="size" type="int" /> <argument index="2" name="ascent" type="float" /> <description> - Sets the font ascent (number of pixels above the baseline). </description> </method> - <method name="set_descent"> + <method name="set_cache_descent"> <return type="void" /> <argument index="0" name="cache_index" type="int" /> <argument index="1" name="size" type="int" /> <argument index="2" name="descent" type="float" /> <description> - Sets the font descent (number of pixels below the baseline). + </description> + </method> + <method name="set_cache_scale"> + <return type="void" /> + <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="scale" type="float" /> + <description> + </description> + </method> + <method name="set_cache_underline_position"> + <return type="void" /> + <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="underline_position" type="float" /> + <description> + </description> + </method> + <method name="set_cache_underline_thickness"> + <return type="void" /> + <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="underline_thickness" type="float" /> + <description> + </description> + </method> + <method name="set_embolden"> + <return type="void" /> + <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="strength" type="float" /> + <description> + Sets embolden strength, if is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. + </description> + </method> + <method name="set_face_index"> + <return type="void" /> + <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="face_index" type="int" /> + <description> + Sets an active face index in the TrueType / OpenType collection. </description> </method> <method name="set_glyph_advance"> @@ -490,16 +494,7 @@ <argument index="0" name="language" type="String" /> <argument index="1" name="supported" type="bool" /> <description> - Adds override for [method is_language_supported]. - </description> - </method> - <method name="set_scale"> - <return type="void" /> - <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="scale" type="float" /> - <description> - Sets scaling factor of the color bitmap font. + Adds override for [method Font.is_language_supported]. </description> </method> <method name="set_script_support_override"> @@ -507,17 +502,7 @@ <argument index="0" name="script" type="String" /> <argument index="1" name="supported" type="bool" /> <description> - Adds override for [method is_script_supported]. - </description> - </method> - <method name="set_spacing"> - <return type="void" /> - <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="spacing_type" type="int" enum="TextServer.SpacingType" /> - <argument index="3" name="value" type="int" /> - <description> - Sets extra spacing added between glyphs in pixels. + Adds override for [method Font.is_script_supported]. </description> </method> <method name="set_texture_image"> @@ -540,22 +525,12 @@ Sets array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty (for the fonts without dynamic glyph generation support). </description> </method> - <method name="set_underline_position"> + <method name="set_transform"> <return type="void" /> <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="underline_position" type="float" /> + <argument index="1" name="transform" type="Transform2D" /> <description> - Sets pixel offset of the underline below the baseline. - </description> - </method> - <method name="set_underline_thickness"> - <return type="void" /> - <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="underline_thickness" type="float" /> - <description> - Sets thickness of the underline in pixels. + Sets 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs. </description> </method> <method name="set_variation_coordinates"> @@ -563,7 +538,7 @@ <argument index="0" name="cache_index" type="int" /> <argument index="1" name="variation_coordinates" type="Dictionary" /> <description> - Sets variation coordinates for the specified font cache entry. See [method get_supported_variation_list] for more info. + Sets variation coordinates for the specified font cache entry. See [method Font.get_supported_variation_list] for more info. </description> </method> </methods> @@ -574,11 +549,8 @@ <member name="data" type="PackedByteArray" setter="set_data" getter="get_data" default="PackedByteArray()"> Contents of the dynamic font source file. </member> - <member name="embolden" type="float" setter="set_embolden" getter="get_embolden" default="0.0"> - If is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. - </member> - <member name="face_index" type="int" setter="set_face_index" getter="get_face_index" default="0"> - Active face index in the TrueType / OpenType collection file. + <member name="fallbacks" type="Font[]" setter="set_fallbacks" getter="get_fallbacks" default="[]"> + Array of fallback [Font]s. </member> <member name="fixed_size" type="int" setter="set_fixed_size" getter="get_fixed_size" default="0"> Font size, used only for the bitmap fonts. @@ -619,9 +591,5 @@ <member name="subpixel_positioning" type="int" setter="set_subpixel_positioning" getter="get_subpixel_positioning" enum="TextServer.SubpixelPositioning" default="1"> Font glyph sub-pixel positioning mode. Subpixel positioning provides shaper text and better kerning for smaller font sizes, at the cost of memory usage and font rasterization speed. Use [constant TextServer.SUBPIXEL_POSITIONING_AUTO] to automatically enable it based on the font size. </member> - <member name="transform" type="Transform2D" setter="set_transform" getter="get_transform" default="Transform2D(1, 0, 0, 1, 0, 0)"> - 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs. - For example, to simulate italic typeface by slanting, apply the following transform [code]Transform2D(1.0, slant, 0.0, 1.0, 0.0, 0.0)[/code]. - </member> </members> </class> diff --git a/doc/classes/FontVariation.xml b/doc/classes/FontVariation.xml new file mode 100644 index 0000000000..a1b96fb137 --- /dev/null +++ b/doc/classes/FontVariation.xml @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="FontVariation" inherits="Font" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + Variation of the [Font]. + </brief_description> + <description> + OpenType variations, simulated bold / slant, and additional font settings like OpenType features and extra spacing. + + To use simulated bold font variant: + [codeblocks] + [gdscript] + var fv = FontVariation.new() + fv.set_base_font(load("res://BarlowCondensed-Regular.ttf")) + fv.set_variation_embolden(1.2); + $"Label".set("custom_fonts/font", fv) + $"Label".set("custom_fonts/font_size", 64) + [/gdscript] + [csharp] + var fv = new FontVariation(); + fv.SetBaseFont(ResourceLoader.Load<FontFile>("res://BarlowCondensed-Regular.ttf")); + fv.SetVariationEmbolden(1.2); + GetNode("Label").Set("custom_fonts/font", fv); + GetNode("Label").Set("custom_font_sizes/font_size", 64); + [/csharp] + [/codeblocks] + </description> + <tutorials> + </tutorials> + <methods> + <method name="set_spacing"> + <return type="void" /> + <argument index="0" name="spacing" type="int" enum="TextServer.SpacingType" /> + <argument index="1" name="value" type="int" /> + <description> + Sets the spacing for [code]type[/code] (see [enum TextServer.SpacingType]) to [code]value[/code] in pixels (not relative to the font size). + </description> + </method> + </methods> + <members> + <member name="base_font" type="Font" setter="set_base_font" getter="get_base_font"> + Base font used to create a variation. If not set, default [Theme] font is used. + </member> + <member name="fallbacks" type="Font[]" setter="set_fallbacks" getter="get_fallbacks" default="[]"> + Array of fallback [Font]s. If not set [member base_font] fallback are ussed. + </member> + <member name="opentype_features" type="Dictionary" setter="set_opentype_features" getter="get_opentype_features" default="{}"> + A set of OpenType feature tags. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. + </member> + <member name="spacing_bottom" type="int" setter="set_spacing" getter="get_spacing" default="0"> + Extra spacing at the bottom of the line in pixels. + </member> + <member name="spacing_glyph" type="int" setter="set_spacing" getter="get_spacing" default="0"> + Extra spacing between graphical glyphs + </member> + <member name="spacing_space" type="int" setter="set_spacing" getter="get_spacing" default="0"> + Extra width of the space glyphs. + </member> + <member name="spacing_top" type="int" setter="set_spacing" getter="get_spacing" default="0"> + Extra spacing at the top of the line in pixels. + </member> + <member name="variation_embolden" type="float" setter="set_variation_embolden" getter="get_variation_embolden" default="0.0"> + If is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. + [b]Note:[/b] Emboldened fonts might have self-intersecting outlines, which will prevent MSDF fonts and [TextMesh] from working correctly. + </member> + <member name="variation_face_index" type="int" setter="set_variation_face_index" getter="get_variation_face_index" default="0"> + Active face index in the TrueType / OpenType collection file. + </member> + <member name="variation_opentype" type="Dictionary" setter="set_variation_opentype" getter="get_variation_opentype" default="{}"> + Font OpenType variation coordinates. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]OpenType variation tags[/url]. + </member> + <member name="variation_transform" type="Transform2D" setter="set_variation_transform" getter="get_variation_transform" default="Transform2D(1, 0, 0, 1, 0, 0)"> + 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs. + For example, to simulate italic typeface by slanting, apply the following transform [code]Transform2D(1.0, slant, 0.0, 1.0, 0.0, 0.0)[/code]. + </member> + </members> +</class> diff --git a/doc/classes/GraphNode.xml b/doc/classes/GraphNode.xml index f261da8413..36dbae1d74 100644 --- a/doc/classes/GraphNode.xml +++ b/doc/classes/GraphNode.xml @@ -17,12 +17,6 @@ Disables all input and output slots of the GraphNode. </description> </method> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> <method name="clear_slot"> <return type="void" /> <argument index="0" name="idx" type="int" /> @@ -98,13 +92,6 @@ Returns the type of the output connection [code]idx[/code]. </description> </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> <method name="get_slot_color_left" qualifiers="const"> <return type="Color" /> <argument index="0" name="idx" type="int" /> @@ -154,14 +141,6 @@ Returns [code]true[/code] if right (output) side of the slot [code]idx[/code] is enabled. </description> </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> <method name="set_slot"> <return type="void" /> <argument index="0" name="idx" type="int" /> diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index 66683fa0ee..e73021ead4 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -375,6 +375,7 @@ <member name="use_accumulated_input" type="bool" setter="set_use_accumulated_input" getter="is_using_accumulated_input"> If [code]true[/code], similar input events sent by the operating system are accumulated. When input accumulation is enabled, all input events generated during a frame will be merged and emitted when the frame is done rendering. Therefore, this limits the number of input method calls per second to the rendering FPS. Input accumulation can be disabled to get slightly more precise/reactive input at the cost of increased CPU usage. In applications where drawing freehand lines is required, input accumulation should generally be disabled while the user is drawing the line to get results that closely follow the actual input. + [b]Note:[/b] Input accumulation is [i]enabled[/i] by default. </member> </members> <signals> diff --git a/doc/classes/InputEventMouseMotion.xml b/doc/classes/InputEventMouseMotion.xml index ad74204d82..83aad587a5 100644 --- a/doc/classes/InputEventMouseMotion.xml +++ b/doc/classes/InputEventMouseMotion.xml @@ -12,6 +12,10 @@ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> </tutorials> <members> + <member name="pen_inverted" type="bool" setter="set_pen_inverted" getter="get_pen_inverted" default="false"> + Returns [code]true[/code] when using the eraser end of a stylus pen. + [b]Note:[/b] This property is implemented on Linux, macOS and Windows. + </member> <member name="pressure" type="float" setter="set_pressure" getter="get_pressure" default="0.0"> Represents the pressure the user puts on the pen. Ranges from [code]0.0[/code] to [code]1.0[/code]. </member> diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml index d52234e9ac..15c97b0838 100644 --- a/doc/classes/ItemList.xml +++ b/doc/classes/ItemList.xml @@ -38,13 +38,6 @@ Removes all items from the list. </description> </method> - <method name="clear_item_opentype_features"> - <return type="void" /> - <argument index="0" name="idx" type="int" /> - <description> - Removes all OpenType features from the item's text. - </description> - </method> <method name="deselect"> <return type="void" /> <argument index="0" name="idx" type="int" /> @@ -122,14 +115,6 @@ Returns the metadata value of the specified index. </description> </method> - <method name="get_item_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="idx" type="int" /> - <argument index="1" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code] of the item's text. - </description> - </method> <method name="get_item_text" qualifiers="const"> <return type="String" /> <argument index="0" name="idx" type="int" /> @@ -302,15 +287,6 @@ Sets a value (of any type) to be stored with the item associated with the specified index. </description> </method> - <method name="set_item_opentype_feature"> - <return type="void" /> - <argument index="0" name="idx" type="int" /> - <argument index="1" name="tag" type="String" /> - <argument index="2" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code] for the item's text. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> <method name="set_item_selectable"> <return type="void" /> <argument index="0" name="idx" type="int" /> diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml index b5f045621b..1eac58b9f2 100644 --- a/doc/classes/Label.xml +++ b/doc/classes/Label.xml @@ -11,12 +11,6 @@ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> </tutorials> <methods> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> <method name="get_line_count" qualifiers="const"> <return type="int" /> <description> @@ -32,13 +26,6 @@ If there're no lines returns font size in pixels. </description> </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> <method name="get_total_character_count" qualifiers="const"> <return type="int" /> <description> @@ -51,14 +38,6 @@ Returns the number of lines shown. Useful if the [Label]'s height cannot currently display all lines. </description> </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> </methods> <members> <member name="autowrap_mode" type="int" setter="set_autowrap_mode" getter="get_autowrap_mode" enum="TextServer.AutowrapMode" default="0"> @@ -119,7 +98,7 @@ Default text [Color] of the [Label]. </theme_item> <theme_item name="font_outline_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> - The tint of [Font]'s outline. + The tint of text outline. </theme_item> <theme_item name="font_shadow_color" data_type="color" type="Color" default="Color(0, 0, 0, 0)"> [Color] of the text's shadow effect. diff --git a/doc/classes/Label3D.xml b/doc/classes/Label3D.xml index 47126575f7..2c3c27079a 100644 --- a/doc/classes/Label3D.xml +++ b/doc/classes/Label3D.xml @@ -9,12 +9,6 @@ <tutorials> </tutorials> <methods> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> <method name="generate_triangle_mesh" qualifiers="const"> <return type="TriangleMesh" /> <description> @@ -28,13 +22,6 @@ Returns the value of the specified flag. </description> </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> <method name="set_draw_flag"> <return type="void" /> <argument index="0" name="flag" type="int" enum="Label3D.DrawFlags" /> @@ -43,14 +30,6 @@ If [code]true[/code], the specified flag will be enabled. See [enum Label3D.DrawFlags] for a list of flags. </description> </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> </methods> <members> <member name="alpha_cut" type="int" setter="set_alpha_cut_mode" getter="get_alpha_cut_mode" enum="Label3D.AlphaCutMode" default="0"> @@ -72,7 +51,7 @@ If [code]true[/code], the label is rendered at the same size regardless of distance. </member> <member name="font" type="Font" setter="set_font" getter="get_font"> - [Font] used for the [Label3D]'s text. + Font configuration used to display text. </member> <member name="font_size" type="int" setter="set_font_size" getter="get_font_size" default="16"> Font size of the [Label3D]'s text. @@ -96,7 +75,7 @@ The text drawing offset (in pixels). </member> <member name="outline_modulate" type="Color" setter="set_outline_modulate" getter="get_outline_modulate" default="Color(0, 0, 0, 1)"> - The tint of [Font]'s outline. + The tint of text outline. </member> <member name="outline_render_priority" type="int" setter="set_outline_render_priority" getter="get_outline_render_priority" default="-1"> Sets the render priority for the text outline. Higher priority objects will be sorted in front of lower priority objects. diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml index 4d8fd63257..0ebd83c882 100644 --- a/doc/classes/Light3D.xml +++ b/doc/classes/Light3D.xml @@ -73,6 +73,7 @@ </member> <member name="light_projector" type="Texture2D" setter="set_projector" getter="get_projector"> [Texture2D] projected by light. [member shadow_enabled] must be on for the projector to work. Light projectors make the light appear as if it is shining through a colored but transparent object, almost like light shining through stained-glass. + [b]Note:[/b] Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for light projector textures is set globally with [member ProjectSettings.rendering/textures/light_projectors/filter]. </member> <member name="light_size" type="float" setter="set_param" getter="get_param" default="0.0"> The size of the light in Godot units. Only available for [OmniLight3D]s and [SpotLight3D]s. Increasing this value will make the light fade out slower and shadows appear blurrier. This can be used to simulate area lights to an extent. diff --git a/doc/classes/LightmapGI.xml b/doc/classes/LightmapGI.xml index ffde0d95ce..c0766cd1ec 100644 --- a/doc/classes/LightmapGI.xml +++ b/doc/classes/LightmapGI.xml @@ -21,7 +21,7 @@ Number of light bounces that are taken into account during baking. Higher values result in brighter, more realistic lighting, at the cost of longer bake times. If set to [code]0[/code], only environment lighting, direct light and emissive lighting is baked. </member> <member name="directional" type="bool" setter="set_directional" getter="is_directional" default="false"> - If [code]true[/code], bakes lightmaps to contain directional information as spherical harmonics. This results in more realistic lighting appearance, especially with normal mapped materials and for lights that their have direct light baked ([member Light3D.light_bake_mode] set to [constant Light3D.BAKE_STATIC]). The directional information is also used to provide rough reflections for static and dynamic objects. This has a small run-time performance cost as the shader has to perform more work to interpret the direction information from the lightmap. Directional lightmaps also take longer to bake and result in larger file sizes. + If [code]true[/code], bakes lightmaps to contain directional information as spherical harmonics. This results in more realistic lighting appearance, especially with normal mapped materials and for lights that have their direct light baked ([member Light3D.light_bake_mode] set to [constant Light3D.BAKE_STATIC]). The directional information is also used to provide rough reflections for static and dynamic objects. This has a small run-time performance cost as the shader has to perform more work to interpret the direction information from the lightmap. Directional lightmaps also take longer to bake and result in larger file sizes. [b]Note:[/b] The property's name has no relationship with [DirectionalLight3D]. [member directional] works with all light types. </member> <member name="environment_custom_color" type="Color" setter="set_environment_custom_color" getter="get_environment_custom_color"> diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index 55e012ee0c..84471bafc0 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -37,12 +37,6 @@ Erases the [LineEdit]'s [member text]. </description> </method> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> <method name="delete_char_at_caret"> <return type="void" /> <description> @@ -70,13 +64,6 @@ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property. </description> </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> <method name="get_scroll_offset" qualifiers="const"> <return type="int" /> <description> @@ -149,14 +136,6 @@ Selects the whole [String]. </description> </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> </methods> <members> <member name="alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="0"> diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml index ba80504caf..7c6ff2d4e1 100644 --- a/doc/classes/LinkButton.xml +++ b/doc/classes/LinkButton.xml @@ -9,29 +9,6 @@ </description> <tutorials> </tutorials> - <methods> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> - </methods> <members> <member name="language" type="String" setter="set_language" getter="get_language" default=""""> Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index 73413b379e..5da2196f29 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -182,13 +182,6 @@ Removes all items from the [PopupMenu]. </description> </method> - <method name="clear_item_opentype_features"> - <return type="void" /> - <argument index="0" name="index" type="int" /> - <description> - Removes all OpenType features form the item's text. - </description> - </method> <method name="get_current_index" qualifiers="const"> <return type="int" /> <description> @@ -244,14 +237,6 @@ Returns the metadata of the specified item, which might be of any type. You can set it with [method set_item_metadata], which provides a simple way of assigning context data to items. </description> </method> - <method name="get_item_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="index" type="int" /> - <argument index="1" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code] of the item's text. - </description> - </method> <method name="get_item_shortcut" qualifiers="const"> <return type="Shortcut" /> <argument index="0" name="index" type="int" /> @@ -452,15 +437,6 @@ Sets the state of a multistate item. See [method add_multistate_item] for details. </description> </method> - <method name="set_item_opentype_feature"> - <return type="void" /> - <argument index="0" name="index" type="int" /> - <argument index="1" name="tag" type="String" /> - <argument index="2" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code] for the item's text. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> <method name="set_item_shortcut"> <return type="void" /> <argument index="0" name="index" type="int" /> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 553005c4c4..7c378f33fe 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -628,7 +628,7 @@ Path to a custom [Font] resource to use as default for all GUI elements of the project. </member> <member name="gui/theme/default_font_antialiased" type="bool" setter="" getter="" default="true"> - If set to [code]true[/code], default font uses 8-bit anitialiased glyph rendering. See [member FontData.antialiased]. + If set to [code]true[/code], default font uses 8-bit anitialiased glyph rendering. See [member FontFile.antialiased]. </member> <member name="gui/theme/default_font_generate_mipmaps" type="bool" setter="" getter="" default="false"> If set to [code]true[/code], the default font will have mipmaps generated. This prevents text from looking grainy when a [Control] is scaled down, or when a [Label3D] is viewed from a long distance (if [member Label3D.texture_filter] is set to a mode that displays mipmaps). @@ -636,7 +636,7 @@ [b]Note:[/b] This setting does not affect custom [Font]s used within the project. </member> <member name="gui/theme/default_font_hinting" type="int" setter="" getter="" default="1"> - Default font hinting mode. See [member FontData.hinting]. + Default font hinting mode. See [member FontFile.hinting]. </member> <member name="gui/theme/default_font_multichannel_signed_distance_field" type="bool" setter="" getter="" default="false"> If set to [code]true[/code], the default font will use multichannel signed distance field (MSDF) for crisp rendering at any size. Since this approach does not rely on rasterizing the font every time its size changes, this allows for resizing the font in real-time without any performance penalty. Text will also not look grainy for [Control]s that are scaled down (or for [Label3D]s viewed from a long distance). @@ -644,7 +644,7 @@ [b]Note:[/b] This setting does not affect custom [Font]s used within the project. </member> <member name="gui/theme/default_font_subpixel_positioning" type="int" setter="" getter="" default="1"> - Default font glyph sub-pixel positioning mode. See [member FontData.subpixel_positioning]. + Default font glyph sub-pixel positioning mode. See [member FontFile.subpixel_positioning]. </member> <member name="gui/theme/default_theme_scale" type="float" setter="" getter="" default="1.0"> </member> diff --git a/doc/classes/ResourceSaver.xml b/doc/classes/ResourceSaver.xml index 815c7e8813..213d8c585a 100644 --- a/doc/classes/ResourceSaver.xml +++ b/doc/classes/ResourceSaver.xml @@ -37,7 +37,7 @@ <return type="int" enum="Error" /> <argument index="0" name="path" type="String" /> <argument index="1" name="resource" type="Resource" /> - <argument index="2" name="flags" type="int" default="0" /> + <argument index="2" name="flags" type="int" enum="ResourceSaver.SaverFlags" default="0" /> <description> Saves a resource to disk to the given path, using a [ResourceFormatSaver] that recognizes the resource object. The [code]flags[/code] bitmask can be specified to customize the save behavior using [enum SaverFlags] flags. @@ -46,28 +46,28 @@ </method> </methods> <constants> - <constant name="FLAG_NONE" value="0" enum="SaverFlags"> + <constant name="FLAG_NONE" value="0" enum="SaverFlags" is_bitfield="true"> No resource saving option. </constant> - <constant name="FLAG_RELATIVE_PATHS" value="1" enum="SaverFlags"> + <constant name="FLAG_RELATIVE_PATHS" value="1" enum="SaverFlags" is_bitfield="true"> Save the resource with a path relative to the scene which uses it. </constant> - <constant name="FLAG_BUNDLE_RESOURCES" value="2" enum="SaverFlags"> + <constant name="FLAG_BUNDLE_RESOURCES" value="2" enum="SaverFlags" is_bitfield="true"> Bundles external resources. </constant> - <constant name="FLAG_CHANGE_PATH" value="4" enum="SaverFlags"> + <constant name="FLAG_CHANGE_PATH" value="4" enum="SaverFlags" is_bitfield="true"> Changes the [member Resource.resource_path] of the saved resource to match its new location. </constant> - <constant name="FLAG_OMIT_EDITOR_PROPERTIES" value="8" enum="SaverFlags"> + <constant name="FLAG_OMIT_EDITOR_PROPERTIES" value="8" enum="SaverFlags" is_bitfield="true"> Do not save editor-specific metadata (identified by their [code]__editor[/code] prefix). </constant> - <constant name="FLAG_SAVE_BIG_ENDIAN" value="16" enum="SaverFlags"> + <constant name="FLAG_SAVE_BIG_ENDIAN" value="16" enum="SaverFlags" is_bitfield="true"> Save as big endian (see [member File.big_endian]). </constant> - <constant name="FLAG_COMPRESS" value="32" enum="SaverFlags"> + <constant name="FLAG_COMPRESS" value="32" enum="SaverFlags" is_bitfield="true"> Compress the resource on save using [constant File.COMPRESSION_ZSTD]. Only available for binary resource types. </constant> - <constant name="FLAG_REPLACE_SUBRESOURCE_PATHS" value="64" enum="SaverFlags"> + <constant name="FLAG_REPLACE_SUBRESOURCE_PATHS" value="64" enum="SaverFlags" is_bitfield="true"> Take over the paths of the saved subresources (see [method Resource.take_over_path]). </constant> </constants> diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index 1294e5b58a..3c9e9b1bfc 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -276,18 +276,10 @@ Adds a [code][font][/code] tag to the tag stack. Overrides default fonts for its duration. </description> </method> - <method name="push_font_features"> - <return type="void" /> - <argument index="0" name="opentype_features" type="Dictionary" /> - <description> - Adds a [code][ot_feature][/code] tag to the tag stack. Overrides default OpenType font feature for its duration. - </description> - </method> <method name="push_font_size"> <return type="void" /> <argument index="0" name="font_size" type="int" /> <description> - Adds a [code][font_size][/code] tag to the tag stack. Overrides default font size for its duration. </description> </method> <method name="push_hint"> diff --git a/doc/classes/ScriptLanguageExtension.xml b/doc/classes/ScriptLanguageExtension.xml index 0f757cf806..45d4cf44fa 100644 --- a/doc/classes/ScriptLanguageExtension.xml +++ b/doc/classes/ScriptLanguageExtension.xml @@ -174,6 +174,11 @@ <description> </description> </method> + <method name="_get_public_annotations" qualifiers="virtual const"> + <return type="Dictionary[]" /> + <description> + </description> + </method> <method name="_get_public_constants" qualifiers="virtual const"> <return type="Dictionary" /> <description> @@ -378,7 +383,9 @@ </constant> <constant name="LOOKUP_RESULT_CLASS_TBD_GLOBALSCOPE" value="7" enum="LookupResultType"> </constant> - <constant name="LOOKUP_RESULT_MAX" value="8" enum="LookupResultType"> + <constant name="LOOKUP_RESULT_CLASS_ANNOTATION" value="8" enum="LookupResultType"> + </constant> + <constant name="LOOKUP_RESULT_MAX" value="9" enum="LookupResultType"> </constant> <constant name="LOCATION_LOCAL" value="0" enum="CodeCompletionLocation"> The option is local to the location of the code completion query - e.g. a local variable. diff --git a/doc/classes/StyleBox.xml b/doc/classes/StyleBox.xml index 74d02a84fd..d863e3c652 100644 --- a/doc/classes/StyleBox.xml +++ b/doc/classes/StyleBox.xml @@ -46,8 +46,8 @@ <argument index="0" name="canvas_item" type="RID" /> <argument index="1" name="rect" type="Rect2" /> <description> - Draws this stylebox using a [CanvasItem] with given [RID]. - You can get a [RID] value using [method Object.get_instance_id] on a [CanvasItem]-derived node. + Draws this stylebox using a canvas item identified by the given [RID]. + The [RID] value can either be the result of [method CanvasItem.get_canvas_item] called on an existing [CanvasItem]-derived node, or directly from creating a canvas item in the [RenderingServer] with [method RenderingServer.canvas_item_create]. </description> </method> <method name="get_center_size" qualifiers="const"> diff --git a/doc/classes/TabBar.xml b/doc/classes/TabBar.xml index a8ed0d4286..79d52b70fb 100644 --- a/doc/classes/TabBar.xml +++ b/doc/classes/TabBar.xml @@ -17,13 +17,6 @@ Adds a new tab. </description> </method> - <method name="clear_tab_opentype_features"> - <return type="void" /> - <argument index="0" name="tab_idx" type="int" /> - <description> - Removes all OpenType features from the tab title. - </description> - </method> <method name="ensure_tab_visible"> <return type="void" /> <argument index="0" name="idx" type="int" /> @@ -77,14 +70,6 @@ Returns the number of hidden tabs offsetted to the left. </description> </method> - <method name="get_tab_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tab_idx" type="int" /> - <argument index="1" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code] of the tab title. - </description> - </method> <method name="get_tab_rect" qualifiers="const"> <return type="Rect2" /> <argument index="0" name="tab_idx" type="int" /> @@ -175,15 +160,6 @@ Sets language code of tab title used for line-breaking and text shaping algorithms, if left empty current locale is used instead. </description> </method> - <method name="set_tab_opentype_feature"> - <return type="void" /> - <argument index="0" name="tab_idx" type="int" /> - <argument index="1" name="tag" type="String" /> - <argument index="2" name="values" type="int" /> - <description> - Sets OpenType feature [code]tag[/code] for the tab title. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> <method name="set_tab_text_direction"> <return type="void" /> <argument index="0" name="tab_idx" type="int" /> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 2de185903d..18a4893f03 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -85,12 +85,6 @@ Performs a full reset of [TextEdit], including undo history. </description> </method> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> <method name="clear_undo_history"> <return type="void" /> <description> @@ -355,13 +349,6 @@ Returns the count to the next visible line from [code]line[/code] to [code]line + visible_amount[/code]. Can also count backwards. For example if a [TextEdit] has 5 lines with lines 2 and 3 hidden, calling this with [code]line = 1, visible_amount = 1[/code] would return 3. </description> </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> <method name="get_pos_at_line_column" qualifiers="const"> <return type="Vector2i" /> <argument index="0" name="line" type="int" /> @@ -859,14 +846,6 @@ Sets the text for [code]gutter[/code] on [code]line[/code]. </description> </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> <method name="set_overtype_mode_enabled"> <return type="void" /> <argument index="0" name="enabled" type="bool" /> @@ -998,13 +977,16 @@ <member name="placeholder_text" type="String" setter="set_placeholder" getter="get_placeholder" default=""""> Text shown when the [TextEdit] is empty. It is [b]not[/b] the [TextEdit]'s default value (see [member text]). </member> + <member name="scroll_fit_content_height" type="bool" setter="set_fit_content_height_enabled" getter="is_fit_content_height_enabled" default="false"> + If [code]true[/code], [TextEdit] will disable vertical scroll and fit minimum height to the number of visible lines. + </member> <member name="scroll_horizontal" type="int" setter="set_h_scroll" getter="get_h_scroll" default="0"> If there is a horizontal scrollbar, this determines the current horizontal scroll value in pixels. </member> <member name="scroll_past_end_of_file" type="bool" setter="set_scroll_past_end_of_file_enabled" getter="is_scroll_past_end_of_file_enabled" default="false"> Allow scrolling past the last line into "virtual" space. </member> - <member name="scroll_smooth" type="bool" setter="set_smooth_scroll_enable" getter="is_smooth_scroll_enabled" default="false"> + <member name="scroll_smooth" type="bool" setter="set_smooth_scroll_enabled" getter="is_smooth_scroll_enabled" default="false"> Scroll smoothly over the text rather then jumping to the next location. </member> <member name="scroll_v_scroll_speed" type="float" setter="set_v_scroll_speed" getter="get_v_scroll_speed" default="80.0"> diff --git a/doc/classes/TextLine.xml b/doc/classes/TextLine.xml index f154cbbe9a..c3574980b1 100644 --- a/doc/classes/TextLine.xml +++ b/doc/classes/TextLine.xml @@ -22,11 +22,10 @@ <method name="add_string"> <return type="bool" /> <argument index="0" name="text" type="String" /> - <argument index="1" name="fonts" type="Font" /> - <argument index="2" name="size" type="int" /> - <argument index="3" name="opentype_features" type="Dictionary" default="{}" /> - <argument index="4" name="language" type="String" default="""" /> - <argument index="5" name="meta" type="Variant" default="null" /> + <argument index="1" name="font" type="Font" /> + <argument index="2" name="font_size" type="int" /> + <argument index="3" name="language" type="String" default="""" /> + <argument index="4" name="meta" type="Variant" default="null" /> <description> Adds text span and font to draw it. </description> diff --git a/doc/classes/TextMesh.xml b/doc/classes/TextMesh.xml index 5a1501d2ca..17a0ca32e4 100644 --- a/doc/classes/TextMesh.xml +++ b/doc/classes/TextMesh.xml @@ -10,29 +10,6 @@ </description> <tutorials> </tutorials> - <methods> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> - </methods> <members> <member name="curve_step" type="float" setter="set_curve_step" getter="get_curve_step" default="0.5"> Step (in pixels) used to approximate Bézier curves. @@ -41,7 +18,7 @@ Depths of the mesh, if set to [code]0.0[/code] only front surface, is generated, and UV layout is changed to use full texture for the front face only. </member> <member name="font" type="Font" setter="set_font" getter="get_font"> - [Font] used for the [TextMesh]'s text. + Font configuration used to display text. </member> <member name="font_size" type="int" setter="set_font_size" getter="get_font_size" default="16"> Font size of the [TextMesh]'s text. diff --git a/doc/classes/TextParagraph.xml b/doc/classes/TextParagraph.xml index aaaacfe3ac..6d615bd404 100644 --- a/doc/classes/TextParagraph.xml +++ b/doc/classes/TextParagraph.xml @@ -22,11 +22,10 @@ <method name="add_string"> <return type="bool" /> <argument index="0" name="text" type="String" /> - <argument index="1" name="fonts" type="Font" /> - <argument index="2" name="size" type="int" /> - <argument index="3" name="opentype_features" type="Dictionary" default="{}" /> - <argument index="4" name="language" type="String" default="""" /> - <argument index="5" name="meta" type="Variant" default="null" /> + <argument index="1" name="font" type="Font" /> + <argument index="2" name="font_size" type="int" /> + <argument index="3" name="language" type="String" default="""" /> + <argument index="4" name="meta" type="Variant" default="null" /> <description> Adds text span and font to draw it. </description> @@ -217,18 +216,6 @@ Returns the size of the bounding box of the paragraph. </description> </method> - <method name="get_spacing_bottom" qualifiers="const"> - <return type="int" /> - <description> - Returns extra spacing at the bottom of the line. See [member Font.spacing_bottom]. - </description> - </method> - <method name="get_spacing_top" qualifiers="const"> - <return type="int" /> - <description> - Returns extra spacing at the top of the line. See [member Font.spacing_top]. - </description> - </method> <method name="hit_test" qualifiers="const"> <return type="int" /> <argument index="0" name="coords" type="Vector2" /> @@ -256,11 +243,10 @@ <method name="set_dropcap"> <return type="bool" /> <argument index="0" name="text" type="String" /> - <argument index="1" name="fonts" type="Font" /> - <argument index="2" name="size" type="int" /> + <argument index="1" name="font" type="Font" /> + <argument index="2" name="font_size" type="int" /> <argument index="3" name="dropcap_margins" type="Rect2" default="Rect2(0, 0, 0, 0)" /> - <argument index="4" name="opentype_features" type="Dictionary" default="{}" /> - <argument index="5" name="language" type="String" default="""" /> + <argument index="4" name="language" type="String" default="""" /> <description> Sets drop cap, overrides previously set drop cap. Drop cap (dropped capital) is a decorative element at the beginning of a paragraph that is larger than the rest of the text. </description> diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml index ca1aec19ea..4c8cf3982e 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -355,15 +355,6 @@ Returns list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size. </description> </method> - <method name="font_get_spacing" qualifiers="const"> - <return type="int" /> - <argument index="0" name="font_rid" type="RID" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="spacing" type="int" enum="TextServer.SpacingType" /> - <description> - Returns extra spacing added between glyphs in pixels. - </description> - </method> <method name="font_get_style" qualifiers="const"> <return type="int" /> <argument index="0" name="font_rid" type="RID" /> @@ -542,7 +533,7 @@ <argument index="1" name="size" type="Vector2i" /> <argument index="2" name="texture_index" type="int" /> <description> - Removes specified texture from font cache entry. + Removes specified texture from the cache entry. [b]Note:[/b] This function will not remove glyphs associated with the texture, remove them manually, using [method font_remove_glyph]. </description> </method> @@ -792,16 +783,6 @@ Adds override for [method font_is_script_supported]. </description> </method> - <method name="font_set_spacing"> - <return type="void" /> - <argument index="0" name="font_rid" type="RID" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="spacing" type="int" enum="TextServer.SpacingType" /> - <argument index="3" name="value" type="int" /> - <description> - Sets extra spacing added between glyphs in pixels. - </description> - </method> <method name="font_set_style"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> @@ -1286,6 +1267,14 @@ Returns size of the text. </description> </method> + <method name="shaped_text_get_spacing" qualifiers="const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="spacing" type="int" enum="TextServer.SpacingType" /> + <description> + Returns extra spacing added between glyphs or lines in pixels. + </description> + </method> <method name="shaped_text_get_trim_pos" qualifiers="const"> <return type="int" /> <argument index="0" name="shaped" type="RID" /> @@ -1431,6 +1420,15 @@ If set to [code]true[/code] text buffer will display invalid characters as hexadecimal codes, otherwise nothing is displayed. </description> </method> + <method name="shaped_text_set_spacing"> + <return type="void" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="spacing" type="int" enum="TextServer.SpacingType" /> + <argument index="2" name="value" type="int" /> + <description> + Sets extra spacing added between glyphs or lines in pixels. + </description> + </method> <method name="shaped_text_shape"> <return type="bool" /> <argument index="0" name="shaped" type="RID" /> diff --git a/doc/classes/TextServerExtension.xml b/doc/classes/TextServerExtension.xml index b3be858ca1..2f7b31b663 100644 --- a/doc/classes/TextServerExtension.xml +++ b/doc/classes/TextServerExtension.xml @@ -345,15 +345,6 @@ Returns list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size. </description> </method> - <method name="font_get_spacing" qualifiers="virtual const"> - <return type="int" /> - <argument index="0" name="font_rid" type="RID" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="spacing" type="int" enum="TextServer.SpacingType" /> - <description> - Returns extra spacing added between glyphs in pixels. - </description> - </method> <method name="font_get_style" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="font_rid" type="RID" /> @@ -531,7 +522,7 @@ <argument index="1" name="size" type="Vector2i" /> <argument index="2" name="texture_index" type="int" /> <description> - Removes specified texture from font cache entry. + Removes specified texture from the cache entry. </description> </method> <method name="font_render_glyph" qualifiers="virtual"> @@ -788,16 +779,6 @@ Adds override for [method font_is_script_supported]. </description> </method> - <method name="font_set_spacing" qualifiers="virtual"> - <return type="void" /> - <argument index="0" name="font_rid" type="RID" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="spacing" type="int" enum="TextServer.SpacingType" /> - <argument index="3" name="value" type="int" /> - <description> - Sets extra spacing added between glyphs in pixels. - </description> - </method> <method name="font_set_style" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> @@ -1288,6 +1269,14 @@ Returns size of the text. </description> </method> + <method name="shaped_text_get_spacing" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="spacing" type="int" enum="TextServer.SpacingType" /> + <description> + Returns extra spacing added between glyphs or lines in pixels. + </description> + </method> <method name="shaped_text_get_trim_pos" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="shaped" type="RID" /> @@ -1436,6 +1425,15 @@ If set to [code]true[/code] text buffer will display invalid characters as hexadecimal codes, otherwise nothing is displayed. </description> </method> + <method name="shaped_text_set_spacing" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="spacing" type="int" enum="TextServer.SpacingType" /> + <argument index="2" name="value" type="int" /> + <description> + Sets extra spacing added between glyphs or lines in pixels. + </description> + </method> <method name="shaped_text_shape" qualifiers="virtual"> <return type="bool" /> <argument index="0" name="shaped" type="RID" /> diff --git a/doc/classes/Theme.xml b/doc/classes/Theme.xml index 5270da9588..7f4e0645c8 100644 --- a/doc/classes/Theme.xml +++ b/doc/classes/Theme.xml @@ -334,8 +334,8 @@ <argument index="0" name="name" type="StringName" /> <argument index="1" name="theme_type" type="StringName" /> <description> - Returns [code]true[/code] if the font size property defined by [code]name[/code] and [code]theme_type[/code] exists, or if the default theme font size is set up (see [method has_default_font_size]). - Returns [code]false[/code] if neither exist. Use [method set_font_size] to define the property. + Returns [code]true[/code] if [member default_font_size] has a valid value. + Returns [code]false[/code] if it doesn't. The value must be greater than [code]0[/code] to be considered valid. </description> </method> <method name="has_icon" qualifiers="const"> @@ -426,8 +426,8 @@ <argument index="1" name="name" type="StringName" /> <argument index="2" name="theme_type" type="StringName" /> <description> - Renames the font size property defined by [code]old_name[/code] and [code]theme_type[/code] to [code]name[/code], if it exists. - Fails if it doesn't exist, or if a similar property with the new name already exists. Use [method has_font_size] to check for existence, and [method clear_font_size] to remove the existing property. + Returns [code]true[/code] if the font size property defined by [code]name[/code] and [code]theme_type[/code] exists, or if the default theme font size is set up (see [method has_default_font_size]). + Returns [code]false[/code] if neither exist. Use [method set_font_size] to define the property. </description> </method> <method name="rename_icon"> @@ -495,7 +495,8 @@ <argument index="1" name="theme_type" type="StringName" /> <argument index="2" name="font_size" type="int" /> <description> - Creates or changes the value of the font size property defined by [code]name[/code] and [code]theme_type[/code]. Use [method clear_font_size] to remove the property. + Renames the font size property defined by [code]old_name[/code] and [code]theme_type[/code] to [code]name[/code], if it exists. + Fails if it doesn't exist, or if a similar property with the new name already exists. Use [method has_font_size] to check for existence, and [method clear_font_size] to remove the existing property. </description> </method> <method name="set_icon"> diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index 8a30364ebe..b06be0cf99 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -42,13 +42,6 @@ Clears the tree. This removes all items. </description> </method> - <method name="clear_column_title_opentype_features"> - <return type="void" /> - <argument index="0" name="column" type="int" /> - <description> - Removes all OpenType features from the item's text. - </description> - </method> <method name="create_item"> <return type="TreeItem" /> <argument index="0" name="parent" type="TreeItem" default="null" /> @@ -114,14 +107,6 @@ Returns column title language code. </description> </method> - <method name="get_column_title_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="column" type="int" /> - <argument index="1" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code] of the column title. - </description> - </method> <method name="get_column_width" qualifiers="const"> <return type="int" /> <argument index="0" name="column" type="int" /> @@ -308,15 +293,6 @@ Sets language code of column title used for line-breaking and text shaping algorithms, if left empty current locale is used instead. </description> </method> - <method name="set_column_title_opentype_feature"> - <return type="void" /> - <argument index="0" name="column" type="int" /> - <argument index="1" name="tag" type="String" /> - <argument index="2" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code] for the column title. - </description> - </method> </methods> <members> <member name="allow_reselect" type="bool" setter="set_allow_reselect" getter="get_allow_reselect" default="false"> diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml index 0a680b9627..fbba1147a2 100644 --- a/doc/classes/TreeItem.xml +++ b/doc/classes/TreeItem.xml @@ -42,13 +42,6 @@ Resets the color for the given column to default. </description> </method> - <method name="clear_opentype_features"> - <return type="void" /> - <argument index="0" name="column" type="int" /> - <description> - Removes all OpenType features. - </description> - </method> <method name="create_child"> <return type="TreeItem" /> <argument index="0" name="idx" type="int" default="-1" /> @@ -230,25 +223,17 @@ <method name="get_next" qualifiers="const"> <return type="TreeItem" /> <description> - Returns the next TreeItem in the tree or a null object if there is none. + Returns the next sibling TreeItem in the tree or a null object if there is none. </description> </method> <method name="get_next_visible"> <return type="TreeItem" /> <argument index="0" name="wrap" type="bool" default="false" /> <description> - Returns the next visible TreeItem in the tree or a null object if there is none. + Returns the next visible sibling TreeItem in the tree or a null object if there is none. If [code]wrap[/code] is enabled, the method will wrap around to the first visible element in the tree when called on the last visible element, otherwise it returns [code]null[/code]. </description> </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="column" type="int" /> - <argument index="1" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code] of the item's text. - </description> - </method> <method name="get_parent" qualifiers="const"> <return type="TreeItem" /> <description> @@ -258,14 +243,14 @@ <method name="get_prev"> <return type="TreeItem" /> <description> - Returns the previous TreeItem in the tree or a null object if there is none. + Returns the previous sibling TreeItem in the tree or a null object if there is none. </description> </method> <method name="get_prev_visible"> <return type="TreeItem" /> <argument index="0" name="wrap" type="bool" default="false" /> <description> - Returns the previous visible TreeItem in the tree or a null object if there is none. + Returns the previous visible sibling TreeItem in the tree or a null object if there is none. If [code]wrap[/code] is enabled, the method will wrap around to the last visible element in the tree when called on the first visible element, otherwise it returns [code]null[/code]. </description> </method> @@ -580,15 +565,6 @@ Sets the metadata value for the given column, which can be retrieved later using [method get_metadata]. This can be used, for example, to store a reference to the original data. </description> </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="column" type="int" /> - <argument index="1" name="tag" type="String" /> - <argument index="2" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code] for the item's text. - </description> - </method> <method name="set_range"> <return type="void" /> <argument index="0" name="column" type="int" /> diff --git a/doc/classes/VideoStreamPlayer.xml b/doc/classes/VideoStreamPlayer.xml index 092a754a39..f6594ff9e7 100644 --- a/doc/classes/VideoStreamPlayer.xml +++ b/doc/classes/VideoStreamPlayer.xml @@ -58,7 +58,7 @@ <member name="bus" type="StringName" setter="set_bus" getter="get_bus" default="&"Master""> Audio bus to use for sound playback. </member> - <member name="expand" type="bool" setter="set_expand" getter="has_expand" default="true"> + <member name="expand" type="bool" setter="set_expand" getter="has_expand" default="false"> If [code]true[/code], the video scales to the control size. Otherwise, the control minimum size will be automatically adjusted to match the video stream's dimensions. </member> <member name="paused" type="bool" setter="set_paused" getter="is_paused" default="false"> diff --git a/doc/classes/VoxelGI.xml b/doc/classes/VoxelGI.xml index 55ba1c4934..d941185d33 100644 --- a/doc/classes/VoxelGI.xml +++ b/doc/classes/VoxelGI.xml @@ -37,6 +37,7 @@ </member> <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3(10, 10, 10)"> The size of the area covered by the [VoxelGI]. If you make the extents larger without increasing the subdivisions with [member subdiv], the size of each cell will increase and result in lower detailed lighting. + [b]Note:[/b] Extents are clamped to 1.0 unit or more on each axis. </member> <member name="subdiv" type="int" setter="set_subdiv" getter="get_subdiv" enum="VoxelGI.Subdiv" default="1"> Number of times to subdivide the grid that the [VoxelGI] operates on. A higher number results in finer detail and thus higher visual quality, while lower numbers result in better performance. diff --git a/doc/classes/XMLParser.xml b/doc/classes/XMLParser.xml index c40a07c40a..79ab33045f 100644 --- a/doc/classes/XMLParser.xml +++ b/doc/classes/XMLParser.xml @@ -32,7 +32,7 @@ <method name="get_current_line" qualifiers="const"> <return type="int" /> <description> - Gets the current line in the parsed file (currently not implemented). + Gets the current line in the parsed file, counting from 0. </description> </method> <method name="get_named_attribute_value" qualifiers="const"> |