From 7e2c0ffd1a19d5806a7fcf57e25d2465f7a8f8b6 Mon Sep 17 00:00:00 2001
From: bruvzg <7645683+bruvzg@users.noreply.github.com>
Date: Wed, 12 Aug 2020 14:49:10 +0300
Subject: [Complex Text Layouts] Add TextServer documentation. Update Font,
CanvasItem, Theme and modified controls documentation.
---
doc/classes/@GlobalScope.xml | 6 +
doc/classes/Button.xml | 42 ++
doc/classes/CanvasItem.xml | 69 ++-
doc/classes/CheckBox.xml | 3 +
doc/classes/CheckButton.xml | 23 +-
doc/classes/CodeEdit.xml | 6 +
doc/classes/ColorPickerButton.xml | 3 +
doc/classes/Control.xml | 133 ++++-
doc/classes/DynamicFont.xml | 146 -----
doc/classes/Font.xml | 346 +++++++++++
doc/classes/FontData.xml | 302 ++++++++++
doc/classes/GraphNode.xml | 33 ++
doc/classes/ItemList.xml | 76 +++
doc/classes/Label.xml | 57 +-
doc/classes/LineEdit.xml | 117 +++-
doc/classes/LinkButton.xml | 42 ++
doc/classes/MainLoop.xml | 3 +
doc/classes/MenuButton.xml | 3 +
doc/classes/Node.xml | 3 +
doc/classes/OptionButton.xml | 23 +-
doc/classes/PopupMenu.xml | 81 ++-
doc/classes/ProgressBar.xml | 3 +
doc/classes/ProjectSettings.xml | 6 +
doc/classes/RichTextLabel.xml | 3 +
doc/classes/TabContainer.xml | 3 +
doc/classes/Tabs.xml | 76 +++
doc/classes/TextEdit.xml | 115 +++-
doc/classes/TextLine.xml | 212 +++++++
doc/classes/TextParagraph.xml | 299 ++++++++++
doc/classes/TextServer.xml | 1167 +++++++++++++++++++++++++++++++++++++
doc/classes/TextServerManager.xml | 82 +++
doc/classes/Theme.xml | 60 ++
doc/classes/Tree.xml | 81 ++-
doc/classes/TreeItem.xml | 109 ++++
doc/classes/Window.xml | 61 ++
35 files changed, 3610 insertions(+), 184 deletions(-)
delete mode 100644 doc/classes/DynamicFont.xml
create mode 100644 doc/classes/Font.xml
create mode 100644 doc/classes/FontData.xml
create mode 100644 doc/classes/TextLine.xml
create mode 100644 doc/classes/TextParagraph.xml
create mode 100644 doc/classes/TextServer.xml
create mode 100644 doc/classes/TextServerManager.xml
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index f6b8e0da19..0216d2ba35 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -1236,6 +1236,9 @@
The [ResourceSaver] singleton.
+
+ The [TextServerManager] singleton.
+
The [TranslationServer] singleton.
@@ -1286,6 +1289,9 @@
Horizontal right alignment, usually for text-derived classes.
+
+ Expand row to fit width, usually for text-derived classes.
+
Vertical top alignment, usually for text-derived classes.
diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml
index df47fa8bec..e47198a381 100644
--- a/doc/classes/Button.xml
+++ b/doc/classes/Button.xml
@@ -40,6 +40,33 @@
https://godotengine.org/asset-library/asset/677
+
+
+
+
+ Removes all OpenType features.
+
+
+
+
+
+
+
+
+ Returns OpenType feature [code]tag[/code].
+
+
+
+
+
+
+
+
+
+
+ Sets OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
+
+
@@ -57,9 +84,15 @@
Button's icon, if text is present the icon will be placed before the text.
+
+ Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
+
The button's text that will be displayed inside the button's area.
+
+ Base text writing direction.
+
@@ -94,6 +127,12 @@
Text [Color] used when the [Button] is being pressed.
+
+ Text oubline [Color] of the [Button].
+
+
+ Font size of the [Button]'s text.
+
[StyleBox] used when the [Button] is being hovered.
@@ -103,6 +142,9 @@
Default [StyleBox] for the [Button].
+
+ Size of the [Button]'s text outline.
+
[StyleBox] used when the [Button] is being pressed.
diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml
index 8efa1adae8..d715cf5e49 100644
--- a/doc/classes/CanvasItem.xml
+++ b/doc/classes/CanvasItem.xml
@@ -45,18 +45,24 @@
Draws an arc between the given angles. The larger the value of [code]point_count[/code], the smoother the curve.
-
+
-
+
-
+
+
+
+
+
+
+
-
+
Draws a string character using a custom font. Returns the advance, depending on the character width and kerning with an optional next character.
@@ -146,6 +152,35 @@
Draws multiple, parallel lines with a uniform [code]width[/code] and segment-by-segment coloring. Colors assigned to line segments match by index between [code]points[/code] and [code]colors[/code].
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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.
+
+
@@ -253,18 +288,28 @@
Sets a custom transform for drawing via matrix. Anything drawn afterwards will be transformed by this.
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
-
+
Draws [code]text[/code] 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.
@@ -275,17 +320,19 @@
# `default_font` declaration to a member variable assigned in `_ready()`
# so the Control is only created once.
var default_font = Control.new().get_font("font")
- draw_string(default_font, Vector2(64, 64), "Hello world")
+ var default_font_size = Control.new().get_font_size("font_size")
+ draw_string(default_font, Vector2(64, 64), "Hello world", HALIGN_LEFT, -1, font_size)
[/gdscript]
[csharp]
// If using this method in a script that redraws constantly, move the
// `default_font` declaration to a member variable assigned in `_ready()`
// so the Control is only created once.
Font defaultFont = new Control().GetFont("font");
- DrawString(defaultFont, new Vector2(64, 64), "Hello world");
+ int defaultFontSize = new Control().GetFontSize("font_size");
+ DrawString(defaultFont, new Vector2(64, 64), "Hello world", HALIGN_LEFT, -1, defaultFontSize);
[/csharp]
[/codeblocks]
- See also [method Font.draw].
+ See also [method Font.draw_string].
diff --git a/doc/classes/CheckBox.xml b/doc/classes/CheckBox.xml
index f912bb98c9..89fb960e88 100644
--- a/doc/classes/CheckBox.xml
+++ b/doc/classes/CheckBox.xml
@@ -48,6 +48,9 @@
The [CheckBox] text's font color when it's pressed.
+
+ Font size of the [CheckBox]'s text.
+
The [StyleBox] to display as a background when the [CheckBox] is hovered.
diff --git a/doc/classes/CheckButton.xml b/doc/classes/CheckButton.xml
index b4f91cf3a8..882f1c69f3 100644
--- a/doc/classes/CheckButton.xml
+++ b/doc/classes/CheckButton.xml
@@ -45,6 +45,9 @@
The [CheckButton] text's font color when it's pressed.
+
+ Font size of the [CheckButton]'s text.
+
The [StyleBox] to display as a background when the [CheckButton] is hovered.
@@ -58,16 +61,28 @@
The [StyleBox] to display as a background.
- The icon to display when the [CheckButton] is unchecked.
+ The icon to display when the [CheckButton] is unchecked (for left-to-right layouts).
- The icon to display when the [CheckButton] is unchecked and disabled.
+ The icon to display when the [CheckButton] is unchecked and disabled (for left-to-right layouts).
+
+
+ The icon to display when the [CheckButton] is unchecked and disabled (for right-to-left layouts).
+
+
+ The icon to display when the [CheckButton] is unchecked (for right-to-left layouts).
- The icon to display when the [CheckButton] is checked.
+ The icon to display when the [CheckButton] is checked (for left-to-right layouts).
- The icon to display when the [CheckButton] is checked and disabled.
+ The icon to display when the [CheckButton] is checked and disabled (for left-to-right layouts).
+
+
+ The icon to display when the [CheckButton] is checked and disabled (for right-to-left layouts).
+
+
+ The icon to display when the [CheckButton] is checked (for right-to-left layouts).
The [StyleBox] to display as a background when the [CheckButton] is pressed.
diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml
index 58222c3911..8834ff82c6 100644
--- a/doc/classes/CodeEdit.xml
+++ b/doc/classes/CodeEdit.xml
@@ -110,6 +110,9 @@
+
+
+
@@ -180,6 +183,9 @@
+
+ Font size of the [CodeEdit]'s text.
+
diff --git a/doc/classes/ColorPickerButton.xml b/doc/classes/ColorPickerButton.xml
index 76cc49a043..c04e8b9ea0 100644
--- a/doc/classes/ColorPickerButton.xml
+++ b/doc/classes/ColorPickerButton.xml
@@ -82,6 +82,9 @@
Text [Color] used when the [ColorPickerButton] is being pressed.
+
+ Font size of the [ColorPickerButton]'s text.
+
[StyleBox] used when the [ColorPickerButton] is being hovered.
diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml
index eb0b941da5..ae1a8d86a7 100644
--- a/doc/classes/Control.xml
+++ b/doc/classes/Control.xml
@@ -121,6 +121,18 @@
[/codeblocks]
+
+
+
+
+
+
+
+
+ User defined BiDi algorithm override function.
+ Return [code]Array[/code] of [code]Vector2i[/code] text ranges, in the left-to-right order. Ranges should cover full source [code]text[/code] without overlaps. BiDi algorithm will be used on each range separately.
+
+
@@ -179,6 +191,17 @@
Overrides the font with given [code]name[/code] in the [member theme] resource the control uses. If [code]font[/code] is [code]null[/code] or invalid, the override is cleared and the font from assigned [Theme] is used.
+
+
+
+
+
+
+
+
+ Overrides the font size with given [code]name[/code] in the [member theme] resource the control uses. If [code]font_size[/code] is [code]-1[/code], the override is cleared and the font size from assigned [Theme] is used.
+
+
@@ -443,7 +466,7 @@
-
+
Returns a color from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
@@ -466,7 +489,7 @@
-
+
Returns a constant from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
@@ -477,18 +500,29 @@
-
+
Returns a font from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
+
+
+
+
+
+
+
+
+ Returns a font size from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code].
+
+
-
+
Returns an icon from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
@@ -499,7 +533,7 @@
-
+
Returns a [StyleBox] from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
@@ -563,7 +597,7 @@
-
+
Returns [code]true[/code] if [Color] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
@@ -583,7 +617,7 @@
-
+
Returns [code]true[/code] if constant with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
@@ -603,7 +637,7 @@
-
+
Returns [code]true[/code] if font with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
@@ -618,12 +652,32 @@
Returns [code]true[/code] if font with given [code]name[/code] has a valid override in this [Control] node.
+
+
+
+
+
+
+
+
+ Returns [code]true[/code] if font size with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme].
+
+
+
+
+
+
+
+
+ Returns [code]true[/code] if font size with given [code]name[/code] has a valid override in this [Control] node.
+
+
-
+
Returns [code]true[/code] if icon with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
@@ -652,7 +706,7 @@
-
+
Returns [code]true[/code] if [StyleBox] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
@@ -667,6 +721,13 @@
Returns [code]true[/code] if [StyleBox] with given [code]name[/code] has a valid override in this [Control] node.
+
+
+
+
+ Returns [code]true[/code] if layout is right-to-left.
+
+
@@ -1015,6 +1076,9 @@
[/csharp]
[/codeblocks]
+
+ Controls layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew).
+
Distance between the node's bottom edge and its parent control, based on [member anchor_bottom].
Margins are often controlled by one or multiple parent [Container] nodes, so you should not modify them manually if your node is a direct child of a [Container]. Margins update automatically when you move or resize the node.
@@ -1159,6 +1223,9 @@
Sent when this node is inside a [ScrollContainer] which has stopped being scrolled.
+
+ Sent when control layout direction is changed.
+
Show the system's arrow mouse cursor when the user hovers the node. Use with [member mouse_default_cursor_shape].
@@ -1309,5 +1376,51 @@
Snaps one of the 4 anchor's sides to the end of the node's [code]Rect[/code], in the bottom right. Use it with one of the [code]anchor_*[/code] member variables, like [member anchor_left]. To change all 4 anchors at once, use [method set_anchors_preset].
+
+ Automatic layout direction, determined from the parent control layout direction.
+
+
+ Automatic layout direction, determined from the current locale.
+
+
+ Left-to-right layout direction.
+
+
+ Right-to-left layout direction.
+
+
+ Text writing direction is the same as layout direction.
+
+
+ Automatic text writing direction, determined from the current locale and text content.
+
+
+ Left-to-right text writing direction.
+
+
+ Right-to-left text writing direction.
+
+
+ Use default behavior. Same as [code]STRUCTURED_TEXT_NONE[/code] unless specified otherwise in the control description.
+
+
+ BiDi override for URI.
+
+
+ BiDi override for file path.
+
+
+ BiDi override for email.
+
+
+ BiDi override for lists.
+ Structured text options: list separator [code]String[/code].
+
+
+ Use default Unicode BiDi algorithm.
+
+
+ User defined structured text BiDi override function.
+
diff --git a/doc/classes/DynamicFont.xml b/doc/classes/DynamicFont.xml
deleted file mode 100644
index d2d0c54761..0000000000
--- a/doc/classes/DynamicFont.xml
+++ /dev/null
@@ -1,146 +0,0 @@
-
-
-
- DynamicFont renders vector font files at runtime.
-
-
- DynamicFont renders vector font files (such as TTF or OTF) dynamically at runtime instead of using a prerendered texture atlas like [BitmapFont]. This trades the faster loading time of [BitmapFont]s for the ability to change font parameters like size and spacing during runtime. [DynamicFontData] is used for referencing the font file paths. DynamicFont also supports defining one or more fallback fonts, which will be used when displaying a character not supported by the main font.
- DynamicFont uses the [url=https://www.freetype.org/]FreeType[/url] library for rasterization.
- [codeblocks]
- [gdscript]
- var dynamic_font = DynamicFont.new()
- dynamic_font.font_data = load("res://BarlowCondensed-Bold.ttf")
- dynamic_font.size = 64
- $"Label".set("custom_fonts/font", dynamic_font)
- [/gdscript]
- [csharp]
- var dynamicFont = new DynamicFont();
- dynamicFont.FontData = ResourceLoader.Load<DynamicFontData>("res://BarlowCondensed-Bold.ttf");
- dynamicFont.Size = 64;
- GetNode("Label").Set("custom_fonts/font", dynamicFont);
- [/csharp]
- [/codeblocks]
- [b]Note:[/b] DynamicFont doesn't support features such as kerning, right-to-left typesetting, ligatures, text shaping, variable fonts and optional font features yet. If you wish to "bake" an optional font feature into a TTF font file, you can use [url=https://fontforge.org/]FontForge[/url] to do so. In FontForge, use [b]File > Generate Fonts[/b], click [b]Options[/b], choose the desired features then generate the font.
-
-
- https://godotengine.org/asset-library/asset/676
-
-
-
-
-
-
-
-
- Adds a fallback font.
-
-
-
-
-
-
- Returns a string containing all the characters available in the main and all the fallback fonts.
- If a given character is included in more than one font, it appears only once in the returned string.
-
-
-
-
-
-
-
-
- Returns the fallback font at index [code]idx[/code].
-
-
-
-
-
-
- Returns the number of fallback fonts.
-
-
-
-
-
-
-
-
- Returns the spacing for the given [code]type[/code] (see [enum SpacingType]).
-
-
-
-
-
-
-
-
- Removes the fallback font at index [code]idx[/code].
-
-
-
-
-
-
-
-
-
-
- Sets the fallback font at index [code]idx[/code].
-
-
-
-
-
-
-
-
-
-
- Sets the spacing for [code]type[/code] (see [enum SpacingType]) to [code]value[/code] in pixels (not relative to the font size).
-
-
-
-
-
- Extra spacing at the bottom in pixels.
-
-
- Extra spacing for each character in pixels.
- This can be a negative number to make the distance between characters smaller.
-
-
- Extra spacing for the space character (in addition to [member extra_spacing_char]) in pixels.
- This can be a negative number to make the distance between words smaller.
-
-
- Extra spacing at the top in pixels.
-
-
- The font data.
-
-
- The font outline's color.
- [b]Note:[/b] It's recommended to leave this at the default value so that you can adjust it in individual controls. For example, if the outline is made black here, it won't be possible to change its color using a Label's font outline modulate theme item.
-
-
- The font outline's thickness in pixels (not relative to the font size).
-
-
- The font size in pixels.
-
-
-
-
- Spacing at the top.
-
-
- Spacing at the bottom.
-
-
- Spacing for each character.
-
-
- Spacing for the space character.
-
-
-
diff --git a/doc/classes/Font.xml b/doc/classes/Font.xml
new file mode 100644
index 0000000000..edd2bd137f
--- /dev/null
+++ b/doc/classes/Font.xml
@@ -0,0 +1,346 @@
+
+
+
+ Font class is set of font data sources used to draw text.
+
+
+ Font contains a set of glyphs to represent Unicode characters, as well as the ability to draw it with variable width, ascent, descent and kerning.
+ [b]Note:[/b] A character is a symbol that represents an item (letter, digit etc.) in an abstract way.
+ [b]Note:[/b] A glyph is a bitmap or shape used to draw a one or more characters in a context-dependent manner. Glyph indices are bound to the specific font data source.
+ [b]Note:[/b] If a non of the font data sources contain glyphs for a character used in a string, the character in question will be replaced with a box displaying its hexadecimal code.
+ [codeblocks]
+ [gdscript]
+ var font = Font.new()
+ font.add_data(load("res://BarlowCondensed-Bold.ttf"))
+ $"Label".set("custom_fonts/font", font)
+ $"Label".set("custom_fonts/font_size", 64)
+ [/gdscript]
+ [csharp]
+ var font = new Font();
+ font.AddData(ResourceLoader.Load<FontData>("res://BarlowCondensed-Bold.ttf"));
+ GetNode("Label").Set("custom_fonts/font", font);
+ GetNode("Label").Set("custom_font_sizes/font_size", 64);
+ [/csharp]
+ [/codeblocks]
+ To control font substitution priority use [FontData] language and script support.
+ Use language overrides to use same [Font] stack for multiple languages:
+ [codeblocks]
+ [gdscript]
+ # Use Naskh font for Persian and Nastaʼlīq font for Urdu text.
+ var font_data_fa = load("res://NotoNaskhArabicUI_Regular.ttf");
+ font_data_fa.set_language_support_override("fa", true);
+ font_data_fa.set_language_support_override("ur", false);
+
+ var font_data_ur = load("res://NotoNastaliqUrdu_Regular.ttf");
+ font_data_ur.set_language_support_override("fa", false);
+ font_data_ur.set_language_support_override("ur", true);
+ [/gdscript]
+ [csharp]
+ // Use Naskh font for Persian and Nastaʼlīq font for Urdu text.
+ var fontDataFA = ResourceLoader.Load<FontData>("res://NotoNaskhArabicUI_Regular.ttf");
+ fontDataFA.SetLanguageSupportOverride("fa", true);
+ fontDataFA.SetLanguageSupportOverride("ur", false);
+
+ var fontDataUR = ResourceLoader.Load<FontData>("res://NotoNastaliqUrdu_Regular.ttf");
+ fontDataUR.SetLanguageSupportOverride("fa", false);
+ fontDataUR.SetLanguageSupportOverride("ur", true);
+ [/csharp]
+ [/codeblocks]
+ Use script overrides to specify supported scripts for bitmap font or for less common scripts not directly supported by TrueType format:
+ [codeblocks]
+ [gdscript]
+ # Use specified font for Egyptian hieroglyphs.
+ var font_data = load("res://unifont.ttf");
+ font_data.set_script_support_override("Egyp", true);
+ [/gdscript]
+ [csharp]
+ // Use specified font for Egyptian hieroglyphs.
+ var fontData = ResourceLoader.Load<FontData>("res://unifont.ttf");
+ fontData.SetScriptSupportOverride("Egyp", true);
+ [/csharp]
+ [/codeblocks]
+
+
+
+
+
+
+
+
+
+
+ Add font data source to 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, 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.
+ [b]Note:[/b] Do not use this function to draw strings character by character, use [method draw_string] or [TextLine] instead.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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].
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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].
+
+
+
+
+
+
+
+
+ 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).
+
+
+
+
+
+
+
+
+
+
+
+
+ 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.
+
+
+
+
+
+
+
+
+ Returns the font data source at index [code]idx[/code]. If the index does not exist, returns [code]null[/code].
+
+
+
+
+
+
+ Returns the number of font data sources.
+
+
+
+
+
+
+
+
+ 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 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).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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].
+
+
+
+
+
+
+
+
+ Returns the spacing for the given [code]type[/code] (see [enum SpacingType]).
+
+
+
+
+
+
+
+
+
+
+ Returns the size size of a bounding box of a string, taking kerning and advance into account.
+ See also [method draw_string].
+
+
+
+
+
+
+ Returns a string containing all the characters available in the font.
+ If a given character is included in more than one font data source, it appears only once in the returned string.
+
+
+
+
+
+
+
+
+ Return 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.
+
+
+
+
+
+
+
+
+ Return 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.
+
+
+
+
+
+
+
+
+ Return [code]true[/code] if a Unicode [code]char[/code] is available in the font.
+
+
+
+
+
+
+
+
+ Removes the font data source at index [code]idx[/code]. If the index does not exist, nothing happens.
+
+
+
+
+
+
+
+
+
+
+ Sets the font data source at index [code]idx[/code]. If the index does not exist, nothing happens.
+
+
+
+
+
+
+
+
+
+
+ Sets the spacing for [code]type[/code] (see [enum SpacingType]) to [code]value[/code] in pixels (not relative to the font size).
+
+
+
+
+
+
+ After editing a font (changing data sources, etc.). Call this function to propagate changes to controls that might use it.
+
+
+
+
+
+ Extra spacing at the bottom in pixels.
+
+
+ Extra character spacing in pixels.
+
+
+
+
+ Spacing at the top of the line.
+
+
+ Spacing at the bottom of the line.
+
+
+
diff --git a/doc/classes/FontData.xml b/doc/classes/FontData.xml
new file mode 100644
index 0000000000..cee424394a
--- /dev/null
+++ b/doc/classes/FontData.xml
@@ -0,0 +1,302 @@
+
+
+
+ Font data source, file or memory buffer.
+
+
+ Built-in text servers support font data sources of the following formats:
+ - Bitmap fonts in the [url=https://www.angelcode.com/products/bmfont/]BMFont[/url] format. Handles [code].fnt, *.font[/code] fonts containing texture atlases. Non-scalable. Supports distance fields. Complex text shaping support is limited.
+ - Dynamic fonts using the [url=https://www.freetype.org/]FreeType[/url] and [url=https://github.com/silnrsi/graphite/]Graphite[/url] library for rasterization. Handles [code]*.ttf, *.otf[/code] fonts. Scalable. Doesn't support distance fields. Supports complex text shaping and OpenType features.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Draws single glyph into a canvas item at the position, using [code]font[/code] at the size [code]size[/code].
+ Returns advance of the glyph for horizontal and vertical layouts.
+ Note: Glyph index is bound to the font data, use only glyphs indices returned by [method TextServer.shaped_text_get_glyphs] or [method get_glyph_index] for this font data.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Draws single glyph outline of size [code]outline_size[/code] into a canvas item at the position, using [code]font[/code] at the size [code]size[/code]. If outline drawing is not supported, nothing is drawn.
+ Returns advance of the glyph for horizontal and vertical layouts (regardless of outline drawing support).
+ Note: Glyph index is bound to the font data, use only glyphs indices returned by [method TextServer.shaped_text_get_glyphs] or [method get_glyph_index] for this font data.
+
+
+
+
+
+
+
+
+ Returns the font ascent (number of pixels above the baseline).
+
+
+
+
+
+
+ Returns the base size of the font (the only size supported for non-scalable fonts, meaningless for scalable fonts).
+
+
+
+
+
+
+
+
+ Returns the font descent (number of pixels below the baseline).
+
+
+
+
+
+
+
+
+
+
+ Returns advance of the glyph for horizontal and vertical layouts.
+ Note: Glyph index is bound to the font data, use only glyphs indices returned by [method TextServer.shaped_text_get_glyphs] or [method get_glyph_index] for this font data.
+
+
+
+
+
+
+
+
+
+
+ Return the glyph index of a [code]char[/code], optionally modified by the [code]variation_selector[/code].
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns a kerning of the pair of glyphs for horizontal and vertical layouts.
+ Note: Glyph index is bound to the font data, use only glyphs indices returned by [method TextServer.shaped_text_get_glyphs] or [method get_glyph_index] for this font data.
+
+
+
+
+
+
+
+
+ Returns the total font height (ascent plus descent) in pixels.
+
+
+
+
+
+
+
+
+ Returns [code]true[/code] if support override is enabled for the [code]language[/code].
+
+
+
+
+
+
+ Returns list of language support overrides.
+
+
+
+
+
+
+
+
+ Returns [code]true[/code] if support override is enabled for the [code]script[/code].
+
+
+
+
+
+
+ Returns list of script support overrides.
+
+
+
+
+
+
+ Returns a string containing all the characters available in the font.
+
+
+
+
+
+
+
+
+ Returns underline offset (number of pixels below the baseline).
+
+
+
+
+
+
+
+
+ Returns underline thickness in pixels.
+
+
+
+
+
+
+
+
+ Return [code]true[/code] if a Unicode [code]char[/code] is available in the font.
+
+
+
+
+
+
+ Returns [code]true[/code], if font supports drawing glyph outlines.
+
+
+
+
+
+
+
+
+ Returns [code]true[/code], if font supports given language ([url=https://en.wikipedia.org/wiki/ISO_639-1]ISO 639[/url] code).
+
+
+
+
+
+
+
+
+ Returns [code]true[/code], if font supports given script ([url=https://en.wikipedia.org/wiki/ISO_15924]ISO 15924[/url] code).
+
+
+
+
+
+
+
+
+
+
+
+
+ Creates new font from the data in memory.
+ Note: For non-scalable fonts [code]base_size[/code] is ignored, use [method get_base_size] to check actual font size.
+
+
+
+
+
+
+
+
+
+
+ Creates new font from the file.
+ Note: For non-scalable fonts [code]base_size[/code] is ignored, use [method get_base_size] to check actual font size.
+
+
+
+
+
+
+
+
+ Remove language support override.
+
+
+
+
+
+
+
+
+ Removes script support override.
+
+
+
+
+
+
+
+
+
+
+ Adds override for [method is_language_supported].
+
+
+
+
+
+
+
+
+
+
+ Adds override for [method is_script_supported].
+
+
+
+
+
+ If [code]true[/code], the font is rendered with anti-aliasing.
+
+
+ The path to the font data file. If font data was loaded from memory location is set to [code]"(Memory)"[/code].
+
+
+ If [code]true[/code], distance field hint is enabled.
+
+
+ If [code]true[/code], default autohinter is used for font hinting.
+
+
+ The font hinting mode used by FreeType. See [enum TextServer.Hinting] for options.
+
+
+
+
+
diff --git a/doc/classes/GraphNode.xml b/doc/classes/GraphNode.xml
index 33074536da..632d138932 100644
--- a/doc/classes/GraphNode.xml
+++ b/doc/classes/GraphNode.xml
@@ -18,6 +18,13 @@
Disables all input and output slots of the GraphNode.
+
+
+
+
+ Removes all OpenType features.
+
+
@@ -95,6 +102,15 @@
Returns the type of the output connection [code]idx[/code].
+
+
+
+
+
+
+ Returns OpenType feature [code]tag[/code].
+
+
@@ -149,6 +165,17 @@
Returns [code]true[/code] if right (output) slot [code]idx[/code] is enabled, [code]false[/code] otherwise.
+
+
+
+
+
+
+
+
+ Sets OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
+
+
@@ -184,6 +211,9 @@
If [code]true[/code], the GraphNode is a comment node.
+
+ Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
+
The offset of the GraphNode, relative to the scroll offset of the [GraphEdit].
@@ -203,6 +233,9 @@
If [code]true[/code], the close button will be visible.
[b]Note:[/b] Pressing it will only emit the [signal close_request] signal, the GraphNode needs to be removed manually.
+
+ Base text writing direction.
+
The text displayed in the GraphNode's title bar.
diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml
index fd8bfb4ece..0fd0fe7b3d 100644
--- a/doc/classes/ItemList.xml
+++ b/doc/classes/ItemList.xml
@@ -43,6 +43,15 @@
Removes all items from the list.
+
+
+
+
+
+
+ Removes all OpenType features from the item's text.
+
+
@@ -114,6 +123,15 @@
Returns the region of item's icon used. The whole icon will be used if the region has no area.
+
+
+
+
+
+
+ Returns item's text language code.
+
+
@@ -123,6 +141,17 @@
Returns the metadata value of the specified index.
+
+
+
+
+
+
+
+
+ Returns OpenType feature [code]tag[/code] of the item's text.
+
+
@@ -132,6 +161,15 @@
Returns the text associated with the specified index.
+
+
+
+
+
+
+ Returns item's text base writing direction.
+
+
@@ -336,6 +374,17 @@
Sets whether the item icon will be drawn transposed.
+
+
+
+
+
+
+
+
+ Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
+
+
@@ -347,6 +396,19 @@
Sets a value (of any type) to be stored with the item associated with the specified index.
+
+
+
+
+
+
+
+
+
+
+ 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].
+
+
@@ -369,6 +431,17 @@
Sets text of the item associated with the specified index.
+
+
+
+
+
+
+
+
+ Sets item's text base writing direction.
+
+
@@ -544,6 +617,9 @@
Text [Color] used when the item is selected.
+
+ Font size of the item's text.
+
[Color] of the guideline. The guideline is a line drawn between each row of items.
diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml
index 01719ecbfd..1edf31de4a 100644
--- a/doc/classes/Label.xml
+++ b/doc/classes/Label.xml
@@ -11,6 +11,13 @@
https://godotengine.org/asset-library/asset/515
+
+
+
+
+ Removes all OpenType features.
+
+
@@ -21,8 +28,21 @@
+
+
+
+ Returns the height of the line [code]line[/code].
+ If [code]line[/code] is set to [code]-1[/code], returns biggest line height.
+ If there're no lines returns font size in pixels.
+
+
+
+
+
+
+
- Returns the font size in pixels.
+ Returns OpenType feature [code]tag[/code].
@@ -39,6 +59,17 @@
Returns the number of lines shown. Useful if the [Label]'s height cannot currently display all lines.
+
+
+
+
+
+
+
+
+ Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
+
+
@@ -50,6 +81,9 @@
If [code]true[/code], the Label only shows the text that fits inside its bounding rectangle. It also lets you scale the node down freely.
+
+ Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
+
The node ignores the first [code]lines_skipped[/code] lines before it starts to display text.
@@ -61,9 +95,18 @@
Limits the amount of visible characters. If you set [code]percent_visible[/code] to 0.5, only up to half of the text's characters will display on screen. Useful to animate the text in a dialog box.
+
+ Set BiDi algorithm override for the structured text.
+
+
+ Set additional options for BiDi override.
+
The text to display on screen.
+
+ Base text writing direction.
+
If [code]true[/code], all the text displays as UPPERCASE.
@@ -85,7 +128,7 @@
Align rows to the right.
- Expand row whitespaces to fit the width.
+ Expand row to fit the width.
Align the whole text to the top.
@@ -113,14 +156,17 @@
The tint of [Font]'s outline.
+
+ Font size of the [Label]'s text.
+
Vertical space between lines in multiline [Label].
Background [StyleBox] for the [Label].
-
- Boolean value. If set to 1 ([code]true[/code]), the shadow will be displayed around the whole text as an outline.
+
+ Text outline size.
The horizontal offset of the text's shadow.
@@ -128,5 +174,8 @@
The vertical offset of the text's shadow.
+
+ Shadow outline size. If set to 1 or greater, the shadow will be displayed around the whole text as an outline.
+
diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml
index b7211419e4..f05121d48c 100644
--- a/doc/classes/LineEdit.xml
+++ b/doc/classes/LineEdit.xml
@@ -10,6 +10,7 @@
- [kbd]Ctrl + X[/kbd]: Cut
- [kbd]Ctrl + V[/kbd] or [kbd]Ctrl + Y[/kbd]: Paste/"yank"
- [kbd]Ctrl + Z[/kbd]: Undo
+ - [kbd]Ctrl + ~[/kbd]: Swap input direction.
- [kbd]Ctrl + Shift + Z[/kbd]: Redo
- [kbd]Ctrl + U[/kbd]: Delete text from the cursor position to the beginning of the line
- [kbd]Ctrl + K[/kbd]: Delete text from the cursor position to the end of the line
@@ -46,6 +47,13 @@
Erases the [LineEdit]'s [member text].
+
+
+
+
+ Removes all OpenType features.
+
+
@@ -78,6 +86,15 @@
Returns the [PopupMenu] of this [LineEdit]. By default, this menu is displayed when right-clicking on the [LineEdit].
+
+
+
+
+
+
+ Returns OpenType feature [code]tag[/code].
+
+
@@ -126,6 +143,17 @@
Selects the whole [String].
+
+
+
+
+
+
+
+
+ Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
+
+
@@ -139,6 +167,10 @@
+
+ Allow moving caret, selecting and removing the individual composite character components.
+ Note: [kbd]Backspace[/kbd] is always removing individual composite character components.
+
The cursor's position inside the [LineEdit]. When set, the text may scroll to accommodate it.
@@ -148,6 +180,9 @@
If [code]true[/code], the context menu will appear when right-clicked.
+
+ If [code]true[/code], control characters are displayed.
+
If [code]false[/code], existing text cannot be modified and new text cannot be added.
@@ -155,6 +190,9 @@
If [code]true[/code], the [LineEdit] width will increase to stay longer than the [member text]. It will [b]not[/b] compress if the [member text] is shortened.
+
+ Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
+
Maximum amount of characters that can be entered inside the [LineEdit]. If [code]0[/code], there is no limit.
@@ -180,10 +218,19 @@
If [code]false[/code], using shortcuts will be disabled.
+
+ Set BiDi algorithm override for the structured text.
+
+
+ Set additional options for BiDi override.
+
String value of the [LineEdit].
[b]Note:[/b] Changing text using this property won't emit the [signal text_changed] signal.
+
+ Base text writing direction.
+
If [code]true[/code], the native virtual keyboard is shown when focused on platforms that support it.
@@ -220,7 +267,7 @@
Aligns the text on the right-hand side of the [LineEdit].
- Stretches whitespaces to fit the [LineEdit]'s width.
+ Expand row to fit the [LineEdit]'s width.
Cuts (copies and clears) the selected text.
@@ -244,7 +291,70 @@
Reverse the last undo action.
-
+
+ Sets text direction to inherited.
+
+
+ Sets text direction to automatic.
+
+
+ Sets text direction to left-to-right.
+
+
+ Sets text direction to right-to-left.
+
+
+ Toggles control character display.
+
+
+ Inserts left-to-right mark (LRM) character.
+
+
+ Inserts right-to-left mark (RLM) character.
+
+
+ Inserts start of left-to-right embedding (LRE) character.
+
+
+ Inserts start of right-to-left embedding (RLE) character.
+
+
+ Inserts start of left-to-right override (LRO) character.
+
+
+ Inserts start of right-to-left override (RLO) character.
+
+
+ Inserts pop direction formatting (PDF) character.
+
+
+ Inserts Arabic letter mark (ALM) character.
+
+
+ Inserts left-to-right isolate (LRI) character.
+
+
+ Inserts right-to-left isolate (RLI) character.
+
+
+ Inserts first strong isolate (FSI) character.
+
+
+ Inserts pop direction isolate (PDI) character.
+
+
+ Inserts zero width joiner (ZWJ) character.
+
+
+ Inserts zero width non-joiner (ZWNJ) character.
+
+
+ Inserts word joiner (WJ) character.
+
+
+ Inserts soft hyphen (SHY) character.
+
+
Represents the size of the [enum MenuItems] enum.
@@ -276,6 +386,9 @@
Font color when editing is disabled.
+
+ Font size of the [LineEdit]'s text.
+
Minimum horizontal space for the text (not counting the clear button and content margins). This value is measured in count of space characters (i.e. this amount of space characters can be displayed without scrolling).
diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml
index 15307de897..4b8ab3a6cf 100644
--- a/doc/classes/LinkButton.xml
+++ b/doc/classes/LinkButton.xml
@@ -10,12 +10,51 @@
+
+
+
+
+ Removes all OpenType features.
+
+
+
+
+
+
+
+
+ Returns OpenType feature [code]tag[/code].
+
+
+
+
+
+
+
+
+
+
+ Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
+
+
+
+ Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
+
+
+ Set BiDi algorithm override for the structured text.
+
+
+ Set additional options for BiDi override.
+
The button's text that will be displayed inside the button's area.
+
+ Base text writing direction.
+
Determines when to show the underline. See [enum UnderlineMode] for options.
@@ -47,6 +86,9 @@
Text [Color] used when the [LinkButton] is being pressed.
+
+ Font size of the [LinkButton]'s text.
+
The vertical space between the baseline of text and the underline.
diff --git a/doc/classes/MainLoop.xml b/doc/classes/MainLoop.xml
index 3c3cbbfa29..7682379b64 100644
--- a/doc/classes/MainLoop.xml
+++ b/doc/classes/MainLoop.xml
@@ -126,5 +126,8 @@
Notification received from the OS when the application is defocused, i.e. when changing the focus from any open window of the Godot instance to the OS desktop or a thirdparty application.
Implemented on desktop platforms.
+
+ Notification received when text server is changed.
+
diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml
index fe38c08280..ac371d1e7b 100644
--- a/doc/classes/MenuButton.xml
+++ b/doc/classes/MenuButton.xml
@@ -67,6 +67,9 @@
Text [Color] used when the [MenuButton] is being pressed.
+
+ Font size of the [MenuButton]'s text.
+
[StyleBox] used when the [MenuButton] is being hovered.
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml
index e3fc87ffb5..62d88afa51 100644
--- a/doc/classes/Node.xml
+++ b/doc/classes/Node.xml
@@ -1013,6 +1013,9 @@
Notification received from the OS when the application is defocused, i.e. when changing the focus from any open window of the Godot instance to the OS desktop or a thirdparty application.
Implemented on desktop platforms.
+
+ Notification received when text server is changed.
+
Inherits pause mode from the node's parent. For the root node, it is equivalent to [constant PAUSE_MODE_STOP]. Default.
diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml
index 510f952fea..53309bae96 100644
--- a/doc/classes/OptionButton.xml
+++ b/doc/classes/OptionButton.xml
@@ -239,7 +239,10 @@
The horizontal space between the arrow icon and the right edge of the button.
- [StyleBox] used when the [OptionButton] is disabled.
+ [StyleBox] used when the [OptionButton] is disabled (for left-to-right layouts).
+
+
+ [StyleBox] used when the [OptionButton] is disabled (for right-to-left layouts).
[StyleBox] used when the [OptionButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect.
@@ -259,17 +262,29 @@
Text [Color] used when the [OptionButton] is being pressed.
+
+ Font size of the [OptionButton]'s text.
+
- [StyleBox] used when the [OptionButton] is being hovered.
+ [StyleBox] used when the [OptionButton] is being hovered (for left-to-right layouts).
+
+
+ [StyleBox] used when the [OptionButton] is being hovered (for right-to-left layouts).
The horizontal space between [OptionButton]'s icon and text.
- Default [StyleBox] for the [OptionButton].
+ Default [StyleBox] for the [OptionButton] (for left-to-right layouts).
+
+
+ Default [StyleBox] for the [OptionButton] (for right-to-left layouts).
- [StyleBox] used when the [OptionButton] is being pressed.
+ [StyleBox] used when the [OptionButton] is being pressed (for left-to-right layouts).
+
+
+ [StyleBox] used when the [OptionButton] is being pressed (for right-to-left layouts).
diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml
index b1ec9a222a..c663f26d84 100644
--- a/doc/classes/PopupMenu.xml
+++ b/doc/classes/PopupMenu.xml
@@ -244,6 +244,15 @@
Removes all items from the [PopupMenu].
+
+
+
+
+
+
+ Removes all OpenType features form the item's text.
+
+
@@ -293,6 +302,15 @@
Returns the index of the item containing the specified [code]id[/code]. Index is automatically assigned to each item by the engine. Index can not be set manually.
+
+
+
+
+
+
+ Returns item's text language code.
+
+
@@ -302,6 +320,17 @@
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.
+
+
+
+
+
+
+
+
+ Returns OpenType feature [code]tag[/code] of the item's text.
+
+
@@ -329,6 +358,15 @@
Returns the text of the item at index [code]idx[/code].
+
+
+
+
+
+
+ Returns item's text base writing direction.
+
+
@@ -494,6 +532,17 @@
Sets the [code]id[/code] of the item at index [code]idx[/code].
+
+
+
+
+
+
+
+
+ Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
+
+
@@ -516,6 +565,19 @@
Sets the state of an multistate item. See [method add_multistate_item] for details.
+
+
+
+
+
+
+
+
+
+
+ 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].
+
+
@@ -562,6 +624,17 @@
Sets the text of the item at index [code]idx[/code].
+
+
+
+
+
+
+
+
+ Sets item's text base writing direction.
+
+
@@ -653,6 +726,9 @@
[Color] used for the hovered text.
+
+ Font size of the menu items.
+
[StyleBox] displayed when the [PopupMenu] item is hovered.
@@ -681,7 +757,10 @@
[StyleBox] used for the separators. See [method add_separator].
- [Texture2D] icon for the submenu arrow.
+ [Texture2D] icon for the submenu arrow (for left-to-right layouts).
+
+
+ [Texture2D] icon for the submenu arrow (for right-to-left layouts).
[Texture2D] icon for the unchecked checkbox items.
diff --git a/doc/classes/ProgressBar.xml b/doc/classes/ProgressBar.xml
index c957d6f182..c05cbf4413 100644
--- a/doc/classes/ProgressBar.xml
+++ b/doc/classes/ProgressBar.xml
@@ -35,5 +35,8 @@
The color of the text's shadow.
+
+ Font size used to draw the fill percentage if [member percent_visible] is [code]true[/code].
+
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index 96d71db383..e81160b362 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -453,6 +453,9 @@
If [code]true[/code], keeps the screen on (even in case of inactivity), so the screensaver does not take over. Works on desktop and mobile platforms.
+
+ Force layout direction and text writing direction to RTL for all locales.
+
Default orientation on mobile devices.
@@ -491,6 +494,9 @@
Specifies the tablet driver to use. If left empty, the default driver will be used.
+
+ Specifies the [TextServer] to use. If left empty, the default will be used.
+
If [code]true[/code], enables vertical synchronization. This eliminates tearing that may appear in moving scenes, at the cost of higher input latency and stuttering at lower framerates. If [code]false[/code], vertical synchronization will be disabled, however, many platforms will enforce it regardless (such as mobile platforms and HTML5).
diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml
index faf0d97766..4faff95fd3 100644
--- a/doc/classes/RichTextLabel.xml
+++ b/doc/classes/RichTextLabel.xml
@@ -329,6 +329,9 @@
The raw text of the label.
When set, clears the tag stack and adds a raw text tag to the top of it. Does not parse BBCodes. Does not modify [member bbcode_text].
+
+ Base text writing direction.
+
The restricted number of characters to display in the label. If [code]-1[/code], all characters will be displayed.
diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml
index d56781105b..9f45a361f3 100644
--- a/doc/classes/TabContainer.xml
+++ b/doc/classes/TabContainer.xml
@@ -204,6 +204,9 @@
Font color of the currently selected tab.
+
+ Font size of the tab names.
+
Space between tab's name and its icon.
diff --git a/doc/classes/Tabs.xml b/doc/classes/Tabs.xml
index 15c2d3504c..5c698a4aa8 100644
--- a/doc/classes/Tabs.xml
+++ b/doc/classes/Tabs.xml
@@ -20,6 +20,15 @@
Adds a new tab.
+
+
+
+
+
+
+ Removes all OpenType features from the tab title.
+
+
@@ -75,6 +84,15 @@
Returns the [Texture2D] for the tab at index [code]tab_idx[/code] or [code]null[/code] if the tab has no [Texture2D].
+
+
+
+
+
+
+ Returns tab title language code.
+
+
@@ -82,6 +100,17 @@
Returns the number of hidden tabs offsetted to the left.
+
+
+
+
+
+
+
+
+ Returns OpenType feature [code]tag[/code] of the tab title.
+
+
@@ -91,6 +120,15 @@
Returns tab [Rect2] with local position and size.
+
+
+
+
+
+
+ Returns tab title text base writing direction.
+
+
@@ -159,6 +197,41 @@
Sets an [code]icon[/code] for the tab at index [code]tab_idx[/code].
+
+
+
+
+
+
+
+
+ Sets language code of tab title used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
+
+
+
+
+
+
+
+
+
+
+
+
+ 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].
+
+
+
+
+
+
+
+
+
+
+ Sets tab title base writing direction.
+
+
@@ -295,6 +368,9 @@
Font color of the currently selected tab.
+
+ Font size of the tab names.
+
The horizontal separation between the tabs.
diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml
index 168cc8a1c3..eedf3b848f 100644
--- a/doc/classes/TextEdit.xml
+++ b/doc/classes/TextEdit.xml
@@ -33,6 +33,13 @@
Centers the viewport on the line the editing cursor is at. This also resets the [member scroll_horizontal] value to [code]0[/code].
+
+
+
+
+ Removes all OpenType features.
+
+
@@ -213,6 +220,15 @@
Returns the [PopupMenu] of this [TextEdit]. By default, this menu is displayed when right-clicking on the [TextEdit].
+
+
+
+
+
+
+ Returns OpenType feature [code]tag[/code].
+
+
@@ -573,6 +589,17 @@
+
+
+
+
+
+
+
+
+ Sets OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
+
+
@@ -629,6 +656,10 @@
If [code]true[/code], the caret displays as a rectangle.
If [code]false[/code], the caret displays as a bar.
+
+ Allow moving caret, selecting and removing the individual composite character components.
+ Note: [kbd]Backspace[/kbd] is always removing individual composite character components.
+
If [code]true[/code], a right-click moves the cursor at the mouse position before displaying the context menu.
If [code]false[/code], the context menu disregards mouse location.
@@ -636,6 +667,9 @@
If [code]true[/code], a right-click displays the context menu.
+
+ If [code]true[/code], control characters are displayed.
+
If [code]true[/code], the "space" character will have a visible representation.
@@ -652,6 +686,9 @@
If [code]true[/code], the line containing the cursor is highlighted.
+
+ Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
+
If [code]true[/code], a minimap is shown, providing an outline of your source code.
@@ -681,11 +718,20 @@
If [code]true[/code], sets the [code]step[/code] of the scrollbars to [code]0.25[/code] which results in smoother scrolling.
+
+ Set BiDi algorithm override for the structured text.
+
+
+ Set additional options for BiDi override.
+
String value of the [TextEdit].
+
+ Base text writing direction.
+
Vertical scroll sensitivity.
@@ -799,7 +845,70 @@
Redoes the previous action.
-
+
+ Sets text direction to inherited.
+
+
+ Sets text direction to automatic.
+
+
+ Sets text direction to left-to-right.
+
+
+ Sets text direction to right-to-left.
+
+
+ Toggles control character display.
+
+
+ Inserts left-to-right mark (LRM) character.
+
+
+ Inserts right-to-left mark (RLM) character.
+
+
+ Inserts start of left-to-right embedding (LRE) character.
+
+
+ Inserts start of right-to-left embedding (RLE) character.
+
+
+ Inserts start of left-to-right override (LRO) character.
+
+
+ Inserts start of right-to-left override (RLO) character.
+
+
+ Inserts pop direction formatting (PDF) character.
+
+
+ Inserts Arabic letter mark (ALM) character.
+
+
+ Inserts left-to-right isolate (LRI) character.
+
+
+ Inserts right-to-left isolate (RLI) character.
+
+
+ Inserts first strong isolate (FSI) character.
+
+
+ Inserts pop direction isolate (PDI) character.
+
+
+ Inserts zero width joiner (ZWJ) character.
+
+
+ Inserts zero width non-joiner (ZWNJ) character.
+
+
+ Inserts word joiner (WJ) character.
+
+
+ Inserts soft hyphen (SHY) character.
+
+
Represents the size of the [enum MenuItems] enum.
@@ -849,6 +958,9 @@
Sets the [Color] of the selected text. [member override_selected_font_color] has to be enabled.
+
+ Sets default font size.
+
Sets the spacing between the lines.
@@ -865,6 +977,7 @@
Sets the highlight [Color] of text selections.
+ Sets a custom [Texture2D] for space text characters.
Sets a custom [Texture2D] for tab text characters.
diff --git a/doc/classes/TextLine.xml b/doc/classes/TextLine.xml
new file mode 100644
index 0000000000..c21da09edb
--- /dev/null
+++ b/doc/classes/TextLine.xml
@@ -0,0 +1,212 @@
+
+
+
+ Holds a line of text.
+
+
+ Abstraction over [TextServer] for handling single line of text.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Adds inline object to the text buffer, [code]key[/code] must be unique. In the text, object is represented as [code]length[/code] object replacement characters.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Adds text span and font to draw it.
+
+
+
+
+
+
+ Clears text line (removes text and inline objects).
+
+
+
+
+
+
+
+
+
+
+
+
+ Draw text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Draw text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
+
+
+
+
+
+
+ Returns the text ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical).
+
+
+
+
+
+
+ Returns the text descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical).
+
+
+
+
+
+
+ Returns pixel offset of the underline below the baseline.
+
+
+
+
+
+
+ Returns thickness of the underline.
+
+
+
+
+
+
+ Returns width (for horizontal layout) or height (for vertical) of the text.
+
+
+
+
+
+
+
+
+ Returns bounding rectangle of the inline object.
+
+
+
+
+
+
+ Returns array of inline objects.
+
+
+
+
+
+
+ Returns TextServer buffer RID.
+
+
+
+
+
+
+ Returns size of the bounding box of the text.
+
+
+
+
+
+
+
+
+ Returns caret character offset at the specified pixel offset at the baseline. This function always returns a valid position.
+
+
+
+
+
+
+
+
+
+
+
+
+ Sets new size and alignment of embedded object.
+
+
+
+
+
+
+
+
+ Overrides BiDi for the structured text.
+ Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately.
+
+
+
+
+
+
+
+
+ Aligns text to the given tab-stops.
+
+
+
+
+
+ Text horizontal alignment.
+
+
+ Text writing direction.
+
+
+ Line Alignment rules. For more info see [TextServer].
+
+
+ Text orientation.
+
+
+ If set to [code]true[/code] text will display control characters.
+
+
+ If set to [code]true[/code] text will display invalid characters.
+
+
+ Text line width.
+
+
+
+
+
diff --git a/doc/classes/TextParagraph.xml b/doc/classes/TextParagraph.xml
new file mode 100644
index 0000000000..fabf22eef7
--- /dev/null
+++ b/doc/classes/TextParagraph.xml
@@ -0,0 +1,299 @@
+
+
+
+ Holds a paragraph of text.
+
+
+ Abstraction over [TextServer] for handling paragraph of text.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Adds inline object to the text buffer, [code]key[/code] must be unique. In the text, object is represented as [code]length[/code] object replacement characters.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Adds text span and font to draw it.
+
+
+
+
+
+
+ Clears text paragraph (removes text and inline objects).
+
+
+
+
+
+
+
+
+
+
+
+
+ Draw text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Draw single line of text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Draw outline of the single line of text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Draw outline of the text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
+
+
+
+
+
+
+
+
+ Returns the text line ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical).
+
+
+
+
+
+
+ Returns number of lines in the paragraph.
+
+
+
+
+
+
+
+
+ Returns the text line descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical).
+
+
+
+
+
+
+
+
+
+
+ Returns bounding rectangle of the inline object.
+
+
+
+
+
+
+
+
+ Returns array of inline objects in the line.
+
+
+
+
+
+
+
+
+ Returns character range of the line.
+
+
+
+
+
+
+
+
+ Returns TextServer line buffer RID.
+
+
+
+
+
+
+
+
+ Returns size of the bounding box of the line of text.
+
+
+
+
+
+
+
+
+ Returns pixel offset of the underline below the baseline.
+
+
+
+
+
+
+
+
+ Returns thickness of the underline.
+
+
+
+
+
+
+
+
+ Returns width (for horizontal layout) or height (for vertical) of the line of text.
+
+
+
+
+
+
+ Returns the size of the bounding box of the paragraph, without line breaks.
+
+
+
+
+
+
+ Returns TextServer full string buffer RID.
+
+
+
+
+
+
+ Returns the size of the bounding box of the paragraph.
+
+
+
+
+
+
+
+
+ Returns caret character offset at the specified coordinates. This function always returns a valid position.
+
+
+
+
+
+
+
+
+
+
+
+
+ Sets new size and alignment of embedded object.
+
+
+
+
+
+
+
+
+ Overrides BiDi for the structured text.
+ Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately.
+
+
+
+
+
+
+
+
+ Aligns paragraph to the given tab-stops.
+
+
+
+
+
+ Paragraph horizontal alignment.
+
+
+ Text writing direction.
+
+
+ Line breaking and alignment rules. For more info see [TextServer].
+
+
+ Text orientation.
+
+
+ If set to [code]true[/code] text will display control characters.
+
+
+ If set to [code]true[/code] text will display invalid characters.
+
+
+ Paragraph width.
+
+
+
+
+
diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml
new file mode 100644
index 0000000000..43388bb7f1
--- /dev/null
+++ b/doc/classes/TextServer.xml
@@ -0,0 +1,1167 @@
+
+
+
+ Interface for the fonts and complex text layouts.
+
+
+ [TextServer] is the API backend for managing fonts, and rendering complex text.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Creates new font from the data in memory. To free the resulting font, use [method free_rid] method.
+ Note: For non-scalable fonts [code]base_size[/code] is ignored, use [method font_get_base_size] to check actual font size.
+
+
+
+
+
+
+
+
+
+
+ Creates new font from the file. To free the resulting font, use [method free_rid] method.
+ Note: For non-scalable fonts [code]base_size[/code] is ignored, use [method font_get_base_size] to check actual font size.
+
+
+
+
+
+
+
+
+
+
+ Creates new font from the system font. To free the resulting font, use [method free_rid] method.
+ Note: This method is supported by servers with the [code]FEATURE_FONT_SYSTEM[/code] feature.
+ Note: For non-scalable fonts [code]base_size[/code] is ignored, use [method font_get_base_size] to check actual font size.
+
+
+
+
+
+
+
+
+
+
+ Creates new buffer for complex text layout, with the given [code]direction[/code] and [code]orientation[/code]. To free the resulting buffer, use [method free_rid] method.
+ Note: Direction is ignored if server does not support [code]FEATURE_BIDI_LAYOUT[/code] feature.
+ Note: Orientation is ignored if server does not support [code]FEATURE_VERTICAL_LAYOUT[/code] feature.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Draws box displaying character hexadecimal code. Used for replacing missing characters.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Draws single glyph into a canvas item at the position, using [code]font[/code] at the size [code]size[/code].
+ Note: Glyph index is specific to the font, use glyphs indices returned by [method shaped_text_get_glyphs] or [method font_get_glyph_index].
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Draws single glyph outline of size [code]outline_size[/code] into a canvas item at the position, using [code]font[/code] at the size [code]size[/code].
+ Note: Glyph index is specific to the font, use glyphs indices returned by [method shaped_text_get_glyphs] or [method font_get_glyph_index].
+
+
+
+
+
+
+
+
+ Returns [code]true[/code], if font anti-aliasing is supported and enabled.
+
+
+
+
+
+
+
+
+
+
+ Returns the font ascent (number of pixels above the baseline).
+
+
+
+
+
+
+
+
+ Returns the default size of the font.
+
+
+
+
+
+
+
+
+
+
+ Returns the font descent (number of pixels below the baseline).
+
+
+
+
+
+
+
+
+ Returns [code]true[/code], if distance field hint is enabled.
+
+
+
+
+
+
+
+
+ Returns list of OpenType features supported by font.
+
+
+
+
+
+
+
+
+ Returns [code]true[/code], if autohinter is supported and enabled.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns advance of the glyph.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns the glyph index of a [code]char[/code], optionally modified by the [code]variation_selector[/code].
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns a kerning of the pair of glyphs.
+
+
+
+
+
+
+
+
+
+
+ Returns the total font height (ascent plus descent) in pixels.
+
+
+
+
+
+
+
+
+ Returns the font hinting.
+
+
+
+
+
+
+
+
+
+
+ Returns [code]true[/code] if support override is enabled for the [code]language[/code].
+
+
+
+
+
+
+
+
+ Returns list of language support overrides.
+
+
+
+
+
+
+ Returns the font oversampling factor, shared by all fonts in the TextServer.
+
+
+
+
+
+
+
+
+
+
+ Returns [code]true[/code] if support override is enabled for the [code]script[/code].
+
+
+
+
+
+
+
+
+ Returns list of script support overrides.
+
+
+
+
+
+
+
+
+ Returns a string containing all the characters available in the font.
+
+
+
+
+
+
+
+
+
+
+ Returns underline offset (number of pixels below the baseline).
+
+
+
+
+
+
+
+
+
+
+ Returns underline thickness in pixels.
+
+
+
+
+
+
+
+
+
+
+ Returns [code]true[/code] if [code]char[/code] is available in the font.
+
+
+
+
+
+
+
+
+ Returns [code]true[/code], if font supports glyph outlines.
+
+
+
+
+
+
+
+
+
+
+ Returns [code]true[/code], if font supports given language (ISO 639 code).
+
+
+
+
+
+
+
+
+
+
+ Returns [code]true[/code], if font supports given script (ISO 15924 code).
+
+
+
+
+
+
+
+
+
+
+ Remove language support override.
+
+
+
+
+
+
+
+
+
+
+ Removes script support override.
+
+
+
+
+
+
+
+
+
+
+ Sets font anti-aliasing.
+
+
+
+
+
+
+
+
+
+
+ Sets font distance field hint.
+
+
+
+
+
+
+
+
+
+
+ Enables/disables default autohinter.
+
+
+
+
+
+
+
+
+
+
+ Sets font hinting.
+
+
+
+
+
+
+
+
+
+
+
+
+ Adds override for [method font_is_language_supported].
+
+
+
+
+
+
+
+
+ Sets oversampling factor, shared by all font in the TextServer.
+
+
+
+
+
+
+
+
+
+
+
+
+ Adds override for [method font_is_script_supported].
+
+
+
+
+
+
+
+
+
+
+ Converts a number from the Western Arabic (0..9) to the numeral systems used in [code]language[/code].
+
+
+
+
+
+
+
+
+ Frees an object created by this [TextServer].
+
+
+
+
+
+
+
+
+
+
+ Returns size of the replacement character (box with character hexadecimal code that is drawn in place of invalid characters).
+
+
+
+
+
+
+ Returns the name of the server interface.
+
+
+
+
+
+
+ Returns list of available system fonts.
+ Note: This method is supported by servers with the [code]FEATURE_FONT_SYSTEM[/code] feature.
+
+
+
+
+
+
+
+
+ Returns [code]true[/code] if [code]rid[/code] is valid resource owned by this text server.
+
+
+
+
+
+
+
+
+ Returns [code]true[/code] if the server supports a feature.
+
+
+
+
+
+
+
+
+ Returns [code]true[/code] if locale is right-to-left.
+
+
+
+
+
+
+
+
+ Loads optional TextServer database (e.g. ICU break iterators and dictionaries).
+ Note: This function should be called before any other TextServer functions used, otherwise it won't have any effect.
+
+
+
+
+
+
+
+
+ Converts readable feature, variation, script or language name to OpenType tag.
+
+
+
+
+
+
+
+
+
+
+ Converts a number from the numeral systems used in [code]language[/code] to Western Arabic (0..9).
+
+
+
+
+
+
+
+
+ Returns percent sign used in the [code]language[/code].
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Adds inline object to the text buffer, [code]key[/code] must be unique. In the text, object is represented as [code]length[/code] object replacement characters.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Adds text span and font to draw it to the text buffer.
+
+
+
+
+
+
+
+
+ Clears text buffer (removes text and inline objects).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Draw shaped text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Draw the outline of the shaped text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout).
+
+
+
+
+
+
+
+
+
+
+
+
+ Adjusts text with to fit to specified width, returns new text width.
+
+
+
+
+
+
+
+
+ Returns the text ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical).
+ Note: overall ascent can be higher than font ascent, if some glyphs are displaced from the baseline.
+
+
+
+
+
+
+
+
+
+
+ Returns shapes of the carets corresponding to the character offset [code]position[/code] in the text. Returned caret shape is 1 pixel wide rectangle.
+
+
+
+
+
+
+
+
+ Returns the text descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical).
+ Note: overall descent can be higher than font descent, if some glyphs are displaced from the baseline.
+
+
+
+
+
+
+
+
+ Returns direction of the text.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns dominant direction of in the range of text.
+
+
+
+
+
+
+
+
+ Returns text glyphs.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Breaks text to the lines and returns character ranges for each line.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Breaks text to the lines and columns. Returns character ranges for each segment.
+
+
+
+
+
+
+
+
+
+
+ Returns bounding rectangle of the inline object.
+
+
+
+
+
+
+
+
+ Returns array of inline objects.
+
+
+
+
+
+
+
+
+ Returns text orientation.
+
+
+
+
+
+
+
+
+ Sets text orientation.
+
+
+
+
+
+
+
+
+ Returns [code]true[/code] if text buffer is configured to display control characters.
+
+
+
+
+
+
+
+
+ Returns [code]true[/code] if text buffer is configured to display hexadecimal codes in place of invalid characters.
+ Note: If set to [code]false[/code], nothing is displayed in place of invalid characters.
+
+
+
+
+
+
+
+
+ Returns substring buffer character range in the parent buffer.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns selection rectangles for the specified character range.
+
+
+
+
+
+
+
+
+ Returns size of the text.
+
+
+
+
+
+
+
+
+ Returns pixel offset of the underline below the baseline.
+
+
+
+
+
+
+
+
+ Returns thickness of the underline.
+
+
+
+
+
+
+
+
+ Returns width (for horizontal layout) or height (for vertical) of the text.
+
+
+
+
+
+
+
+
+ Breaks text into words and returns array of character ranges.
+
+
+
+
+
+
+
+
+
+
+ Returns grapheme index at the specified pixel offset at the baseline, or [code]-1[/code] if none is found.
+
+
+
+
+
+
+
+
+
+
+ Returns caret character offset at the specified pixel offset at the baseline. This function always returns a valid position.
+
+
+
+
+
+
+
+
+ Returns [code]true[/code] if buffer is successfully shaped.
+
+
+
+
+
+
+
+
+
+
+ Returns composite character end position closest to the [code]pos[/code].
+
+
+
+
+
+
+
+
+
+
+ Returns composite character start position closest to the [code]pos[/code].
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Sets new size and alignment of embedded object.
+
+
+
+
+
+
+
+
+
+
+ Overrides BiDi for the structured text.
+ Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately.
+
+
+
+
+
+
+
+
+
+
+ Sets desired text direction. If set to [code]TEXT_DIRECTION_AUTO[/code], direction will be detected based on the buffer contents and current locale.
+ Note: Direction is ignored if server does not support [code]FEATURE_BIDI_LAYOUT[/code] feature.
+
+
+
+
+
+
+
+
+
+
+ Sets desired text orientation.
+ Note: Orientation is ignored if server does not support [code]FEATURE_VERTICAL_LAYOUT[/code] feature.
+
+
+
+
+
+
+
+
+
+
+ If set to [code]true[/code] text buffer will display control characters.
+
+
+
+
+
+
+
+
+
+
+ If set to [code]true[/code] text buffer will display invalid characters as hexadecimal codes, otherwise nothing is displayed.
+
+
+
+
+
+
+
+
+ Shapes buffer if it's not shaped. Returns [code]true[/code] if the string is shaped successfully.
+ Note: It is not necessary to call this function manually, buffer will be shaped automatically as soon as any of its output data is requested.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns text buffer for the substring of the text in the [code]shaped[/code] text buffer (including inline objects).
+
+
+
+
+
+
+
+
+
+
+ Aligns shaped text to the given tab-stops.
+
+
+
+
+
+
+
+
+ Converts OpenType tag to readable feature, variation, script or language name.
+
+
+
+
+
+ Text direction is determined based on contents and current locale.
+
+
+ Text is written from left to right.
+
+
+ Text is written from right to left.
+
+
+ Text is written horizontally.
+
+
+ Left to right text is written vertically from top to bottom.
+ Right to left text is written vertically from bottom to top.
+
+
+ Do not justify text.
+
+
+ Justify text by adding and removing kashidas.
+
+
+ Justify text by changing width of the spaces between the words.
+
+
+ Remove trailing and leading spaces from the justified text.
+
+
+ Only apply justification to the part of the text after the last tab.
+
+
+ Do not break the line.
+
+
+ Break the line at the line mandatory break characters (e.g. [code]"\n"[/code]).
+
+
+ Break the line between the words.
+
+
+ Break the line between any unconnected graphemes.
+
+
+ Grapheme is part of right-to-left or bottom-to-top run.
+
+
+ Grapheme is not part of source text, it was added by justification process.
+
+
+ Grapheme is whitespace.
+
+
+ Grapheme is mandatory break point (e.g. [code]"\n"[/code]).
+
+
+ Grapheme is optional break point (e.g. space).
+
+
+ Grapheme is the tabulation character.
+
+
+ Grapheme is kashida.
+
+
+ Disables font hinting (smoother but less crisp).
+
+
+ Use the light font hinting mode.
+
+
+ Use the default font hinting mode (crisper but less smooth).
+
+
+ TextServer supports bidirectional layouts.
+
+
+ TextServer supports vertical layouts.
+
+
+ TextServer supports complex text shaping.
+
+
+ TextServer supports justification using kashidas.
+
+
+ TextServer supports complex line/word breaking rules (e.g. dictionary based).
+
+
+ TextServer supports loading system fonts.
+
+
+ TextServer require external data file for some features.
+
+
+
diff --git a/doc/classes/TextServerManager.xml b/doc/classes/TextServerManager.xml
new file mode 100644
index 0000000000..29586f30b4
--- /dev/null
+++ b/doc/classes/TextServerManager.xml
@@ -0,0 +1,82 @@
+
+
+
+ Manager for the font and complex text layout servers.
+
+
+ [TextServerManager] is the API backend for loading, enumeration and switching [TextServer]s.
+ Note: Switching text server at runtime is possible, but will invalidate all fonts and text buffers. Make sure to unload all controls, fonts, and themes before doing so.
+
+
+
+
+
+
+
+
+
+
+ Finds an interface by its name.
+
+
+
+
+
+
+
+
+ Returns the interface registered at a given index.
+
+
+
+
+
+
+ Returns the number of interfaces currently registered.
+
+
+
+
+
+
+
+
+ Returns text server supported features (binary OR).
+
+
+
+
+
+
+
+
+ Returns the interface name registered at a given index.
+
+
+
+
+
+
+ Returns a list of available interfaces the index and name of each interface.
+
+
+
+
+
+
+ Returns the primary [TextServer] interface.
+
+
+
+
+
+
+
+
+ Sets (and initializes it if required) interface registered at a given index as the primary. Invalidates all references to the fonts and text buffers.
+
+
+
+
+
+
diff --git a/doc/classes/Theme.xml b/doc/classes/Theme.xml
index 783614c4af..1af6610f6f 100644
--- a/doc/classes/Theme.xml
+++ b/doc/classes/Theme.xml
@@ -51,6 +51,17 @@
Clears the [Font] at [code]name[/code] if the theme has [code]node_type[/code].
+
+
+
+
+
+
+
+
+ Clears the font size [code]name[/code] if the theme has [code]node_type[/code].
+
+
@@ -149,6 +160,26 @@
Returns all the [Font]s as a [PackedStringArray] filled with each [Font]'s name, for use in [method get_font], if the theme has [code]node_type[/code].
+
+
+
+
+
+
+
+
+ Returns the font size at [code]name[/code] if the theme has [code]node_type[/code].
+
+
+
+
+
+
+
+
+ Returns all the font sizes as a [PackedStringArray] filled with each font size name, for use in [method get_font_size], if the theme has [code]node_type[/code].
+
+
@@ -241,6 +272,18 @@
Returns [code]false[/code] if the theme does not have [code]node_type[/code].
+
+
+
+
+
+
+
+
+ Returns [code]true[/code] if font size with [code]name[/code] is in [code]node_type[/code].
+ Returns [code]false[/code] if the theme does not have [code]node_type[/code].
+
+
@@ -307,6 +350,20 @@
Does nothing if the theme does not have [code]node_type[/code].
+
+
+
+
+
+
+
+
+
+
+ Sets the theme's font size to [code]font_size[/code] at [code]name[/code] in [code]node_type[/code].
+ Does nothing if the theme does not have [code]node_type[/code].
+
+
@@ -340,6 +397,9 @@
The theme's default font.
+
+ The theme's default font size. Set to [code]-1[/code] to ignore and use global default.
+
diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml
index 73575b4309..01818e2993 100644
--- a/doc/classes/Tree.xml
+++ b/doc/classes/Tree.xml
@@ -35,6 +35,15 @@
Clears the tree. This removes all items.
+
+
+
+
+
+
+ Removes all OpenType features from the item's text.
+
+
@@ -75,6 +84,35 @@
Returns the column's title.
+
+
+
+
+
+
+ Returns column title base writing direction.
+
+
+
+
+
+
+
+
+ Returns column title language code.
+
+
+
+
+
+
+
+
+
+
+ Returns OpenType feature [code]tag[/code] of the column title.
+
+
@@ -225,6 +263,41 @@
Sets the title of a column.
+
+
+
+
+
+
+
+
+ Sets column title base writing direction.
+
+
+
+
+
+
+
+
+
+
+ Sets language code of column title used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
+
+
+
+
+
+
+
+
+
+
+
+
+ Sets OpenType feature [code]tag[/code] for the column title.
+
+
@@ -398,7 +471,10 @@
The arrow icon used when a foldable item is not collapsed.
- The arrow icon used when a foldable item is collapsed.
+ The arrow icon used when a foldable item is collapsed (for left-to-right layouts).
+
+
+ The arrow icon used when a foldable item is collapsed (for right-to-left layouts).
Default [StyleBox] for the [Tree], i.e. used when the control is not being focused.
@@ -451,6 +527,9 @@
Text [Color] used when the item is selected.
+
+ Font size of the item's text.
+
[Color] of the guideline.
diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml
index 22e643a51d..e97c1e580c 100644
--- a/doc/classes/TreeItem.xml
+++ b/doc/classes/TreeItem.xml
@@ -54,6 +54,15 @@
Resets the color for the given column to default.
+
+
+
+
+
+
+ Removes all OpenType features.
+
+
@@ -184,6 +193,15 @@
Returns the icon [Texture2D] region as [Rect2].
+
+
+
+
+
+
+ Returns item's text language code.
+
+
@@ -209,6 +227,17 @@
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].
+
+
+
+
+
+
+
+
+ Returns OpenType feature [code]tag[/code] of the item's text.
+
+
@@ -249,6 +278,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -275,6 +320,15 @@
Returns the given column's text alignment.
+
+
+
+
+
+
+ Returns item's text base writing direction.
+
+
@@ -533,6 +587,17 @@
Sets the given column's icon's texture region.
+
+
+
+
+
+
+
+
+ Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
+
+
@@ -543,6 +608,19 @@
+
+
+
+
+
+
+
+
+
+
+ Sets OpenType feature [code]tag[/code] for the item's text.
+
+
@@ -580,6 +658,26 @@
If [code]true[/code], the given column is selectable.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -611,6 +709,17 @@
Sets the given column's text alignment. See [enum TextAlign] for possible values.
+
+
+
+
+
+
+
+
+ Sets item's text base writing direction.
+
+
diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml
index a0711b4214..0f887c7705 100644
--- a/doc/classes/Window.xml
+++ b/doc/classes/Window.xml
@@ -27,6 +27,13 @@
+
+
+
+
+ Returns layout direction and text writing direction.
+
+
@@ -61,6 +68,18 @@
+ Returns the [Font] at [code]name[/code] if the theme has [code]type[/code].
+
+
+
+
+
+
+
+
+
+
+ Returns the font size at [code]name[/code] if the theme has [code]type[/code].
@@ -123,6 +142,20 @@
+ Returns [code]true[/code] if [Font] with [code]name[/code] is in [code]type[/code].
+ Returns [code]false[/code] if the theme does not have [code]type[/code].
+
+
+
+
+
+
+
+
+
+
+ Returns [code]true[/code] if font size with [code]name[/code] is in [code]type[/code].
+ Returns [code]false[/code] if the theme does not have [code]type[/code].
@@ -157,6 +190,13 @@
+
+
+
+
+ Returns [code]true[/code] if layout is right-to-left.
+
+
@@ -249,6 +289,15 @@
+
+
+
+
+
+
+ Sets layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew).
+
+
@@ -393,6 +442,18 @@
+
+ Automatic layout direction, determined from the parent control layout direction.
+
+
+ Automatic layout direction, determined from the current locale.
+
+
+ Left-to-right layout direction.
+
+
+ Right-to-left layout direction.
+
--
cgit v1.2.3