summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/Button.xml23
-rw-r--r--doc/classes/CanvasItem.xml76
-rw-r--r--doc/classes/Font.xml287
-rw-r--r--doc/classes/FontFile.xml (renamed from doc/classes/FontData.xml)252
-rw-r--r--doc/classes/FontVariation.xml76
-rw-r--r--doc/classes/GraphNode.xml21
-rw-r--r--doc/classes/ItemList.xml24
-rw-r--r--doc/classes/Label.xml23
-rw-r--r--doc/classes/Label3D.xml25
-rw-r--r--doc/classes/LineEdit.xml21
-rw-r--r--doc/classes/LinkButton.xml23
-rw-r--r--doc/classes/PopupMenu.xml24
-rw-r--r--doc/classes/ProjectSettings.xml6
-rw-r--r--doc/classes/RichTextLabel.xml8
-rw-r--r--doc/classes/TabBar.xml24
-rw-r--r--doc/classes/TextEdit.xml21
-rw-r--r--doc/classes/TextLine.xml9
-rw-r--r--doc/classes/TextMesh.xml25
-rw-r--r--doc/classes/TextParagraph.xml28
-rw-r--r--doc/classes/TextServer.xml38
-rw-r--r--doc/classes/TextServerExtension.xml38
-rw-r--r--doc/classes/Theme.xml11
-rw-r--r--doc/classes/Tree.xml24
-rw-r--r--doc/classes/TreeItem.xml24
24 files changed, 456 insertions, 675 deletions
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="&quot;&quot;" />
- <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/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&lt;FontData&gt;("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&lt;FontData&gt;("res://NotoNaskhArabicUI_Regular.ttf");
- fontDataFA.SetLanguageSupportOverride("fa", true);
- fontDataFA.SetLanguageSupportOverride("ur", false);
-
- var fontDataUR = ResourceLoader.Load&lt;FontData&gt;("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&lt;FontData&gt;("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&lt;FontFile&gt;("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&lt;FontFile&gt;("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/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/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="&quot;&quot;">
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/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/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 62a1be030d..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" />
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="&quot;&quot;" />
- <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="&quot;&quot;" />
+ <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="&quot;&quot;" />
- <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="&quot;&quot;" />
+ <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="&quot;&quot;" />
+ <argument index="4" name="language" type="String" default="&quot;&quot;" />
<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..804b8dddd9 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" />
@@ -241,14 +234,6 @@
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>
@@ -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" />