|
@@ -0,0 +1,1162 @@
|
|
|
+:github_url: hide
|
|
|
+
|
|
|
+.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
|
|
|
+.. DO NOT EDIT THIS FILE, but the TextServer.xml source instead.
|
|
|
+.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
|
+
|
|
|
+.. _class_TextServer:
|
|
|
+
|
|
|
+TextServer
|
|
|
+==========
|
|
|
+
|
|
|
+**Inherits:** :ref:`Object<class_Object>`
|
|
|
+
|
|
|
+Interface for the fonts and complex text layouts.
|
|
|
+
|
|
|
+Description
|
|
|
+-----------
|
|
|
+
|
|
|
+``TextServer`` is the API backend for managing fonts, and rendering complex text.
|
|
|
+
|
|
|
+Methods
|
|
|
+-------
|
|
|
+
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`RID<class_RID>` | :ref:`create_font_memory<class_TextServer_method_create_font_memory>` **(** :ref:`PackedByteArray<class_PackedByteArray>` data, :ref:`String<class_String>` type, :ref:`int<class_int>` base_size=16 **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`RID<class_RID>` | :ref:`create_font_resource<class_TextServer_method_create_font_resource>` **(** :ref:`String<class_String>` filename, :ref:`int<class_int>` base_size=16 **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`RID<class_RID>` | :ref:`create_font_system<class_TextServer_method_create_font_system>` **(** :ref:`String<class_String>` name, :ref:`int<class_int>` base_size=16 **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`RID<class_RID>` | :ref:`create_shaped_text<class_TextServer_method_create_shaped_text>` **(** :ref:`Direction<enum_TextServer_Direction>` direction=0, :ref:`Orientation<enum_TextServer_Orientation>` orientation=0 **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| void | :ref:`draw_hex_code_box<class_TextServer_method_draw_hex_code_box>` **(** :ref:`RID<class_RID>` canvas, :ref:`int<class_int>` size, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` index, :ref:`Color<class_Color>` color **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`Vector2<class_Vector2>` | :ref:`font_draw_glyph<class_TextServer_method_font_draw_glyph>` **(** :ref:`RID<class_RID>` font, :ref:`RID<class_RID>` canvas, :ref:`int<class_int>` size, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` index, :ref:`Color<class_Color>` color=Color( 1, 1, 1, 1 ) **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`Vector2<class_Vector2>` | :ref:`font_draw_glyph_outline<class_TextServer_method_font_draw_glyph_outline>` **(** :ref:`RID<class_RID>` font, :ref:`RID<class_RID>` canvas, :ref:`int<class_int>` size, :ref:`int<class_int>` outline_size, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` index, :ref:`Color<class_Color>` color=Color( 1, 1, 1, 1 ) **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`bool<class_bool>` | :ref:`font_get_antialiased<class_TextServer_method_font_get_antialiased>` **(** :ref:`RID<class_RID>` font **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`float<class_float>` | :ref:`font_get_ascent<class_TextServer_method_font_get_ascent>` **(** :ref:`RID<class_RID>` font, :ref:`int<class_int>` size **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`float<class_float>` | :ref:`font_get_base_size<class_TextServer_method_font_get_base_size>` **(** :ref:`RID<class_RID>` font **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`float<class_float>` | :ref:`font_get_descent<class_TextServer_method_font_get_descent>` **(** :ref:`RID<class_RID>` font, :ref:`int<class_int>` size **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`bool<class_bool>` | :ref:`font_get_distance_field_hint<class_TextServer_method_font_get_distance_field_hint>` **(** :ref:`RID<class_RID>` font **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`bool<class_bool>` | :ref:`font_get_force_autohinter<class_TextServer_method_font_get_force_autohinter>` **(** :ref:`RID<class_RID>` font **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`Vector2<class_Vector2>` | :ref:`font_get_glyph_advance<class_TextServer_method_font_get_glyph_advance>` **(** :ref:`RID<class_RID>` font, :ref:`int<class_int>` index, :ref:`int<class_int>` size **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`int<class_int>` | :ref:`font_get_glyph_index<class_TextServer_method_font_get_glyph_index>` **(** :ref:`RID<class_RID>` font, :ref:`int<class_int>` char, :ref:`int<class_int>` variation_selector=0 **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`Vector2<class_Vector2>` | :ref:`font_get_glyph_kerning<class_TextServer_method_font_get_glyph_kerning>` **(** :ref:`RID<class_RID>` font, :ref:`int<class_int>` index_a, :ref:`int<class_int>` index_b, :ref:`int<class_int>` size **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`float<class_float>` | :ref:`font_get_height<class_TextServer_method_font_get_height>` **(** :ref:`RID<class_RID>` font, :ref:`int<class_int>` size **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`Hinting<enum_TextServer_Hinting>` | :ref:`font_get_hinting<class_TextServer_method_font_get_hinting>` **(** :ref:`RID<class_RID>` font **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`bool<class_bool>` | :ref:`font_get_language_support_override<class_TextServer_method_font_get_language_support_override>` **(** :ref:`RID<class_RID>` font, :ref:`String<class_String>` language **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`font_get_language_support_overrides<class_TextServer_method_font_get_language_support_overrides>` **(** :ref:`RID<class_RID>` font **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`float<class_float>` | :ref:`font_get_oversampling<class_TextServer_method_font_get_oversampling>` **(** **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`bool<class_bool>` | :ref:`font_get_script_support_override<class_TextServer_method_font_get_script_support_override>` **(** :ref:`RID<class_RID>` font, :ref:`String<class_String>` script **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`font_get_script_support_overrides<class_TextServer_method_font_get_script_support_overrides>` **(** :ref:`RID<class_RID>` font **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`String<class_String>` | :ref:`font_get_supported_chars<class_TextServer_method_font_get_supported_chars>` **(** :ref:`RID<class_RID>` font **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`float<class_float>` | :ref:`font_get_underline_position<class_TextServer_method_font_get_underline_position>` **(** :ref:`RID<class_RID>` font, :ref:`int<class_int>` size **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`float<class_float>` | :ref:`font_get_underline_thickness<class_TextServer_method_font_get_underline_thickness>` **(** :ref:`RID<class_RID>` font, :ref:`int<class_int>` size **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`String<class_String>` | :ref:`font_get_variation_list<class_TextServer_method_font_get_variation_list>` **(** :ref:`RID<class_RID>` fonte **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`String<class_String>` | :ref:`font_get_variations<class_TextServer_method_font_get_variations>` **(** :ref:`RID<class_RID>` font **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`bool<class_bool>` | :ref:`font_has_char<class_TextServer_method_font_has_char>` **(** :ref:`RID<class_RID>` font, :ref:`int<class_int>` char **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`bool<class_bool>` | :ref:`font_has_outline<class_TextServer_method_font_has_outline>` **(** :ref:`RID<class_RID>` font **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`bool<class_bool>` | :ref:`font_is_language_supported<class_TextServer_method_font_is_language_supported>` **(** :ref:`RID<class_RID>` font, :ref:`String<class_String>` language **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`bool<class_bool>` | :ref:`font_is_script_supported<class_TextServer_method_font_is_script_supported>` **(** :ref:`RID<class_RID>` font, :ref:`String<class_String>` script **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| void | :ref:`font_remove_language_support_override<class_TextServer_method_font_remove_language_support_override>` **(** :ref:`RID<class_RID>` font, :ref:`String<class_String>` language **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| void | :ref:`font_remove_script_support_override<class_TextServer_method_font_remove_script_support_override>` **(** :ref:`RID<class_RID>` font, :ref:`String<class_String>` script **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| void | :ref:`font_set_antialiased<class_TextServer_method_font_set_antialiased>` **(** :ref:`RID<class_RID>` font, :ref:`bool<class_bool>` antialiased **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| void | :ref:`font_set_distance_field_hint<class_TextServer_method_font_set_distance_field_hint>` **(** :ref:`RID<class_RID>` font, :ref:`bool<class_bool>` distance_field **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| void | :ref:`font_set_force_autohinter<class_TextServer_method_font_set_force_autohinter>` **(** :ref:`RID<class_RID>` font, :ref:`bool<class_bool>` enabeld **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| void | :ref:`font_set_hinting<class_TextServer_method_font_set_hinting>` **(** :ref:`RID<class_RID>` font, :ref:`Hinting<enum_TextServer_Hinting>` hinting **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| void | :ref:`font_set_language_support_override<class_TextServer_method_font_set_language_support_override>` **(** :ref:`RID<class_RID>` font, :ref:`String<class_String>` language, :ref:`bool<class_bool>` supported **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| void | :ref:`font_set_oversampling<class_TextServer_method_font_set_oversampling>` **(** :ref:`float<class_float>` oversampling **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| void | :ref:`font_set_script_support_override<class_TextServer_method_font_set_script_support_override>` **(** :ref:`RID<class_RID>` font, :ref:`String<class_String>` script, :ref:`bool<class_bool>` supported **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| void | :ref:`font_set_variations<class_TextServer_method_font_set_variations>` **(** :ref:`RID<class_RID>` font, :ref:`String<class_String>` value **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`String<class_String>` | :ref:`format_number<class_TextServer_method_format_number>` **(** :ref:`String<class_String>` number, :ref:`String<class_String>` language="" **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| void | :ref:`free_rid<class_TextServer_method_free_rid>` **(** :ref:`RID<class_RID>` rid **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`Vector2<class_Vector2>` | :ref:`get_hex_code_box_size<class_TextServer_method_get_hex_code_box_size>` **(** :ref:`int<class_int>` size, :ref:`int<class_int>` index **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`String<class_String>` | :ref:`get_name<class_TextServer_method_get_name>` **(** **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_system_fonts<class_TextServer_method_get_system_fonts>` **(** **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`bool<class_bool>` | :ref:`has<class_TextServer_method_has>` **(** :ref:`RID<class_RID>` rid **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`bool<class_bool>` | :ref:`has_feature<class_TextServer_method_has_feature>` **(** :ref:`Feature<enum_TextServer_Feature>` feature **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`bool<class_bool>` | :ref:`is_locale_right_to_left<class_TextServer_method_is_locale_right_to_left>` **(** :ref:`String<class_String>` locale **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`bool<class_bool>` | :ref:`load_support_data<class_TextServer_method_load_support_data>` **(** :ref:`String<class_String>` filename **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`String<class_String>` | :ref:`parse_number<class_TextServer_method_parse_number>` **(** :ref:`String<class_String>` number, :ref:`String<class_String>` language="" **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`String<class_String>` | :ref:`percent_sign<class_TextServer_method_percent_sign>` **(** :ref:`String<class_String>` language="" **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`bool<class_bool>` | :ref:`shaped_text_add_object<class_TextServer_method_shaped_text_add_object>` **(** :ref:`RID<class_RID>` shaped, :ref:`Variant<class_Variant>` key, :ref:`Vector2<class_Vector2>` size, :ref:`VAlign<enum_@GlobalScope_VAlign>` inline_align=1 **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`bool<class_bool>` | :ref:`shaped_text_add_string<class_TextServer_method_shaped_text_add_string>` **(** :ref:`RID<class_RID>` shaped, :ref:`String<class_String>` text, :ref:`Array<class_Array>` fonts, :ref:`int<class_int>` size, :ref:`String<class_String>` opentype_features="", :ref:`String<class_String>` language="" **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| void | :ref:`shaped_text_clear<class_TextServer_method_shaped_text_clear>` **(** :ref:`RID<class_RID>` arg0 **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| void | :ref:`shaped_text_draw<class_TextServer_method_shaped_text_draw>` **(** :ref:`RID<class_RID>` shaped, :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`float<class_float>` clip_w=-1, :ref:`Color<class_Color>` color=Color( 1, 1, 1, 1 ) **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| void | :ref:`shaped_text_draw_outline<class_TextServer_method_shaped_text_draw_outline>` **(** :ref:`RID<class_RID>` shaped, :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`float<class_float>` clip_w=-1, :ref:`int<class_int>` outline_size=1, :ref:`Color<class_Color>` color=Color( 1, 1, 1, 1 ) **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`float<class_float>` | :ref:`shaped_text_fit_to_width<class_TextServer_method_shaped_text_fit_to_width>` **(** :ref:`RID<class_RID>` shaped, :ref:`float<class_float>` width, :ref:`int<class_int>` jst_flags=48 **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`float<class_float>` | :ref:`shaped_text_get_ascent<class_TextServer_method_shaped_text_get_ascent>` **(** :ref:`RID<class_RID>` shaped **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`Dictionary<class_Dictionary>` | :ref:`shaped_text_get_carets<class_TextServer_method_shaped_text_get_carets>` **(** :ref:`RID<class_RID>` shaped, :ref:`int<class_int>` position **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`float<class_float>` | :ref:`shaped_text_get_descent<class_TextServer_method_shaped_text_get_descent>` **(** :ref:`RID<class_RID>` shaped **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`Direction<enum_TextServer_Direction>` | :ref:`shaped_text_get_direction<class_TextServer_method_shaped_text_get_direction>` **(** :ref:`RID<class_RID>` shaped **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`Direction<enum_TextServer_Direction>` | :ref:`shaped_text_get_dominant_direciton_in_range<class_TextServer_method_shaped_text_get_dominant_direciton_in_range>` **(** :ref:`RID<class_RID>` shaped, :ref:`int<class_int>` start, :ref:`int<class_int>` end **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`Array<class_Array>` | :ref:`shaped_text_get_glyphs<class_TextServer_method_shaped_text_get_glyphs>` **(** :ref:`RID<class_RID>` shaped **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`Array<class_Array>` | :ref:`shaped_text_get_line_breaks<class_TextServer_method_shaped_text_get_line_breaks>` **(** :ref:`RID<class_RID>` shaped, :ref:`float<class_float>` width, :ref:`int<class_int>` start=0, :ref:`int<class_int>` break_flags=3 **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`Array<class_Array>` | :ref:`shaped_text_get_line_breaks_adv<class_TextServer_method_shaped_text_get_line_breaks_adv>` **(** :ref:`RID<class_RID>` shaped, :ref:`PackedFloat32Array<class_PackedFloat32Array>` width, :ref:`int<class_int>` start=0, :ref:`bool<class_bool>` once=true, :ref:`int<class_int>` break_flags=3 **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`Rect2<class_Rect2>` | :ref:`shaped_text_get_object_rect<class_TextServer_method_shaped_text_get_object_rect>` **(** :ref:`RID<class_RID>` shaped, :ref:`Variant<class_Variant>` key **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`Array<class_Array>` | :ref:`shaped_text_get_objects<class_TextServer_method_shaped_text_get_objects>` **(** :ref:`RID<class_RID>` shaped **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`Orientation<enum_TextServer_Orientation>` | :ref:`shaped_text_get_orientation<class_TextServer_method_shaped_text_get_orientation>` **(** :ref:`RID<class_RID>` shaped **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`RID<class_RID>` | :ref:`shaped_text_get_parent<class_TextServer_method_shaped_text_get_parent>` **(** :ref:`RID<class_RID>` shaped **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`bool<class_bool>` | :ref:`shaped_text_get_preserve_control<class_TextServer_method_shaped_text_get_preserve_control>` **(** :ref:`RID<class_RID>` shaped **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`bool<class_bool>` | :ref:`shaped_text_get_preserve_invalid<class_TextServer_method_shaped_text_get_preserve_invalid>` **(** :ref:`RID<class_RID>` shaped **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`Vector2i<class_Vector2i>` | :ref:`shaped_text_get_range<class_TextServer_method_shaped_text_get_range>` **(** :ref:`RID<class_RID>` shaped **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`Array<class_Array>` | :ref:`shaped_text_get_selection<class_TextServer_method_shaped_text_get_selection>` **(** :ref:`RID<class_RID>` shaped, :ref:`int<class_int>` start, :ref:`int<class_int>` end **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`Vector2<class_Vector2>` | :ref:`shaped_text_get_size<class_TextServer_method_shaped_text_get_size>` **(** :ref:`RID<class_RID>` shaped **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`float<class_float>` | :ref:`shaped_text_get_underline_position<class_TextServer_method_shaped_text_get_underline_position>` **(** :ref:`RID<class_RID>` shaped **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`float<class_float>` | :ref:`shaped_text_get_underline_thickness<class_TextServer_method_shaped_text_get_underline_thickness>` **(** :ref:`RID<class_RID>` shaped **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`float<class_float>` | :ref:`shaped_text_get_width<class_TextServer_method_shaped_text_get_width>` **(** :ref:`RID<class_RID>` shaped **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`Array<class_Array>` | :ref:`shaped_text_get_word_breaks<class_TextServer_method_shaped_text_get_word_breaks>` **(** :ref:`RID<class_RID>` shaped **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`int<class_int>` | :ref:`shaped_text_hit_test_grapheme<class_TextServer_method_shaped_text_hit_test_grapheme>` **(** :ref:`RID<class_RID>` shaped, :ref:`float<class_float>` coords **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`int<class_int>` | :ref:`shaped_text_hit_test_position<class_TextServer_method_shaped_text_hit_test_position>` **(** :ref:`RID<class_RID>` shaped, :ref:`float<class_float>` coords **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`bool<class_bool>` | :ref:`shaped_text_is_ready<class_TextServer_method_shaped_text_is_ready>` **(** :ref:`RID<class_RID>` shaped **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`int<class_int>` | :ref:`shaped_text_next_grapheme_pos<class_TextServer_method_shaped_text_next_grapheme_pos>` **(** :ref:`RID<class_RID>` shaped, :ref:`int<class_int>` pos **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`int<class_int>` | :ref:`shaped_text_prev_grapheme_pos<class_TextServer_method_shaped_text_prev_grapheme_pos>` **(** :ref:`RID<class_RID>` shaped, :ref:`int<class_int>` pos **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| void | :ref:`shaped_text_set_bidi_override<class_TextServer_method_shaped_text_set_bidi_override>` **(** :ref:`RID<class_RID>` shaped, :ref:`Array<class_Array>` override **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| void | :ref:`shaped_text_set_direction<class_TextServer_method_shaped_text_set_direction>` **(** :ref:`RID<class_RID>` shaped, :ref:`Direction<enum_TextServer_Direction>` direction=0 **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| void | :ref:`shaped_text_set_orientation<class_TextServer_method_shaped_text_set_orientation>` **(** :ref:`RID<class_RID>` shaped, :ref:`Orientation<enum_TextServer_Orientation>` orientation=0 **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| void | :ref:`shaped_text_set_preserve_control<class_TextServer_method_shaped_text_set_preserve_control>` **(** :ref:`RID<class_RID>` shaped, :ref:`bool<class_bool>` enabled **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| void | :ref:`shaped_text_set_preserve_invalid<class_TextServer_method_shaped_text_set_preserve_invalid>` **(** :ref:`RID<class_RID>` shaped, :ref:`bool<class_bool>` enabled **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`bool<class_bool>` | :ref:`shaped_text_shape<class_TextServer_method_shaped_text_shape>` **(** :ref:`RID<class_RID>` shaped **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`RID<class_RID>` | :ref:`shaped_text_substr<class_TextServer_method_shaped_text_substr>` **(** :ref:`RID<class_RID>` shaped, :ref:`int<class_int>` start, :ref:`int<class_int>` length **)** |const| |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+| :ref:`float<class_float>` | :ref:`shaped_text_tab_align<class_TextServer_method_shaped_text_tab_align>` **(** :ref:`RID<class_RID>` shaped, :ref:`PackedFloat32Array<class_PackedFloat32Array>` tab_stops **)** |
|
|
|
++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+
|
|
|
+Enumerations
|
|
|
+------------
|
|
|
+
|
|
|
+.. _enum_TextServer_Direction:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_DIRECTION_AUTO:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_DIRECTION_LTR:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_DIRECTION_RTL:
|
|
|
+
|
|
|
+enum **Direction**:
|
|
|
+
|
|
|
+- **DIRECTION_AUTO** = **0** --- Text direction is determined based on contents and current locale.
|
|
|
+
|
|
|
+- **DIRECTION_LTR** = **1** --- Text is written from left to right.
|
|
|
+
|
|
|
+- **DIRECTION_RTL** = **2** --- Text is written from right to left.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _enum_TextServer_Orientation:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_ORIENTATION_HORIZONTAL:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_ORIENTATION_VERTICAL:
|
|
|
+
|
|
|
+enum **Orientation**:
|
|
|
+
|
|
|
+- **ORIENTATION_HORIZONTAL** = **0** --- Text is written horizontally.
|
|
|
+
|
|
|
+- **ORIENTATION_VERTICAL** = **1** --- Left to right text is written vertically from top to bottom.
|
|
|
+
|
|
|
+Right to left text is written vertically from bottom to top.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _enum_TextServer_JustificationFlag:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_JUSTIFICATION_NONE:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_JUSTIFICATION_KASHIDA:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_JUSTIFICATION_WORD_BOUND:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_JUSTIFICATION_TRIM_EDGE_SPACES:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_JUSTIFICATION_AFTER_LAST_TAB:
|
|
|
+
|
|
|
+enum **JustificationFlag**:
|
|
|
+
|
|
|
+- **JUSTIFICATION_NONE** = **0** --- Do not justify text.
|
|
|
+
|
|
|
+- **JUSTIFICATION_KASHIDA** = **16** --- Justify text by adding and removing kashidas.
|
|
|
+
|
|
|
+- **JUSTIFICATION_WORD_BOUND** = **32** --- Justify text by changing width of the spaces between the words.
|
|
|
+
|
|
|
+- **JUSTIFICATION_TRIM_EDGE_SPACES** = **64** --- Remove trailing and leading spaces from the justified text.
|
|
|
+
|
|
|
+- **JUSTIFICATION_AFTER_LAST_TAB** = **128** --- Only apply justification to the part of the text after the last tab.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _enum_TextServer_LineBreakFlag:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_BREAK_NONE:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_BREAK_MANDATORY:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_BREAK_WORD_BOUND:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_BREAK_GRAPHEME_BOUND:
|
|
|
+
|
|
|
+enum **LineBreakFlag**:
|
|
|
+
|
|
|
+- **BREAK_NONE** = **0** --- Do not break the line.
|
|
|
+
|
|
|
+- **BREAK_MANDATORY** = **1** --- Break the line at the line mandatory break characters (e.g. ``"\n"``).
|
|
|
+
|
|
|
+- **BREAK_WORD_BOUND** = **2** --- Break the line between the words.
|
|
|
+
|
|
|
+- **BREAK_GRAPHEME_BOUND** = **4** --- Break the line between any unconnected graphemes.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _enum_TextServer_GraphemeFlag:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_GRAPHEME_IS_RTL:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_GRAPHEME_IS_VIRTUAL:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_GRAPHEME_IS_SPACE:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_GRAPHEME_IS_BREAK_HARD:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_GRAPHEME_IS_BREAK_SOFT:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_GRAPHEME_IS_TAB:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_GRAPHEME_IS_ELONGATION:
|
|
|
+
|
|
|
+enum **GraphemeFlag**:
|
|
|
+
|
|
|
+- **GRAPHEME_IS_RTL** = **2** --- Grapheme is part of right-to-left or bottom-to-top run.
|
|
|
+
|
|
|
+- **GRAPHEME_IS_VIRTUAL** = **4** --- Grapheme is not part of source text, it was added by justification process.
|
|
|
+
|
|
|
+- **GRAPHEME_IS_SPACE** = **8** --- Grapheme is whitespace.
|
|
|
+
|
|
|
+- **GRAPHEME_IS_BREAK_HARD** = **16** --- Grapheme is mandatory break point (e.g. ``"\n"``).
|
|
|
+
|
|
|
+- **GRAPHEME_IS_BREAK_SOFT** = **32** --- Grapheme is optional break point (e.g. space).
|
|
|
+
|
|
|
+- **GRAPHEME_IS_TAB** = **64** --- Grapheme is the tabulation character.
|
|
|
+
|
|
|
+- **GRAPHEME_IS_ELONGATION** = **128** --- Grapheme is kashida.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _enum_TextServer_Hinting:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_HINTING_NONE:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_HINTING_LIGHT:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_HINTING_NORMAL:
|
|
|
+
|
|
|
+enum **Hinting**:
|
|
|
+
|
|
|
+- **HINTING_NONE** = **0** --- Disables font hinting (smoother but less crisp).
|
|
|
+
|
|
|
+- **HINTING_LIGHT** = **1** --- Use the light font hinting mode.
|
|
|
+
|
|
|
+- **HINTING_NORMAL** = **2** --- Use the default font hinting mode (crisper but less smooth).
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _enum_TextServer_Feature:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_FEATURE_BIDI_LAYOUT:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_FEATURE_VERTICAL_LAYOUT:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_FEATURE_SHAPING:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_FEATURE_KASHIDA_JUSTIFICATION:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_FEATURE_BREAK_ITERATORS:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_FEATURE_FONT_SYSTEM:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_FEATURE_FONT_VARIABLE:
|
|
|
+
|
|
|
+.. _class_TextServer_constant_FEATURE_USE_SUPPORT_DATA:
|
|
|
+
|
|
|
+enum **Feature**:
|
|
|
+
|
|
|
+- **FEATURE_BIDI_LAYOUT** = **1** --- TextServer supports bidirectional layouts.
|
|
|
+
|
|
|
+- **FEATURE_VERTICAL_LAYOUT** = **2** --- TextServer supports vertical layouts.
|
|
|
+
|
|
|
+- **FEATURE_SHAPING** = **4** --- TextServer supports complex text shaping.
|
|
|
+
|
|
|
+- **FEATURE_KASHIDA_JUSTIFICATION** = **8** --- TextServer supports justification using kashidas.
|
|
|
+
|
|
|
+- **FEATURE_BREAK_ITERATORS** = **16** --- TextServer supports complex line/word breaking rules (e.g. dictionary based).
|
|
|
+
|
|
|
+- **FEATURE_FONT_SYSTEM** = **32** --- TextServer supports loading system fonts.
|
|
|
+
|
|
|
+- **FEATURE_FONT_VARIABLE** = **64**
|
|
|
+
|
|
|
+- **FEATURE_USE_SUPPORT_DATA** = **128**
|
|
|
+
|
|
|
+Method Descriptions
|
|
|
+-------------------
|
|
|
+
|
|
|
+.. _class_TextServer_method_create_font_memory:
|
|
|
+
|
|
|
+- :ref:`RID<class_RID>` **create_font_memory** **(** :ref:`PackedByteArray<class_PackedByteArray>` data, :ref:`String<class_String>` type, :ref:`int<class_int>` base_size=16 **)**
|
|
|
+
|
|
|
+Creates new font from the data in memory. To free the resulting font, use :ref:`free_rid<class_TextServer_method_free_rid>` method.
|
|
|
+
|
|
|
+Note: For non-scalable fonts ``base_size`` is ignored, use :ref:`font_get_base_size<class_TextServer_method_font_get_base_size>` to check actual font size.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_create_font_resource:
|
|
|
+
|
|
|
+- :ref:`RID<class_RID>` **create_font_resource** **(** :ref:`String<class_String>` filename, :ref:`int<class_int>` base_size=16 **)**
|
|
|
+
|
|
|
+Creates new font from the file. To free the resulting font, use :ref:`free_rid<class_TextServer_method_free_rid>` method.
|
|
|
+
|
|
|
+Note: For non-scalable fonts ``base_size`` is ignored, use :ref:`font_get_base_size<class_TextServer_method_font_get_base_size>` to check actual font size.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_create_font_system:
|
|
|
+
|
|
|
+- :ref:`RID<class_RID>` **create_font_system** **(** :ref:`String<class_String>` name, :ref:`int<class_int>` base_size=16 **)**
|
|
|
+
|
|
|
+Creates new font from the system font. To free the resulting font, use :ref:`free_rid<class_TextServer_method_free_rid>` method.
|
|
|
+
|
|
|
+Note: This method is supported by servers with the ``FEATURE_FONT_SYSTEM`` feature.
|
|
|
+
|
|
|
+Note: For non-scalable fonts ``base_size`` is ignored, use :ref:`font_get_base_size<class_TextServer_method_font_get_base_size>` to check actual font size.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_create_shaped_text:
|
|
|
+
|
|
|
+- :ref:`RID<class_RID>` **create_shaped_text** **(** :ref:`Direction<enum_TextServer_Direction>` direction=0, :ref:`Orientation<enum_TextServer_Orientation>` orientation=0 **)**
|
|
|
+
|
|
|
+Creates new buffer for complex text layout, with the given ``direction`` and ``orientation``. To free the resulting buffer, use :ref:`free_rid<class_TextServer_method_free_rid>` method.
|
|
|
+
|
|
|
+Note: Direction is ignored if server does not support ``FEATURE_BIDI_LAYOUT`` feature.
|
|
|
+
|
|
|
+Note: Orientation is ignored if server does not support ``FEATURE_VERTICAL_LAYOUT`` feature.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_draw_hex_code_box:
|
|
|
+
|
|
|
+- void **draw_hex_code_box** **(** :ref:`RID<class_RID>` canvas, :ref:`int<class_int>` size, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` index, :ref:`Color<class_Color>` color **)** |const|
|
|
|
+
|
|
|
+Draws box displaying character hexadecimal code. Used for replacing missing characters.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_draw_glyph:
|
|
|
+
|
|
|
+- :ref:`Vector2<class_Vector2>` **font_draw_glyph** **(** :ref:`RID<class_RID>` font, :ref:`RID<class_RID>` canvas, :ref:`int<class_int>` size, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` index, :ref:`Color<class_Color>` color=Color( 1, 1, 1, 1 ) **)** |const|
|
|
|
+
|
|
|
+Draws single glyph into a canvas item at the position, using ``font`` at the size ``size``.
|
|
|
+
|
|
|
+Note: Glyph index is specific to the font, use glyphs indices returned by :ref:`shaped_text_get_glyphs<class_TextServer_method_shaped_text_get_glyphs>` or :ref:`font_get_glyph_index<class_TextServer_method_font_get_glyph_index>`.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_draw_glyph_outline:
|
|
|
+
|
|
|
+- :ref:`Vector2<class_Vector2>` **font_draw_glyph_outline** **(** :ref:`RID<class_RID>` font, :ref:`RID<class_RID>` canvas, :ref:`int<class_int>` size, :ref:`int<class_int>` outline_size, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` index, :ref:`Color<class_Color>` color=Color( 1, 1, 1, 1 ) **)** |const|
|
|
|
+
|
|
|
+Draws single glyph outline of size ``outline_size`` into a canvas item at the position, using ``font`` at the size ``size``.
|
|
|
+
|
|
|
+Note: Glyph index is specific to the font, use glyphs indices returned by :ref:`shaped_text_get_glyphs<class_TextServer_method_shaped_text_get_glyphs>` or :ref:`font_get_glyph_index<class_TextServer_method_font_get_glyph_index>`.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_get_antialiased:
|
|
|
+
|
|
|
+- :ref:`bool<class_bool>` **font_get_antialiased** **(** :ref:`RID<class_RID>` font **)** |const|
|
|
|
+
|
|
|
+Returns ``true``, if font anti-aliasing is supported and enabled.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_get_ascent:
|
|
|
+
|
|
|
+- :ref:`float<class_float>` **font_get_ascent** **(** :ref:`RID<class_RID>` font, :ref:`int<class_int>` size **)** |const|
|
|
|
+
|
|
|
+Returns the font ascent (number of pixels above the baseline).
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_get_base_size:
|
|
|
+
|
|
|
+- :ref:`float<class_float>` **font_get_base_size** **(** :ref:`RID<class_RID>` font **)** |const|
|
|
|
+
|
|
|
+Returns the default size of the font.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_get_descent:
|
|
|
+
|
|
|
+- :ref:`float<class_float>` **font_get_descent** **(** :ref:`RID<class_RID>` font, :ref:`int<class_int>` size **)** |const|
|
|
|
+
|
|
|
+Returns the font descent (number of pixels below the baseline).
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_get_distance_field_hint:
|
|
|
+
|
|
|
+- :ref:`bool<class_bool>` **font_get_distance_field_hint** **(** :ref:`RID<class_RID>` font **)** |const|
|
|
|
+
|
|
|
+Returns ``true``, if distance field hint is enabled.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_get_force_autohinter:
|
|
|
+
|
|
|
+- :ref:`bool<class_bool>` **font_get_force_autohinter** **(** :ref:`RID<class_RID>` font **)** |const|
|
|
|
+
|
|
|
+Returns ``true``, if autohinter is supported and enabled.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_get_glyph_advance:
|
|
|
+
|
|
|
+- :ref:`Vector2<class_Vector2>` **font_get_glyph_advance** **(** :ref:`RID<class_RID>` font, :ref:`int<class_int>` index, :ref:`int<class_int>` size **)** |const|
|
|
|
+
|
|
|
+Returns advance of the glyph.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_get_glyph_index:
|
|
|
+
|
|
|
+- :ref:`int<class_int>` **font_get_glyph_index** **(** :ref:`RID<class_RID>` font, :ref:`int<class_int>` char, :ref:`int<class_int>` variation_selector=0 **)** |const|
|
|
|
+
|
|
|
+Returns the glyph index of a ``char``, optionally modified by the ``variation_selector``.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_get_glyph_kerning:
|
|
|
+
|
|
|
+- :ref:`Vector2<class_Vector2>` **font_get_glyph_kerning** **(** :ref:`RID<class_RID>` font, :ref:`int<class_int>` index_a, :ref:`int<class_int>` index_b, :ref:`int<class_int>` size **)** |const|
|
|
|
+
|
|
|
+Returns a kerning of the pair of glyphs.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_get_height:
|
|
|
+
|
|
|
+- :ref:`float<class_float>` **font_get_height** **(** :ref:`RID<class_RID>` font, :ref:`int<class_int>` size **)** |const|
|
|
|
+
|
|
|
+Returns the total font height (ascent plus descent) in pixels.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_get_hinting:
|
|
|
+
|
|
|
+- :ref:`Hinting<enum_TextServer_Hinting>` **font_get_hinting** **(** :ref:`RID<class_RID>` font **)** |const|
|
|
|
+
|
|
|
+Returns the font hinting.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_get_language_support_override:
|
|
|
+
|
|
|
+- :ref:`bool<class_bool>` **font_get_language_support_override** **(** :ref:`RID<class_RID>` font, :ref:`String<class_String>` language **)**
|
|
|
+
|
|
|
+Returns ``true`` if support override is enabled for the ``language``.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_get_language_support_overrides:
|
|
|
+
|
|
|
+- :ref:`PackedStringArray<class_PackedStringArray>` **font_get_language_support_overrides** **(** :ref:`RID<class_RID>` font **)**
|
|
|
+
|
|
|
+Returns list of language support overrides.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_get_oversampling:
|
|
|
+
|
|
|
+- :ref:`float<class_float>` **font_get_oversampling** **(** **)** |const|
|
|
|
+
|
|
|
+Returns the font oversampling factor, shared by all fonts in the TextServer.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_get_script_support_override:
|
|
|
+
|
|
|
+- :ref:`bool<class_bool>` **font_get_script_support_override** **(** :ref:`RID<class_RID>` font, :ref:`String<class_String>` script **)**
|
|
|
+
|
|
|
+Returns ``true`` if support override is enabled for the ``script``.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_get_script_support_overrides:
|
|
|
+
|
|
|
+- :ref:`PackedStringArray<class_PackedStringArray>` **font_get_script_support_overrides** **(** :ref:`RID<class_RID>` font **)**
|
|
|
+
|
|
|
+Returns list of script support overrides.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_get_supported_chars:
|
|
|
+
|
|
|
+- :ref:`String<class_String>` **font_get_supported_chars** **(** :ref:`RID<class_RID>` font **)** |const|
|
|
|
+
|
|
|
+Returns a string containing all the characters available in the font.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_get_underline_position:
|
|
|
+
|
|
|
+- :ref:`float<class_float>` **font_get_underline_position** **(** :ref:`RID<class_RID>` font, :ref:`int<class_int>` size **)** |const|
|
|
|
+
|
|
|
+Returns underline offset (number of pixels below the baseline).
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_get_underline_thickness:
|
|
|
+
|
|
|
+- :ref:`float<class_float>` **font_get_underline_thickness** **(** :ref:`RID<class_RID>` font, :ref:`int<class_int>` size **)** |const|
|
|
|
+
|
|
|
+Returns underline thickness in pixels.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_get_variation_list:
|
|
|
+
|
|
|
+- :ref:`String<class_String>` **font_get_variation_list** **(** :ref:`RID<class_RID>` fonte **)** |const|
|
|
|
+
|
|
|
+Returns ``";"`` separated list of supported variation coordinates, each coordinate is returned in the following format: ``"tag,min_value,max_value,default_value"``.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_get_variations:
|
|
|
+
|
|
|
+- :ref:`String<class_String>` **font_get_variations** **(** :ref:`RID<class_RID>` font **)** |const|
|
|
|
+
|
|
|
+Returns variation coordinates. Returned string is identical to the string set by :ref:`font_set_variations<class_TextServer_method_font_set_variations>`, to get default values use :ref:`font_get_variation_list<class_TextServer_method_font_get_variation_list>` instead.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_has_char:
|
|
|
+
|
|
|
+- :ref:`bool<class_bool>` **font_has_char** **(** :ref:`RID<class_RID>` font, :ref:`int<class_int>` char **)** |const|
|
|
|
+
|
|
|
+Returns ``true`` if ``char`` is available in the font.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_has_outline:
|
|
|
+
|
|
|
+- :ref:`bool<class_bool>` **font_has_outline** **(** :ref:`RID<class_RID>` font **)** |const|
|
|
|
+
|
|
|
+Returns ``true``, if font supports glyph outlines.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_is_language_supported:
|
|
|
+
|
|
|
+- :ref:`bool<class_bool>` **font_is_language_supported** **(** :ref:`RID<class_RID>` font, :ref:`String<class_String>` language **)** |const|
|
|
|
+
|
|
|
+Returns ``true``, if font supports given language (ISO 639 code).
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_is_script_supported:
|
|
|
+
|
|
|
+- :ref:`bool<class_bool>` **font_is_script_supported** **(** :ref:`RID<class_RID>` font, :ref:`String<class_String>` script **)** |const|
|
|
|
+
|
|
|
+Returns ``true``, if font supports given script (ISO 15924 code).
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_remove_language_support_override:
|
|
|
+
|
|
|
+- void **font_remove_language_support_override** **(** :ref:`RID<class_RID>` font, :ref:`String<class_String>` language **)**
|
|
|
+
|
|
|
+Remove language support override.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_remove_script_support_override:
|
|
|
+
|
|
|
+- void **font_remove_script_support_override** **(** :ref:`RID<class_RID>` font, :ref:`String<class_String>` script **)**
|
|
|
+
|
|
|
+Removes script support override.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_set_antialiased:
|
|
|
+
|
|
|
+- void **font_set_antialiased** **(** :ref:`RID<class_RID>` font, :ref:`bool<class_bool>` antialiased **)**
|
|
|
+
|
|
|
+Sets font anti-aliasing.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_set_distance_field_hint:
|
|
|
+
|
|
|
+- void **font_set_distance_field_hint** **(** :ref:`RID<class_RID>` font, :ref:`bool<class_bool>` distance_field **)**
|
|
|
+
|
|
|
+Sets font distance field hint.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_set_force_autohinter:
|
|
|
+
|
|
|
+- void **font_set_force_autohinter** **(** :ref:`RID<class_RID>` font, :ref:`bool<class_bool>` enabeld **)**
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_set_hinting:
|
|
|
+
|
|
|
+- void **font_set_hinting** **(** :ref:`RID<class_RID>` font, :ref:`Hinting<enum_TextServer_Hinting>` hinting **)**
|
|
|
+
|
|
|
+Sets font hinting.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_set_language_support_override:
|
|
|
+
|
|
|
+- void **font_set_language_support_override** **(** :ref:`RID<class_RID>` font, :ref:`String<class_String>` language, :ref:`bool<class_bool>` supported **)**
|
|
|
+
|
|
|
+Adds override for :ref:`font_is_language_supported<class_TextServer_method_font_is_language_supported>`.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_set_oversampling:
|
|
|
+
|
|
|
+- void **font_set_oversampling** **(** :ref:`float<class_float>` oversampling **)**
|
|
|
+
|
|
|
+Sets oversampling factor, shared by all font in the TextServer.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_set_script_support_override:
|
|
|
+
|
|
|
+- void **font_set_script_support_override** **(** :ref:`RID<class_RID>` font, :ref:`String<class_String>` script, :ref:`bool<class_bool>` supported **)**
|
|
|
+
|
|
|
+Adds override for :ref:`font_is_script_supported<class_TextServer_method_font_is_script_supported>`.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_font_set_variations:
|
|
|
+
|
|
|
+- void **font_set_variations** **(** :ref:`RID<class_RID>` font, :ref:`String<class_String>` value **)**
|
|
|
+
|
|
|
+Sets variation coordinates, ``value`` is a comma separated list of the in the ``"tag=value"`` format. Tags are case-sensitive. Unsupported or incorrectly formatted coordinates will be silently ignored.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_format_number:
|
|
|
+
|
|
|
+- :ref:`String<class_String>` **format_number** **(** :ref:`String<class_String>` number, :ref:`String<class_String>` language="" **)** |const|
|
|
|
+
|
|
|
+Convert a number from the Western Arabic (0..9) to the numeral systems used in ``language``.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_free_rid:
|
|
|
+
|
|
|
+- void **free_rid** **(** :ref:`RID<class_RID>` rid **)**
|
|
|
+
|
|
|
+Frees an object created by this ``TextServer``.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_get_hex_code_box_size:
|
|
|
+
|
|
|
+- :ref:`Vector2<class_Vector2>` **get_hex_code_box_size** **(** :ref:`int<class_int>` size, :ref:`int<class_int>` index **)** |const|
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_get_name:
|
|
|
+
|
|
|
+- :ref:`String<class_String>` **get_name** **(** **)** |const|
|
|
|
+
|
|
|
+Returns the name of the server interface.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_get_system_fonts:
|
|
|
+
|
|
|
+- :ref:`PackedStringArray<class_PackedStringArray>` **get_system_fonts** **(** **)** |const|
|
|
|
+
|
|
|
+Returns list of available system fonts.
|
|
|
+
|
|
|
+Note: This method is supported by servers with the ``FEATURE_FONT_SYSTEM`` feature.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_has:
|
|
|
+
|
|
|
+- :ref:`bool<class_bool>` **has** **(** :ref:`RID<class_RID>` rid **)**
|
|
|
+
|
|
|
+Returns ``true`` if ``rid`` is valid resource owned by this text server.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_has_feature:
|
|
|
+
|
|
|
+- :ref:`bool<class_bool>` **has_feature** **(** :ref:`Feature<enum_TextServer_Feature>` feature **)**
|
|
|
+
|
|
|
+Returns ``true`` if the server supports a feature.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_is_locale_right_to_left:
|
|
|
+
|
|
|
+- :ref:`bool<class_bool>` **is_locale_right_to_left** **(** :ref:`String<class_String>` locale **)**
|
|
|
+
|
|
|
+Returns ``true`` if locale is right-to-left.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_load_support_data:
|
|
|
+
|
|
|
+- :ref:`bool<class_bool>` **load_support_data** **(** :ref:`String<class_String>` filename **)**
|
|
|
+
|
|
|
+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.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_parse_number:
|
|
|
+
|
|
|
+- :ref:`String<class_String>` **parse_number** **(** :ref:`String<class_String>` number, :ref:`String<class_String>` language="" **)** |const|
|
|
|
+
|
|
|
+Convert a number from the numeral systems used in ``language`` to Western Arabic (0..9).
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_percent_sign:
|
|
|
+
|
|
|
+- :ref:`String<class_String>` **percent_sign** **(** :ref:`String<class_String>` language="" **)** |const|
|
|
|
+
|
|
|
+Returns percent sign used in the ``language``.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_add_object:
|
|
|
+
|
|
|
+- :ref:`bool<class_bool>` **shaped_text_add_object** **(** :ref:`RID<class_RID>` shaped, :ref:`Variant<class_Variant>` key, :ref:`Vector2<class_Vector2>` size, :ref:`VAlign<enum_@GlobalScope_VAlign>` inline_align=1 **)**
|
|
|
+
|
|
|
+Adds inline object to the text buffer, ``key`` must be unique.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_add_string:
|
|
|
+
|
|
|
+- :ref:`bool<class_bool>` **shaped_text_add_string** **(** :ref:`RID<class_RID>` shaped, :ref:`String<class_String>` text, :ref:`Array<class_Array>` fonts, :ref:`int<class_int>` size, :ref:`String<class_String>` opentype_features="", :ref:`String<class_String>` language="" **)**
|
|
|
+
|
|
|
+Adds text span and font to draw it to the text buffer.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_clear:
|
|
|
+
|
|
|
+- void **shaped_text_clear** **(** :ref:`RID<class_RID>` arg0 **)**
|
|
|
+
|
|
|
+Clears text buffer (removes text and inline objects).
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_draw:
|
|
|
+
|
|
|
+- void **shaped_text_draw** **(** :ref:`RID<class_RID>` shaped, :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`float<class_float>` clip_w=-1, :ref:`Color<class_Color>` color=Color( 1, 1, 1, 1 ) **)** |const|
|
|
|
+
|
|
|
+Draw shaped text into a canvas item at a given position, with ``color``. ``pos`` specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout).
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_draw_outline:
|
|
|
+
|
|
|
+- void **shaped_text_draw_outline** **(** :ref:`RID<class_RID>` shaped, :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`float<class_float>` clip_w=-1, :ref:`int<class_int>` outline_size=1, :ref:`Color<class_Color>` color=Color( 1, 1, 1, 1 ) **)** |const|
|
|
|
+
|
|
|
+Draw the outline of the shaped text into a canvas item at a given position, with ``color``. ``pos`` specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout).
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_fit_to_width:
|
|
|
+
|
|
|
+- :ref:`float<class_float>` **shaped_text_fit_to_width** **(** :ref:`RID<class_RID>` shaped, :ref:`float<class_float>` width, :ref:`int<class_int>` jst_flags=48 **)**
|
|
|
+
|
|
|
+Adjusts text with to fit to specified width, returns new text width.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_get_ascent:
|
|
|
+
|
|
|
+- :ref:`float<class_float>` **shaped_text_get_ascent** **(** :ref:`RID<class_RID>` shaped **)** |const|
|
|
|
+
|
|
|
+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.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_get_carets:
|
|
|
+
|
|
|
+- :ref:`Dictionary<class_Dictionary>` **shaped_text_get_carets** **(** :ref:`RID<class_RID>` shaped, :ref:`int<class_int>` position **)** |const|
|
|
|
+
|
|
|
+Returns shapes of the carets corresponding to the character offset ``position`` in the text. Returned caret shape is 1 pixel wide rectangle.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_get_descent:
|
|
|
+
|
|
|
+- :ref:`float<class_float>` **shaped_text_get_descent** **(** :ref:`RID<class_RID>` shaped **)** |const|
|
|
|
+
|
|
|
+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.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_get_direction:
|
|
|
+
|
|
|
+- :ref:`Direction<enum_TextServer_Direction>` **shaped_text_get_direction** **(** :ref:`RID<class_RID>` shaped **)** |const|
|
|
|
+
|
|
|
+Returns direction of the text.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_get_dominant_direciton_in_range:
|
|
|
+
|
|
|
+- :ref:`Direction<enum_TextServer_Direction>` **shaped_text_get_dominant_direciton_in_range** **(** :ref:`RID<class_RID>` shaped, :ref:`int<class_int>` start, :ref:`int<class_int>` end **)** |const|
|
|
|
+
|
|
|
+Returns dominant direction of in the range of text.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_get_glyphs:
|
|
|
+
|
|
|
+- :ref:`Array<class_Array>` **shaped_text_get_glyphs** **(** :ref:`RID<class_RID>` shaped **)** |const|
|
|
|
+
|
|
|
+Returns text glyphs.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_get_line_breaks:
|
|
|
+
|
|
|
+- :ref:`Array<class_Array>` **shaped_text_get_line_breaks** **(** :ref:`RID<class_RID>` shaped, :ref:`float<class_float>` width, :ref:`int<class_int>` start=0, :ref:`int<class_int>` break_flags=3 **)** |const|
|
|
|
+
|
|
|
+Breaks text to the lines and returns character ranges for each line.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_get_line_breaks_adv:
|
|
|
+
|
|
|
+- :ref:`Array<class_Array>` **shaped_text_get_line_breaks_adv** **(** :ref:`RID<class_RID>` shaped, :ref:`PackedFloat32Array<class_PackedFloat32Array>` width, :ref:`int<class_int>` start=0, :ref:`bool<class_bool>` once=true, :ref:`int<class_int>` break_flags=3 **)** |const|
|
|
|
+
|
|
|
+Breaks text to the lines and columns. Returns character ranges for each segment.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_get_object_rect:
|
|
|
+
|
|
|
+- :ref:`Rect2<class_Rect2>` **shaped_text_get_object_rect** **(** :ref:`RID<class_RID>` shaped, :ref:`Variant<class_Variant>` key **)** |const|
|
|
|
+
|
|
|
+Returns bounding rectangle of the inline object.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_get_objects:
|
|
|
+
|
|
|
+- :ref:`Array<class_Array>` **shaped_text_get_objects** **(** :ref:`RID<class_RID>` shaped **)** |const|
|
|
|
+
|
|
|
+Returns array of inline objects.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_get_orientation:
|
|
|
+
|
|
|
+- :ref:`Orientation<enum_TextServer_Orientation>` **shaped_text_get_orientation** **(** :ref:`RID<class_RID>` shaped **)** |const|
|
|
|
+
|
|
|
+Returns text orientation.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_get_parent:
|
|
|
+
|
|
|
+- :ref:`RID<class_RID>` **shaped_text_get_parent** **(** :ref:`RID<class_RID>` shaped **)** |const|
|
|
|
+
|
|
|
+Sets text orientation.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_get_preserve_control:
|
|
|
+
|
|
|
+- :ref:`bool<class_bool>` **shaped_text_get_preserve_control** **(** :ref:`RID<class_RID>` shaped **)** |const|
|
|
|
+
|
|
|
+Returns ``true`` if text buffer is configured to display control characters.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_get_preserve_invalid:
|
|
|
+
|
|
|
+- :ref:`bool<class_bool>` **shaped_text_get_preserve_invalid** **(** :ref:`RID<class_RID>` shaped **)** |const|
|
|
|
+
|
|
|
+Returns ``true`` if text buffer is configured to display hexadecimal codes in place of invalid characters.
|
|
|
+
|
|
|
+Note: If set to ``false``, nothing is displayed in place of invalid characters.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_get_range:
|
|
|
+
|
|
|
+- :ref:`Vector2i<class_Vector2i>` **shaped_text_get_range** **(** :ref:`RID<class_RID>` shaped **)** |const|
|
|
|
+
|
|
|
+Returns substring buffer character range in the parent buffer.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_get_selection:
|
|
|
+
|
|
|
+- :ref:`Array<class_Array>` **shaped_text_get_selection** **(** :ref:`RID<class_RID>` shaped, :ref:`int<class_int>` start, :ref:`int<class_int>` end **)** |const|
|
|
|
+
|
|
|
+Returns selection rectangles for the specified character range.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_get_size:
|
|
|
+
|
|
|
+- :ref:`Vector2<class_Vector2>` **shaped_text_get_size** **(** :ref:`RID<class_RID>` shaped **)** |const|
|
|
|
+
|
|
|
+Returns size of the text.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_get_underline_position:
|
|
|
+
|
|
|
+- :ref:`float<class_float>` **shaped_text_get_underline_position** **(** :ref:`RID<class_RID>` shaped **)** |const|
|
|
|
+
|
|
|
+Returns pixel offset of the underline below the baseline.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_get_underline_thickness:
|
|
|
+
|
|
|
+- :ref:`float<class_float>` **shaped_text_get_underline_thickness** **(** :ref:`RID<class_RID>` shaped **)** |const|
|
|
|
+
|
|
|
+Returns thickness of the underline.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_get_width:
|
|
|
+
|
|
|
+- :ref:`float<class_float>` **shaped_text_get_width** **(** :ref:`RID<class_RID>` shaped **)** |const|
|
|
|
+
|
|
|
+Returns width (for horizontal layout) or height (for vertical) of the text.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_get_word_breaks:
|
|
|
+
|
|
|
+- :ref:`Array<class_Array>` **shaped_text_get_word_breaks** **(** :ref:`RID<class_RID>` shaped **)** |const|
|
|
|
+
|
|
|
+Breaks text into words and returns array of character ranges.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_hit_test_grapheme:
|
|
|
+
|
|
|
+- :ref:`int<class_int>` **shaped_text_hit_test_grapheme** **(** :ref:`RID<class_RID>` shaped, :ref:`float<class_float>` coords **)** |const|
|
|
|
+
|
|
|
+Returns grapheme index at the specified pixel offset at the baseline, or ``-1`` if none is found.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_hit_test_position:
|
|
|
+
|
|
|
+- :ref:`int<class_int>` **shaped_text_hit_test_position** **(** :ref:`RID<class_RID>` shaped, :ref:`float<class_float>` coords **)** |const|
|
|
|
+
|
|
|
+Returns caret character offset at the specified pixel offset at the baseline. This function always returns a valid position.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_is_ready:
|
|
|
+
|
|
|
+- :ref:`bool<class_bool>` **shaped_text_is_ready** **(** :ref:`RID<class_RID>` shaped **)** |const|
|
|
|
+
|
|
|
+Returns ``true`` if buffer is successfully shaped.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_next_grapheme_pos:
|
|
|
+
|
|
|
+- :ref:`int<class_int>` **shaped_text_next_grapheme_pos** **(** :ref:`RID<class_RID>` shaped, :ref:`int<class_int>` pos **)**
|
|
|
+
|
|
|
+Returns composite character end position closest to the ``pos``.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_prev_grapheme_pos:
|
|
|
+
|
|
|
+- :ref:`int<class_int>` **shaped_text_prev_grapheme_pos** **(** :ref:`RID<class_RID>` shaped, :ref:`int<class_int>` pos **)**
|
|
|
+
|
|
|
+Returns composite character start position closest to the ``pos``.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_set_bidi_override:
|
|
|
+
|
|
|
+- void **shaped_text_set_bidi_override** **(** :ref:`RID<class_RID>` shaped, :ref:`Array<class_Array>` override **)**
|
|
|
+
|
|
|
+Overrides BiDi for the structured text.
|
|
|
+
|
|
|
+Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_set_direction:
|
|
|
+
|
|
|
+- void **shaped_text_set_direction** **(** :ref:`RID<class_RID>` shaped, :ref:`Direction<enum_TextServer_Direction>` direction=0 **)**
|
|
|
+
|
|
|
+Sets desired text direction. If set to ``TEXT_DIRECTION_AUTO``, direction will be detected based on the buffer contents and current locale.
|
|
|
+
|
|
|
+Note: Direction is ignored if server does not support ``FEATURE_BIDI_LAYOUT`` feature.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_set_orientation:
|
|
|
+
|
|
|
+- void **shaped_text_set_orientation** **(** :ref:`RID<class_RID>` shaped, :ref:`Orientation<enum_TextServer_Orientation>` orientation=0 **)**
|
|
|
+
|
|
|
+Sets desired text orientation.
|
|
|
+
|
|
|
+Note: Orientation is ignored if server does not support ``FEATURE_VERTICAL_LAYOUT`` feature.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_set_preserve_control:
|
|
|
+
|
|
|
+- void **shaped_text_set_preserve_control** **(** :ref:`RID<class_RID>` shaped, :ref:`bool<class_bool>` enabled **)**
|
|
|
+
|
|
|
+If set to ``true`` text buffer will display control characters.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_set_preserve_invalid:
|
|
|
+
|
|
|
+- void **shaped_text_set_preserve_invalid** **(** :ref:`RID<class_RID>` shaped, :ref:`bool<class_bool>` enabled **)**
|
|
|
+
|
|
|
+If set to ``true`` text buffer will display invalid characters as hexadecimal codes, otherwise nothing is displayed.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_shape:
|
|
|
+
|
|
|
+- :ref:`bool<class_bool>` **shaped_text_shape** **(** :ref:`RID<class_RID>` shaped **)**
|
|
|
+
|
|
|
+Shapes buffer if it's not shaped. Returns ``true`` 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.
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_substr:
|
|
|
+
|
|
|
+- :ref:`RID<class_RID>` **shaped_text_substr** **(** :ref:`RID<class_RID>` shaped, :ref:`int<class_int>` start, :ref:`int<class_int>` length **)** |const|
|
|
|
+
|
|
|
+Returns text buffer for the substring of the text in the ``shaped`` text buffer (including inline objects).
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _class_TextServer_method_shaped_text_tab_align:
|
|
|
+
|
|
|
+- :ref:`float<class_float>` **shaped_text_tab_align** **(** :ref:`RID<class_RID>` shaped, :ref:`PackedFloat32Array<class_PackedFloat32Array>` tab_stops **)**
|
|
|
+
|
|
|
+Aligns shaped text to the given tab-stops.
|
|
|
+
|
|
|
+.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
|
+.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
|
+.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|