| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <class name="TextServer" inherits="Object" version="4.0">
- <brief_description>
- Interface for the fonts and complex text layouts.
- </brief_description>
- <description>
- [TextServer] is the API backend for managing fonts, and rendering complex text.
- </description>
- <tutorials>
- </tutorials>
- <methods>
- <method name="create_font_memory">
- <return type="RID">
- </return>
- <argument index="0" name="data" type="PackedByteArray">
- </argument>
- <argument index="1" name="type" type="String">
- </argument>
- <argument index="2" name="base_size" type="int" default="16">
- </argument>
- <description>
- 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.
- </description>
- </method>
- <method name="create_font_resource">
- <return type="RID">
- </return>
- <argument index="0" name="filename" type="String">
- </argument>
- <argument index="1" name="base_size" type="int" default="16">
- </argument>
- <description>
- 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.
- </description>
- </method>
- <method name="create_font_system">
- <return type="RID">
- </return>
- <argument index="0" name="name" type="String">
- </argument>
- <argument index="1" name="base_size" type="int" default="16">
- </argument>
- <description>
- 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.
- </description>
- </method>
- <method name="create_shaped_text">
- <return type="RID">
- </return>
- <argument index="0" name="direction" type="int" enum="TextServer.Direction" default="0">
- </argument>
- <argument index="1" name="orientation" type="int" enum="TextServer.Orientation" default="0">
- </argument>
- <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.
- 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.
- </description>
- </method>
- <method name="draw_hex_code_box" qualifiers="const">
- <return type="void">
- </return>
- <argument index="0" name="canvas" type="RID">
- </argument>
- <argument index="1" name="size" type="int">
- </argument>
- <argument index="2" name="pos" type="Vector2">
- </argument>
- <argument index="3" name="index" type="int">
- </argument>
- <argument index="4" name="color" type="Color">
- </argument>
- <description>
- Draws box displaying character hexadecimal code. Used for replacing missing characters.
- </description>
- </method>
- <method name="font_draw_glyph" qualifiers="const">
- <return type="Vector2">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="canvas" type="RID">
- </argument>
- <argument index="2" name="size" type="int">
- </argument>
- <argument index="3" name="pos" type="Vector2">
- </argument>
- <argument index="4" name="index" type="int">
- </argument>
- <argument index="5" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <description>
- 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].
- </description>
- </method>
- <method name="font_draw_glyph_outline" qualifiers="const">
- <return type="Vector2">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="canvas" type="RID">
- </argument>
- <argument index="2" name="size" type="int">
- </argument>
- <argument index="3" name="outline_size" type="int">
- </argument>
- <argument index="4" name="pos" type="Vector2">
- </argument>
- <argument index="5" name="index" type="int">
- </argument>
- <argument index="6" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <description>
- 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].
- </description>
- </method>
- <method name="font_get_antialiased" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <description>
- Returns [code]true[/code], if font anti-aliasing is supported and enabled.
- </description>
- </method>
- <method name="font_get_ascent" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="size" type="int">
- </argument>
- <description>
- Returns the font ascent (number of pixels above the baseline).
- </description>
- </method>
- <method name="font_get_base_size" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <description>
- Returns the default size of the font.
- </description>
- </method>
- <method name="font_get_descent" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="size" type="int">
- </argument>
- <description>
- Returns the font descent (number of pixels below the baseline).
- </description>
- </method>
- <method name="font_get_distance_field_hint" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <description>
- Returns [code]true[/code], if distance field hint is enabled.
- </description>
- </method>
- <method name="font_get_feature_list" qualifiers="const">
- <return type="Dictionary">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <description>
- Returns list of OpenType features supported by font.
- </description>
- </method>
- <method name="font_get_force_autohinter" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <description>
- Returns [code]true[/code], if autohinter is supported and enabled.
- </description>
- </method>
- <method name="font_get_glyph_advance" qualifiers="const">
- <return type="Vector2">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="index" type="int">
- </argument>
- <argument index="2" name="size" type="int">
- </argument>
- <description>
- Returns advance of the glyph.
- </description>
- </method>
- <method name="font_get_glyph_index" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="char" type="int">
- </argument>
- <argument index="2" name="variation_selector" type="int" default="0">
- </argument>
- <description>
- Returns the glyph index of a [code]char[/code], optionally modified by the [code]variation_selector[/code].
- </description>
- </method>
- <method name="font_get_glyph_kerning" qualifiers="const">
- <return type="Vector2">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="index_a" type="int">
- </argument>
- <argument index="2" name="index_b" type="int">
- </argument>
- <argument index="3" name="size" type="int">
- </argument>
- <description>
- Returns a kerning of the pair of glyphs.
- </description>
- </method>
- <method name="font_get_height" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="size" type="int">
- </argument>
- <description>
- Returns the total font height (ascent plus descent) in pixels.
- </description>
- </method>
- <method name="font_get_hinting" qualifiers="const">
- <return type="int" enum="TextServer.Hinting">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <description>
- Returns the font hinting.
- </description>
- </method>
- <method name="font_get_language_support_override">
- <return type="bool">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="language" type="String">
- </argument>
- <description>
- Returns [code]true[/code] if support override is enabled for the [code]language[/code].
- </description>
- </method>
- <method name="font_get_language_support_overrides">
- <return type="PackedStringArray">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <description>
- Returns list of language support overrides.
- </description>
- </method>
- <method name="font_get_oversampling" qualifiers="const">
- <return type="float">
- </return>
- <description>
- Returns the font oversampling factor, shared by all fonts in the TextServer.
- </description>
- </method>
- <method name="font_get_script_support_override">
- <return type="bool">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="script" type="String">
- </argument>
- <description>
- Returns [code]true[/code] if support override is enabled for the [code]script[/code].
- </description>
- </method>
- <method name="font_get_script_support_overrides">
- <return type="PackedStringArray">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <description>
- Returns list of script support overrides.
- </description>
- </method>
- <method name="font_get_supported_chars" qualifiers="const">
- <return type="String">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <description>
- Returns a string containing all the characters available in the font.
- </description>
- </method>
- <method name="font_get_underline_position" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="size" type="int">
- </argument>
- <description>
- Returns underline offset (number of pixels below the baseline).
- </description>
- </method>
- <method name="font_get_underline_thickness" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="size" type="int">
- </argument>
- <description>
- Returns underline thickness in pixels.
- </description>
- </method>
- <method name="font_has_char" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="char" type="int">
- </argument>
- <description>
- Returns [code]true[/code] if [code]char[/code] is available in the font.
- </description>
- </method>
- <method name="font_has_outline" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <description>
- Returns [code]true[/code], if font supports glyph outlines.
- </description>
- </method>
- <method name="font_is_language_supported" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="language" type="String">
- </argument>
- <description>
- Returns [code]true[/code], if font supports given language (ISO 639 code).
- </description>
- </method>
- <method name="font_is_script_supported" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="script" type="String">
- </argument>
- <description>
- Returns [code]true[/code], if font supports given script (ISO 15924 code).
- </description>
- </method>
- <method name="font_remove_language_support_override">
- <return type="void">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="language" type="String">
- </argument>
- <description>
- Remove language support override.
- </description>
- </method>
- <method name="font_remove_script_support_override">
- <return type="void">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="script" type="String">
- </argument>
- <description>
- Removes script support override.
- </description>
- </method>
- <method name="font_set_antialiased">
- <return type="void">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="antialiased" type="bool">
- </argument>
- <description>
- Sets font anti-aliasing.
- </description>
- </method>
- <method name="font_set_distance_field_hint">
- <return type="void">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="distance_field" type="bool">
- </argument>
- <description>
- Sets font distance field hint.
- </description>
- </method>
- <method name="font_set_force_autohinter">
- <return type="void">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="enabeld" type="bool">
- </argument>
- <description>
- Enables/disables default autohinter.
- </description>
- </method>
- <method name="font_set_hinting">
- <return type="void">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="hinting" type="int" enum="TextServer.Hinting">
- </argument>
- <description>
- Sets font hinting.
- </description>
- </method>
- <method name="font_set_language_support_override">
- <return type="void">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="language" type="String">
- </argument>
- <argument index="2" name="supported" type="bool">
- </argument>
- <description>
- Adds override for [method font_is_language_supported].
- </description>
- </method>
- <method name="font_set_oversampling">
- <return type="void">
- </return>
- <argument index="0" name="oversampling" type="float">
- </argument>
- <description>
- Sets oversampling factor, shared by all font in the TextServer.
- </description>
- </method>
- <method name="font_set_script_support_override">
- <return type="void">
- </return>
- <argument index="0" name="font" type="RID">
- </argument>
- <argument index="1" name="script" type="String">
- </argument>
- <argument index="2" name="supported" type="bool">
- </argument>
- <description>
- Adds override for [method font_is_script_supported].
- </description>
- </method>
- <method name="format_number" qualifiers="const">
- <return type="String">
- </return>
- <argument index="0" name="number" type="String">
- </argument>
- <argument index="1" name="language" type="String" default="""">
- </argument>
- <description>
- Converts a number from the Western Arabic (0..9) to the numeral systems used in [code]language[/code].
- </description>
- </method>
- <method name="free_rid">
- <return type="void">
- </return>
- <argument index="0" name="rid" type="RID">
- </argument>
- <description>
- Frees an object created by this [TextServer].
- </description>
- </method>
- <method name="get_hex_code_box_size" qualifiers="const">
- <return type="Vector2">
- </return>
- <argument index="0" name="size" type="int">
- </argument>
- <argument index="1" name="index" type="int">
- </argument>
- <description>
- Returns size of the replacement character (box with character hexadecimal code that is drawn in place of invalid characters).
- </description>
- </method>
- <method name="get_name" qualifiers="const">
- <return type="String">
- </return>
- <description>
- Returns the name of the server interface.
- </description>
- </method>
- <method name="get_system_fonts" qualifiers="const">
- <return type="PackedStringArray">
- </return>
- <description>
- Returns list of available system fonts.
- Note: This method is supported by servers with the [code]FEATURE_FONT_SYSTEM[/code] feature.
- </description>
- </method>
- <method name="has">
- <return type="bool">
- </return>
- <argument index="0" name="rid" type="RID">
- </argument>
- <description>
- Returns [code]true[/code] if [code]rid[/code] is valid resource owned by this text server.
- </description>
- </method>
- <method name="has_feature">
- <return type="bool">
- </return>
- <argument index="0" name="feature" type="int" enum="TextServer.Feature">
- </argument>
- <description>
- Returns [code]true[/code] if the server supports a feature.
- </description>
- </method>
- <method name="is_locale_right_to_left">
- <return type="bool">
- </return>
- <argument index="0" name="locale" type="String">
- </argument>
- <description>
- Returns [code]true[/code] if locale is right-to-left.
- </description>
- </method>
- <method name="load_support_data">
- <return type="bool">
- </return>
- <argument index="0" name="filename" type="String">
- </argument>
- <description>
- 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.
- </description>
- </method>
- <method name="name_to_tag">
- <return type="int">
- </return>
- <argument index="0" name="name" type="String">
- </argument>
- <description>
- Converts readable feature, variation, script or language name to OpenType tag.
- </description>
- </method>
- <method name="parse_number" qualifiers="const">
- <return type="String">
- </return>
- <argument index="0" name="number" type="String">
- </argument>
- <argument index="1" name="language" type="String" default="""">
- </argument>
- <description>
- Converts a number from the numeral systems used in [code]language[/code] to Western Arabic (0..9).
- </description>
- </method>
- <method name="percent_sign" qualifiers="const">
- <return type="String">
- </return>
- <argument index="0" name="language" type="String" default="""">
- </argument>
- <description>
- Returns percent sign used in the [code]language[/code].
- </description>
- </method>
- <method name="shaped_text_add_object">
- <return type="bool">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="key" type="Variant">
- </argument>
- <argument index="2" name="size" type="Vector2">
- </argument>
- <argument index="3" name="inline_align" type="int" enum="VAlign" default="1">
- </argument>
- <argument index="4" name="length" type="int" default="1">
- </argument>
- <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.
- </description>
- </method>
- <method name="shaped_text_add_string">
- <return type="bool">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="text" type="String">
- </argument>
- <argument index="2" name="fonts" type="Array">
- </argument>
- <argument index="3" name="size" type="int">
- </argument>
- <argument index="4" name="opentype_features" type="Dictionary" default="{
- }">
- </argument>
- <argument index="5" name="language" type="String" default="""">
- </argument>
- <description>
- Adds text span and font to draw it to the text buffer.
- </description>
- </method>
- <method name="shaped_text_clear">
- <return type="void">
- </return>
- <argument index="0" name="arg0" type="RID">
- </argument>
- <description>
- Clears text buffer (removes text and inline objects).
- </description>
- </method>
- <method name="shaped_text_draw" qualifiers="const">
- <return type="void">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="canvas" type="RID">
- </argument>
- <argument index="2" name="pos" type="Vector2">
- </argument>
- <argument index="3" name="clip_l" type="float" default="-1">
- </argument>
- <argument index="4" name="clip_r" type="float" default="-1">
- </argument>
- <argument index="5" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <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).
- </description>
- </method>
- <method name="shaped_text_draw_outline" qualifiers="const">
- <return type="void">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="canvas" type="RID">
- </argument>
- <argument index="2" name="pos" type="Vector2">
- </argument>
- <argument index="3" name="clip_l" type="float" default="-1">
- </argument>
- <argument index="4" name="clip_r" type="float" default="-1">
- </argument>
- <argument index="5" name="outline_size" type="int" default="1">
- </argument>
- <argument index="6" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
- </argument>
- <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).
- </description>
- </method>
- <method name="shaped_text_fit_to_width">
- <return type="float">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="width" type="float">
- </argument>
- <argument index="2" name="jst_flags" type="int" default="3">
- </argument>
- <description>
- Adjusts text with to fit to specified width, returns new text width.
- </description>
- </method>
- <method name="shaped_text_get_ascent" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <description>
- 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.
- </description>
- </method>
- <method name="shaped_text_get_carets" qualifiers="const">
- <return type="Dictionary">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="position" type="int">
- </argument>
- <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.
- </description>
- </method>
- <method name="shaped_text_get_descent" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <description>
- 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.
- </description>
- </method>
- <method name="shaped_text_get_direction" qualifiers="const">
- <return type="int" enum="TextServer.Direction">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <description>
- Returns direction of the text.
- </description>
- </method>
- <method name="shaped_text_get_dominant_direciton_in_range" qualifiers="const">
- <return type="int" enum="TextServer.Direction">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="start" type="int">
- </argument>
- <argument index="2" name="end" type="int">
- </argument>
- <description>
- Returns dominant direction of in the range of text.
- </description>
- </method>
- <method name="shaped_text_get_glyphs" qualifiers="const">
- <return type="Array">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <description>
- Returns text glyphs.
- </description>
- </method>
- <method name="shaped_text_get_line_breaks" qualifiers="const">
- <return type="Array">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="width" type="float">
- </argument>
- <argument index="2" name="start" type="int" default="0">
- </argument>
- <argument index="3" name="break_flags" type="int" default="48">
- </argument>
- <description>
- Breaks text to the lines and returns character ranges for each line.
- </description>
- </method>
- <method name="shaped_text_get_line_breaks_adv" qualifiers="const">
- <return type="Array">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="width" type="PackedFloat32Array">
- </argument>
- <argument index="2" name="start" type="int" default="0">
- </argument>
- <argument index="3" name="once" type="bool" default="true">
- </argument>
- <argument index="4" name="break_flags" type="int" default="48">
- </argument>
- <description>
- Breaks text to the lines and columns. Returns character ranges for each segment.
- </description>
- </method>
- <method name="shaped_text_get_object_rect" qualifiers="const">
- <return type="Rect2">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="key" type="Variant">
- </argument>
- <description>
- Returns bounding rectangle of the inline object.
- </description>
- </method>
- <method name="shaped_text_get_objects" qualifiers="const">
- <return type="Array">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <description>
- Returns array of inline objects.
- </description>
- </method>
- <method name="shaped_text_get_orientation" qualifiers="const">
- <return type="int" enum="TextServer.Orientation">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <description>
- Returns text orientation.
- </description>
- </method>
- <method name="shaped_text_get_parent" qualifiers="const">
- <return type="RID">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <description>
- Sets text orientation.
- </description>
- </method>
- <method name="shaped_text_get_preserve_control" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <description>
- Returns [code]true[/code] if text buffer is configured to display control characters.
- </description>
- </method>
- <method name="shaped_text_get_preserve_invalid" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <description>
- 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.
- </description>
- </method>
- <method name="shaped_text_get_range" qualifiers="const">
- <return type="Vector2i">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <description>
- Returns substring buffer character range in the parent buffer.
- </description>
- </method>
- <method name="shaped_text_get_selection" qualifiers="const">
- <return type="Array">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="start" type="int">
- </argument>
- <argument index="2" name="end" type="int">
- </argument>
- <description>
- Returns selection rectangles for the specified character range.
- </description>
- </method>
- <method name="shaped_text_get_size" qualifiers="const">
- <return type="Vector2">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <description>
- Returns size of the text.
- </description>
- </method>
- <method name="shaped_text_get_underline_position" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <description>
- Returns pixel offset of the underline below the baseline.
- </description>
- </method>
- <method name="shaped_text_get_underline_thickness" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <description>
- Returns thickness of the underline.
- </description>
- </method>
- <method name="shaped_text_get_width" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <description>
- Returns width (for horizontal layout) or height (for vertical) of the text.
- </description>
- </method>
- <method name="shaped_text_get_word_breaks" qualifiers="const">
- <return type="Array">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <description>
- Breaks text into words and returns array of character ranges.
- </description>
- </method>
- <method name="shaped_text_hit_test_grapheme" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="coords" type="float">
- </argument>
- <description>
- Returns grapheme index at the specified pixel offset at the baseline, or [code]-1[/code] if none is found.
- </description>
- </method>
- <method name="shaped_text_hit_test_position" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="coords" type="float">
- </argument>
- <description>
- Returns caret character offset at the specified pixel offset at the baseline. This function always returns a valid position.
- </description>
- </method>
- <method name="shaped_text_is_ready" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <description>
- Returns [code]true[/code] if buffer is successfully shaped.
- </description>
- </method>
- <method name="shaped_text_next_grapheme_pos">
- <return type="int">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="pos" type="int">
- </argument>
- <description>
- Returns composite character end position closest to the [code]pos[/code].
- </description>
- </method>
- <method name="shaped_text_prev_grapheme_pos">
- <return type="int">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="pos" type="int">
- </argument>
- <description>
- Returns composite character start position closest to the [code]pos[/code].
- </description>
- </method>
- <method name="shaped_text_resize_object">
- <return type="bool">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="key" type="Variant">
- </argument>
- <argument index="2" name="size" type="Vector2">
- </argument>
- <argument index="3" name="inline_align" type="int" enum="VAlign" default="1">
- </argument>
- <description>
- Sets new size and alignment of embedded object.
- </description>
- </method>
- <method name="shaped_text_set_bidi_override">
- <return type="void">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="override" type="Array">
- </argument>
- <description>
- Overrides BiDi for the structured text.
- Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately.
- </description>
- </method>
- <method name="shaped_text_set_direction">
- <return type="void">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="direction" type="int" enum="TextServer.Direction" default="0">
- </argument>
- <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.
- Note: Direction is ignored if server does not support [code]FEATURE_BIDI_LAYOUT[/code] feature.
- </description>
- </method>
- <method name="shaped_text_set_orientation">
- <return type="void">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="orientation" type="int" enum="TextServer.Orientation" default="0">
- </argument>
- <description>
- Sets desired text orientation.
- Note: Orientation is ignored if server does not support [code]FEATURE_VERTICAL_LAYOUT[/code] feature.
- </description>
- </method>
- <method name="shaped_text_set_preserve_control">
- <return type="void">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="enabled" type="bool">
- </argument>
- <description>
- If set to [code]true[/code] text buffer will display control characters.
- </description>
- </method>
- <method name="shaped_text_set_preserve_invalid">
- <return type="void">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="enabled" type="bool">
- </argument>
- <description>
- If set to [code]true[/code] text buffer will display invalid characters as hexadecimal codes, otherwise nothing is displayed.
- </description>
- </method>
- <method name="shaped_text_shape">
- <return type="bool">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <description>
- 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.
- </description>
- </method>
- <method name="shaped_text_substr" qualifiers="const">
- <return type="RID">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="start" type="int">
- </argument>
- <argument index="2" name="length" type="int">
- </argument>
- <description>
- Returns text buffer for the substring of the text in the [code]shaped[/code] text buffer (including inline objects).
- </description>
- </method>
- <method name="shaped_text_tab_align">
- <return type="float">
- </return>
- <argument index="0" name="shaped" type="RID">
- </argument>
- <argument index="1" name="tab_stops" type="PackedFloat32Array">
- </argument>
- <description>
- Aligns shaped text to the given tab-stops.
- </description>
- </method>
- <method name="tag_to_name">
- <return type="String">
- </return>
- <argument index="0" name="tag" type="int">
- </argument>
- <description>
- Converts OpenType tag to readable feature, variation, script or language name.
- </description>
- </method>
- </methods>
- <constants>
- <constant name="DIRECTION_AUTO" value="0" enum="Direction">
- Text direction is determined based on contents and current locale.
- </constant>
- <constant name="DIRECTION_LTR" value="1" enum="Direction">
- Text is written from left to right.
- </constant>
- <constant name="DIRECTION_RTL" value="2" enum="Direction">
- Text is written from right to left.
- </constant>
- <constant name="ORIENTATION_HORIZONTAL" value="0" enum="Orientation">
- Text is written horizontally.
- </constant>
- <constant name="ORIENTATION_VERTICAL" value="1" enum="Orientation">
- Left to right text is written vertically from top to bottom.
- Right to left text is written vertically from bottom to top.
- </constant>
- <constant name="JUSTIFICATION_NONE" value="0" enum="JustificationFlag">
- Do not justify text.
- </constant>
- <constant name="JUSTIFICATION_KASHIDA" value="1" enum="JustificationFlag">
- Justify text by adding and removing kashidas.
- </constant>
- <constant name="JUSTIFICATION_WORD_BOUND" value="2" enum="JustificationFlag">
- Justify text by changing width of the spaces between the words.
- </constant>
- <constant name="JUSTIFICATION_TRIM_EDGE_SPACES" value="4" enum="JustificationFlag">
- Remove trailing and leading spaces from the justified text.
- </constant>
- <constant name="JUSTIFICATION_AFTER_LAST_TAB" value="8" enum="JustificationFlag">
- Only apply justification to the part of the text after the last tab.
- </constant>
- <constant name="BREAK_NONE" value="0" enum="LineBreakFlag">
- Do not break the line.
- </constant>
- <constant name="BREAK_MANDATORY" value="16" enum="LineBreakFlag">
- Break the line at the line mandatory break characters (e.g. [code]"\n"[/code]).
- </constant>
- <constant name="BREAK_WORD_BOUND" value="32" enum="LineBreakFlag">
- Break the line between the words.
- </constant>
- <constant name="BREAK_GRAPHEME_BOUND" value="64" enum="LineBreakFlag">
- Break the line between any unconnected graphemes.
- </constant>
- <constant name="GRAPHEME_IS_RTL" value="2" enum="GraphemeFlag">
- Grapheme is part of right-to-left or bottom-to-top run.
- </constant>
- <constant name="GRAPHEME_IS_VIRTUAL" value="4" enum="GraphemeFlag">
- Grapheme is not part of source text, it was added by justification process.
- </constant>
- <constant name="GRAPHEME_IS_SPACE" value="8" enum="GraphemeFlag">
- Grapheme is whitespace.
- </constant>
- <constant name="GRAPHEME_IS_BREAK_HARD" value="16" enum="GraphemeFlag">
- Grapheme is mandatory break point (e.g. [code]"\n"[/code]).
- </constant>
- <constant name="GRAPHEME_IS_BREAK_SOFT" value="32" enum="GraphemeFlag">
- Grapheme is optional break point (e.g. space).
- </constant>
- <constant name="GRAPHEME_IS_TAB" value="64" enum="GraphemeFlag">
- Grapheme is the tabulation character.
- </constant>
- <constant name="GRAPHEME_IS_ELONGATION" value="128" enum="GraphemeFlag">
- Grapheme is kashida.
- </constant>
- <constant name="HINTING_NONE" value="0" enum="Hinting">
- Disables font hinting (smoother but less crisp).
- </constant>
- <constant name="HINTING_LIGHT" value="1" enum="Hinting">
- Use the light font hinting mode.
- </constant>
- <constant name="HINTING_NORMAL" value="2" enum="Hinting">
- Use the default font hinting mode (crisper but less smooth).
- </constant>
- <constant name="FEATURE_BIDI_LAYOUT" value="1" enum="Feature">
- TextServer supports bidirectional layouts.
- </constant>
- <constant name="FEATURE_VERTICAL_LAYOUT" value="2" enum="Feature">
- TextServer supports vertical layouts.
- </constant>
- <constant name="FEATURE_SHAPING" value="4" enum="Feature">
- TextServer supports complex text shaping.
- </constant>
- <constant name="FEATURE_KASHIDA_JUSTIFICATION" value="8" enum="Feature">
- TextServer supports justification using kashidas.
- </constant>
- <constant name="FEATURE_BREAK_ITERATORS" value="16" enum="Feature">
- TextServer supports complex line/word breaking rules (e.g. dictionary based).
- </constant>
- <constant name="FEATURE_FONT_SYSTEM" value="32" enum="Feature">
- TextServer supports loading system fonts.
- </constant>
- <constant name="FEATURE_USE_SUPPORT_DATA" value="64" enum="Feature">
- TextServer require external data file for some features.
- </constant>
- </constants>
- </class>
|