diff options
Diffstat (limited to 'doc/classes/TextServer.xml')
-rw-r--r-- | doc/classes/TextServer.xml | 139 |
1 files changed, 86 insertions, 53 deletions
diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml index be3c04e913..f4d92ab9b6 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -20,7 +20,7 @@ <param index="0" name="direction" type="int" enum="TextServer.Direction" default="0" /> <param index="1" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> <description> - 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. + Creates new buffer for complex text layout, with the given [param direction] and [param orientation]. To free the resulting buffer, use [method free_rid] method. [b]Note:[/b] Direction is ignored if server does not support [constant FEATURE_BIDI_LAYOUT] feature (supported by [TextServerAdvanced]). [b]Note:[/b] Orientation is ignored if server does not support [constant FEATURE_VERTICAL_LAYOUT] feature (supported by [TextServerAdvanced]). </description> @@ -78,7 +78,7 @@ <param index="4" name="index" type="int" /> <param index="5" name="color" type="Color" default="Color(1, 1, 1, 1)" /> <description> - Draws single glyph into a canvas item at the position, using [code]font_rid[/code] at the size [code]size[/code]. + Draws single glyph into a canvas item at the position, using [param font_rid] at the size [param size]. [b]Note:[/b] Glyph index is specific to the font, use glyphs indices returned by [method shaped_text_get_glyphs] or [method font_get_glyph_index]. [b]Note:[/b] If there are pending glyphs to render, calling this function might trigger the texture cache update. </description> @@ -93,11 +93,18 @@ <param index="5" name="index" type="int" /> <param index="6" name="color" type="Color" default="Color(1, 1, 1, 1)" /> <description> - Draws single glyph outline of size [code]outline_size[/code] into a canvas item at the position, using [code]font_rid[/code] at the size [code]size[/code]. + Draws single glyph outline of size [param outline_size] into a canvas item at the position, using [param font_rid] at the size [param size]. [b]Note:[/b] Glyph index is specific to the font, use glyphs indices returned by [method shaped_text_get_glyphs] or [method font_get_glyph_index]. [b]Note:[/b] If there are pending glyphs to render, calling this function might trigger the texture cache update. </description> </method> + <method name="font_get_antialiasing" qualifiers="const"> + <return type="int" enum="TextServer.FontAntialiasing" /> + <param index="0" name="font_rid" type="RID" /> + <description> + Returns font anti-aliasing mode. + </description> + </method> <method name="font_get_ascent" qualifiers="const"> <return type="float" /> <param index="0" name="font_rid" type="RID" /> @@ -184,11 +191,11 @@ <param index="2" name="char" type="int" /> <param index="3" name="variation_selector" type="int" /> <description> - Returns the glyph index of a [code]char[/code], optionally modified by the [code]variation_selector[/code]. + Returns the glyph index of a [param char], optionally modified by the [param variation_selector]. </description> </method> <method name="font_get_glyph_list" qualifiers="const"> - <return type="Array" /> + <return type="PackedInt32Array" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <description> @@ -268,7 +275,7 @@ </description> </method> <method name="font_get_kerning_list" qualifiers="const"> - <return type="Array" /> + <return type="Vector2i[]" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="int" /> <description> @@ -280,7 +287,7 @@ <param index="0" name="font_rid" type="RID" /> <param index="1" name="language" type="String" /> <description> - Returns [code]true[/code] if support override is enabled for the [code]language[/code]. + Returns [code]true[/code] if support override is enabled for the [param language]. </description> </method> <method name="font_get_language_support_overrides"> @@ -338,7 +345,7 @@ <param index="0" name="font_rid" type="RID" /> <param index="1" name="script" type="String" /> <description> - Returns [code]true[/code] if support override is enabled for the [code]script[/code]. + Returns [code]true[/code] if support override is enabled for the [param script]. </description> </method> <method name="font_get_script_support_overrides"> @@ -349,7 +356,7 @@ </description> </method> <method name="font_get_size_cache_list" qualifiers="const"> - <return type="Array" /> + <return type="Vector2i[]" /> <param index="0" name="font_rid" type="RID" /> <description> Returns list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size. @@ -373,7 +380,7 @@ <return type="int" enum="TextServer.SubpixelPositioning" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns font sub-pixel glyph positioning mode. + Returns font subpixel glyph positioning mode. </description> </method> <method name="font_get_supported_chars" qualifiers="const"> @@ -406,7 +413,7 @@ <param index="1" name="size" type="Vector2i" /> <param index="2" name="texture_index" type="int" /> <description> - Returns array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty. + Returns array containing glyph packing data. </description> </method> <method name="font_get_transform" qualifiers="const"> @@ -444,14 +451,7 @@ <param index="0" name="font_rid" type="RID" /> <param index="1" name="char" type="int" /> <description> - Returns [code]true[/code] if a Unicode [code]char[/code] is available in the font. - </description> - </method> - <method name="font_is_antialiased" qualifiers="const"> - <return type="bool" /> - <param index="0" name="font_rid" type="RID" /> - <description> - Returns [code]true[/code] if font 8-bit anitialiased glyph rendering is supported and enabled. + Returns [code]true[/code] if a Unicode [param char] is available in the font. </description> </method> <method name="font_is_force_autohinter" qualifiers="const"> @@ -556,12 +556,12 @@ Renders the range of characters to the font cache texture. </description> </method> - <method name="font_set_antialiased"> + <method name="font_set_antialiasing"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> - <param index="1" name="antialiased" type="bool" /> + <param index="1" name="antialiasing" type="int" enum="TextServer.FontAntialiasing" /> <description> - If set to [code]true[/code], 8-bit antialiased glyph rendering is used, otherwise 1-bit rendering is used. Used by dynamic fonts only. + Sets font anti-aliasing mode. </description> </method> <method name="font_set_ascent"> @@ -595,7 +595,7 @@ <param index="0" name="font_rid" type="RID" /> <param index="1" name="strength" type="float" /> <description> - Sets font embolden strength. If [code]strength[/code] is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. + Sets font embolden strength. If [param strength] is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. </description> </method> <method name="font_set_face_index"> @@ -804,7 +804,7 @@ <param index="0" name="font_rid" type="RID" /> <param index="1" name="subpixel_positioning" type="int" enum="TextServer.SubpixelPositioning" /> <description> - Sets font sub-pixel glyph positioning mode. + Sets font subpixel glyph positioning mode. </description> </method> <method name="font_set_texture_image"> @@ -824,7 +824,7 @@ <param index="2" name="texture_index" type="int" /> <param index="3" name="offset" type="PackedInt32Array" /> <description> - Sets array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty. + Sets array containing glyph packing data. </description> </method> <method name="font_set_transform"> @@ -881,7 +881,7 @@ <param index="0" name="number" type="String" /> <param index="1" name="language" type="String" default="""" /> <description> - Converts a number from the Western Arabic (0..9) to the numeral systems used in [code]language[/code]. + Converts a number from the Western Arabic (0..9) to the numeral systems used in [param language]. </description> </method> <method name="free_rid"> @@ -927,7 +927,7 @@ <return type="bool" /> <param index="0" name="rid" type="RID" /> <description> - Returns [code]true[/code] if [code]rid[/code] is valid resource owned by this text server. + Returns [code]true[/code] if [param rid] is valid resource owned by this text server. </description> </method> <method name="has_feature" qualifiers="const"> @@ -942,7 +942,7 @@ <param index="0" name="string" type="String" /> <param index="1" name="dict" type="PackedStringArray" /> <description> - Returns index of the first string in [code]dict[/dict] which is visually confusable with the [code]string[/string], or [code]-1[/code] if none is found. + Returns index of the first string in [param dict] which is visually confusable with the [param string], or [code]-1[/code] if none is found. [b]Note:[/b] This method doesn't detect invisible characters, for spoof detection use it in combination with [method spoof_check]. [b]Note:[/b] Always returns [code]-1[/code] if the server does not support the [constant FEATURE_UNICODE_SECURITY] feature. </description> @@ -958,7 +958,7 @@ <return type="bool" /> <param index="0" name="string" type="String" /> <description> - Returns [code]true[/code] is [code]string[/code] is a valid identifier. + Returns [code]true[/code] is [param string] is a valid identifier. If the text server supports the [constant FEATURE_UNICODE_IDENTIFIERS] feature, a valid identifier must: - Conform to normalization form C. - Begin with a Unicode character of class XID_Start or [code]"_"[/code]. @@ -989,11 +989,11 @@ <param index="0" name="number" type="String" /> <param index="1" name="language" type="String" default="""" /> <description> - Converts a number from the numeral systems used in [code]language[/code] to Western Arabic (0..9). + Converts [param number] from the numeral systems used in [param language] to Western Arabic (0..9). </description> </method> <method name="parse_structured_text" qualifiers="const"> - <return type="Array" /> + <return type="Vector2i[]" /> <param index="0" name="parser_type" type="int" enum="TextServer.StructuredTextParser" /> <param index="1" name="args" type="Array" /> <param index="2" name="text" type="String" /> @@ -1005,7 +1005,7 @@ <return type="String" /> <param index="0" name="language" type="String" default="""" /> <description> - Returns percent sign used in the [code]language[/code]. + Returns percent sign used in the [param language]. </description> </method> <method name="save_support_data" qualifiers="const"> @@ -1035,7 +1035,7 @@ <return type="void" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="index" type="int" /> - <param index="2" name="fonts" type="Array" /> + <param index="2" name="fonts" type="RID[]" /> <param index="3" name="size" type="int" /> <param index="4" name="opentype_features" type="Dictionary" default="{}" /> <description> @@ -1050,14 +1050,14 @@ <param index="3" name="inline_align" type="int" enum="InlineAlignment" default="5" /> <param index="4" name="length" type="int" default="1" /> <description> - 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 inline object to the text buffer, [param key] must be unique. In the text, object is represented as [param length] object replacement characters. </description> </method> <method name="shaped_text_add_string"> <return type="bool" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="text" type="String" /> - <param index="2" name="fonts" type="Array" /> + <param index="2" name="fonts" type="RID[]" /> <param index="3" name="size" type="int" /> <param index="4" name="opentype_features" type="Dictionary" default="{}" /> <param index="5" name="language" type="String" default="""" /> @@ -1082,7 +1082,7 @@ <param index="4" name="clip_r" type="float" default="-1" /> <param index="5" name="color" type="Color" default="Color(1, 1, 1, 1)" /> <description> - 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 shaped text into a canvas item at a given position, with [param color]. [param pos] specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout). </description> </method> <method name="shaped_text_draw_outline" qualifiers="const"> @@ -1095,7 +1095,7 @@ <param index="5" name="outline_size" type="int" default="1" /> <param index="6" name="color" type="Color" default="Color(1, 1, 1, 1)" /> <description> - 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). + Draw the outline of the shaped text into a canvas item at a given position, with [param color]. [param pos] specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout). </description> </method> <method name="shaped_text_fit_to_width"> @@ -1120,7 +1120,7 @@ <param index="0" name="shaped" type="RID" /> <param index="1" name="position" type="int" /> <description> - 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 shapes of the carets corresponding to the character offset [param position] in the text. Returned caret shape is 1 pixel wide rectangle. </description> </method> <method name="shaped_text_get_custom_punctuation" qualifiers="const"> @@ -1162,7 +1162,7 @@ </description> </method> <method name="shaped_text_get_ellipsis_glyphs" qualifiers="const"> - <return type="Array" /> + <return type="Dictionary[]" /> <param index="0" name="shaped" type="RID" /> <description> Returns array of the glyphs in the ellipsis. @@ -1183,7 +1183,7 @@ </description> </method> <method name="shaped_text_get_glyphs" qualifiers="const"> - <return type="Array" /> + <return type="Dictionary[]" /> <param index="0" name="shaped" type="RID" /> <description> Returns an array of glyphs in the visual order. @@ -1333,7 +1333,7 @@ <param index="0" name="shaped" type="RID" /> <param index="1" name="grapheme_flags" type="int" enum="TextServer.GraphemeFlag" default="264" /> <description> - Breaks text into words and returns array of character ranges. Use [code]grapheme_flags[/code] to set what characters are used for breaking (see [enum GraphemeFlag]). + Breaks text into words and returns array of character ranges. Use [param grapheme_flags] to set what characters are used for breaking (see [enum GraphemeFlag]). </description> </method> <method name="shaped_text_hit_test_grapheme" qualifiers="const"> @@ -1364,7 +1364,7 @@ <param index="0" name="shaped" type="RID" /> <param index="1" name="pos" type="int" /> <description> - Returns composite character end position closest to the [code]pos[/code]. + Returns composite character end position closest to the [param pos]. </description> </method> <method name="shaped_text_overrun_trim_to_width"> @@ -1381,7 +1381,7 @@ <param index="0" name="shaped" type="RID" /> <param index="1" name="pos" type="int" /> <description> - Returns composite character start position closest to the [code]pos[/code]. + Returns composite character start position closest to the [param pos]. </description> </method> <method name="shaped_text_resize_object"> @@ -1416,7 +1416,7 @@ <param index="0" name="shaped" type="RID" /> <param index="1" name="direction" type="int" enum="TextServer.Direction" default="0" /> <description> - Sets desired text direction. If set to [code]TEXT_DIRECTION_AUTO[/code], direction will be detected based on the buffer contents and current locale. + Sets desired text direction. If set to [constant DIRECTION_AUTO], direction will be detected based on the buffer contents and current locale. [b]Note:[/b] Direction is ignored if server does not support [constant FEATURE_BIDI_LAYOUT] feature (supported by [TextServerAdvanced]). </description> </method> @@ -1463,7 +1463,7 @@ </description> </method> <method name="shaped_text_sort_logical"> - <return type="Array" /> + <return type="Dictionary[]" /> <param index="0" name="shaped" type="RID" /> <description> Returns text glyphs in the logical order. @@ -1475,7 +1475,7 @@ <param index="1" name="start" type="int" /> <param index="2" name="length" type="int" /> <description> - Returns text buffer for the substring of the text in the [code]shaped[/code] text buffer (including inline objects). + Returns text buffer for the substring of the text in the [param shaped] text buffer (including inline objects). </description> </method> <method name="shaped_text_tab_align"> @@ -1490,7 +1490,7 @@ <return type="bool" /> <param index="0" name="string" type="String" /> <description> - Returns [code]true[/code] if [code]string[/code] is likely to be an attempt at confusing the reader. + Returns [code]true[/code] if [param string] is likely to be an attempt at confusing the reader. [b]Note:[/b] Always returns [code]false[/code] if the server does not support the [constant FEATURE_UNICODE_SECURITY] feature. </description> </method> @@ -1539,6 +1539,34 @@ </method> </methods> <constants> + <constant name="FONT_ANTIALIASING_NONE" value="0" enum="FontAntialiasing"> + Font glyphs are rasterized as 1-bit bitmaps. + </constant> + <constant name="FONT_ANTIALIASING_GRAY" value="1" enum="FontAntialiasing"> + Font glyphs are rasterized as 8-bit grayscale anti-aliased bitmaps. + </constant> + <constant name="FONT_ANTIALIASING_LCD" value="2" enum="FontAntialiasing"> + Font glyphs are rasterized for LCD screens. + LCD subpixel layout is determined by the value of [code]gui/theme/lcd_subpixel_layout[/code] project settings. + LCD subpixel anti-aliasing mode is suitable only for rendering horizontal, unscaled text in 2D. + </constant> + <constant name="FONT_LCD_SUBPIXEL_LAYOUT_NONE" value="0" enum="FontLCDSubpixelLayout"> + Unknown or unsupported subpixel layout, LCD subpixel antialiasing is disabled. + </constant> + <constant name="FONT_LCD_SUBPIXEL_LAYOUT_HRGB" value="1" enum="FontLCDSubpixelLayout"> + Horizontal RGB subpixel layout. + </constant> + <constant name="FONT_LCD_SUBPIXEL_LAYOUT_HBGR" value="2" enum="FontLCDSubpixelLayout"> + Horizontal BGR subpixel layout. + </constant> + <constant name="FONT_LCD_SUBPIXEL_LAYOUT_VRGB" value="3" enum="FontLCDSubpixelLayout"> + Vertical RGB subpixel layout. + </constant> + <constant name="FONT_LCD_SUBPIXEL_LAYOUT_VBGR" value="4" enum="FontLCDSubpixelLayout"> + Vertical BGR subpixel layout. + </constant> + <constant name="FONT_LCD_SUBPIXEL_LAYOUT_MAX" value="5" enum="FontLCDSubpixelLayout"> + </constant> <constant name="DIRECTION_AUTO" value="0" enum="Direction"> Text direction is determined based on contents and current locale. </constant> @@ -1598,6 +1626,10 @@ Break the line between any unconnected graphemes. </constant> <constant name="BREAK_ADAPTIVE" value="8" enum="LineBreakFlag" is_bitfield="true"> + Should be used only in conjunction with [constant BREAK_WORD_BOUND], break the line between any unconnected graphemes, if it's impossible to break it between the words. + </constant> + <constant name="BREAK_TRIM_EDGE_SPACES" value="16" enum="LineBreakFlag" is_bitfield="true"> + Remove edge spaces from the broken line segments. </constant> <constant name="VC_CHARS_BEFORE_SHAPING" value="0" enum="VisibleCharactersBehavior"> Trims text before the shaping. e.g, increasing [member Label.visible_characters] or [member RichTextLabel.visible_characters] value is visually identical to typing the text. @@ -1606,13 +1638,13 @@ Displays glyphs that are mapped to the first [member Label.visible_characters] or [member RichTextLabel.visible_characters] characters from the beginning of the text. </constant> <constant name="VC_GLYPHS_AUTO" value="2" enum="VisibleCharactersBehavior"> - Displays [member Label.percent_visible] or [member RichTextLabel.percent_visible] glyphs, starting from the left or from the right, depending on [member Control.layout_direction] value. + Displays [member Label.visible_ratio] or [member RichTextLabel.visible_ratio] glyphs, starting from the left or from the right, depending on [member Control.layout_direction] value. </constant> <constant name="VC_GLYPHS_LTR" value="3" enum="VisibleCharactersBehavior"> - Displays [member Label.percent_visible] or [member RichTextLabel.percent_visible] glyphs, starting from the left. + Displays [member Label.visible_ratio] or [member RichTextLabel.visible_ratio] glyphs, starting from the left. </constant> <constant name="VC_GLYPHS_RTL" value="4" enum="VisibleCharactersBehavior"> - Displays [member Label.percent_visible] or [member RichTextLabel.percent_visible] glyphs, starting from the right. + Displays [member Label.visible_ratio] or [member RichTextLabel.visible_ratio] glyphs, starting from the right. </constant> <constant name="OVERRUN_NO_TRIMMING" value="0" enum="OverrunBehavior"> No text trimming is performed. @@ -1690,6 +1722,7 @@ </constant> <constant name="HINTING_NORMAL" value="2" enum="Hinting"> Use the default font hinting mode (crisper but less smooth). + [b]Note:[/b] This hinting mode changes both horizontal and vertical glyph metrics. If applied to monospace font, some glyphs might have different width. </constant> <constant name="SUBPIXEL_POSITIONING_DISABLED" value="0" enum="SubpixelPositioning"> Glyph horizontal position is rounded to the whole pixel size, each glyph is rasterized once. @@ -1707,10 +1740,10 @@ Glyph horizontal position is rounded to one quarter of the pixel size, each glyph is rasterized up to four times. </constant> <constant name="SUBPIXEL_POSITIONING_ONE_HALF_MAX_SIZE" value="20" enum="SubpixelPositioning"> - Maximum font size which will use one half of the pixel subpixel positioning in [constants SUBPIXEL_POSITIONING_AUTO] mode. + Maximum font size which will use one half of the pixel subpixel positioning in [constant SUBPIXEL_POSITIONING_AUTO] mode. </constant> <constant name="SUBPIXEL_POSITIONING_ONE_QUARTER_MAX_SIZE" value="16" enum="SubpixelPositioning"> - Maximum font size which will use one quarter of the pixel subpixel positioning in [constants SUBPIXEL_POSITIONING_AUTO] mode. + Maximum font size which will use one quarter of the pixel subpixel positioning in [constant SUBPIXEL_POSITIONING_AUTO] mode. </constant> <constant name="FEATURE_SIMPLE_LAYOUT" value="1" enum="Feature"> TextServer supports simple text layouts. @@ -1790,7 +1823,7 @@ Font have fixed-width characters. </constant> <constant name="STRUCTURED_TEXT_DEFAULT" value="0" enum="StructuredTextParser"> - Use default behavior. Same as [code]STRUCTURED_TEXT_NONE[/code] unless specified otherwise in the control description. + Use default behavior. Same as [constant STRUCTURED_TEXT_NONE] unless specified otherwise in the control description. </constant> <constant name="STRUCTURED_TEXT_URI" value="1" enum="StructuredTextParser"> BiDi override for URI. |