text:
:github_url: hide

.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the TLShapedString.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.

.. _class_TLShapedString:

TLShapedString
==============

**Inherits:**

**Inherited By:** :ref:`TLShapedAttributedString<class_TLShapedAttributedString>`

**Category:** Core

Brief Description
-----------------

Holds shaped line of plain text.

Properties
----------

+-----------------------------------------+-------------------------------------------------------------------------+-----------+
| int                                     | :ref:`base_direction<class_TLShapedString_property_base_direction>`     | 3         |
+-----------------------------------------+-------------------------------------------------------------------------+-----------+
| :ref:`TLFontFamily<class_TLFontFamily>` | :ref:`base_font<class_TLShapedString_property_base_font>`               |           |
+-----------------------------------------+-------------------------------------------------------------------------+-----------+
| int                                     | :ref:`base_font_size<class_TLShapedString_property_base_font_size>`     | 12        |
+-----------------------------------------+-------------------------------------------------------------------------+-----------+
| String                                  | :ref:`base_font_style<class_TLShapedString_property_base_font_style>`   | "Regular" |
+-----------------------------------------+-------------------------------------------------------------------------+-----------+
| String                                  | :ref:`features<class_TLShapedString_property_features>`                 | ""        |
+-----------------------------------------+-------------------------------------------------------------------------+-----------+
| String                                  | :ref:`language<class_TLShapedString_property_language>`                 | "en"      |
+-----------------------------------------+-------------------------------------------------------------------------+-----------+
| bool                                    | :ref:`preserve_control<class_TLShapedString_property_preserve_control>` | false     |
+-----------------------------------------+-------------------------------------------------------------------------+-----------+
| String                                  | :ref:`text<class_TLShapedString_property_text>`                         | ""        |
+-----------------------------------------+-------------------------------------------------------------------------+-----------+

Methods
-------

.. table::
   :class: longtable
   :widths: 7 20

   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                                    | :ref:`add_sstring<class_TLShapedString_method_add_sstring>` **(** :ref:`TLShapedString<class_TLShapedString>` text **)**                                                        |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                                    | :ref:`add_text<class_TLShapedString_method_add_text>` **(** String text **)**                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                                    | :ref:`add_utf16<class_TLShapedString_method_add_utf16>` **(** PoolByteArray text **)**                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                                    | :ref:`add_utf32<class_TLShapedString_method_add_utf32>` **(** PoolByteArray text **)**                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                                    | :ref:`add_utf8<class_TLShapedString_method_add_utf8>` **(** PoolByteArray text **)**                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | Array                                                   | :ref:`break_jst<class_TLShapedString_method_break_jst>` **(** **)** const                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | Array                                                   | :ref:`break_lines<class_TLShapedString_method_break_lines>` **(** float width, int flags **)** const                                                                            |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | Array                                                   | :ref:`break_words<class_TLShapedString_method_break_words>` **(** **)** const                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | int                                                     | :ref:`char_count<class_TLShapedString_method_char_count>` **(** **)** const                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | int                                                     | :ref:`clusters<class_TLShapedString_method_clusters>` **(** **)** const                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                                    | :ref:`copy_properties<class_TLShapedString_method_copy_properties>` **(** :ref:`TLShapedString<class_TLShapedString>` source **)**                                              |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                                    | :ref:`draw<class_TLShapedString_method_draw>` **(** RID canvas_item, Vector2 position, Color modulate **)**                                                                     |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                                    | :ref:`draw_as_hex<class_TLShapedString_method_draw_as_hex>` **(** RID canvas_item, Vector2 position, Color modulate, bool draw_brk_ops, bool draw_jst_ops **)**                 |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | Vector2                                                 | :ref:`draw_cluster<class_TLShapedString_method_draw_cluster>` **(** RID canvas_item, Vector2 position, int index, Color modulate **)**                                          |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                                    | :ref:`draw_dbg<class_TLShapedString_method_draw_dbg>` **(** RID canvas_item, Vector2 position, Color modulate, bool draw_brk_ops, bool draw_jst_ops **)**                       |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                                    | :ref:`draw_logical_as_hex<class_TLShapedString_method_draw_logical_as_hex>` **(** RID canvas_item, Vector2 position, Color modulate, bool draw_brk_ops, bool draw_jst_ops **)** |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | bool                                                    | :ref:`empty<class_TLShapedString_method_empty>` **(** **)** const                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | float                                                   | :ref:`extend_to_width<class_TLShapedString_method_extend_to_width>` **(** float width, int flags **)**                                                                          |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | float                                                   | :ref:`get_ascent<class_TLShapedString_method_get_ascent>` **(** **)** const                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | :ref:`TextDirection<enum_TLShapedString_TextDirection>` | :ref:`get_char_direction<class_TLShapedString_method_get_char_direction>` **(** int position **)** const                                                                        |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | float                                                   | :ref:`get_cluster_ascent<class_TLShapedString_method_get_cluster_ascent>` **(** int index **)** const                                                                           |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | String                                                  | :ref:`get_cluster_debug_info<class_TLShapedString_method_get_cluster_debug_info>` **(** int index **)** const                                                                   |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | float                                                   | :ref:`get_cluster_descent<class_TLShapedString_method_get_cluster_descent>` **(** int index **)** const                                                                         |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | int                                                     | :ref:`get_cluster_end<class_TLShapedString_method_get_cluster_end>` **(** int index **)** const                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | :ref:`TLFontFace<class_TLFontFace>`                     | :ref:`get_cluster_face<class_TLShapedString_method_get_cluster_face>` **(** int position **)** const                                                                            |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | float                                                   | :ref:`get_cluster_face_size<class_TLShapedString_method_get_cluster_face_size>` **(** int position **)** const                                                                  |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | int                                                     | :ref:`get_cluster_glyph<class_TLShapedString_method_get_cluster_glyph>` **(** int index, int glyph **)** const                                                                  |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | Vector2                                                 | :ref:`get_cluster_glyph_advance<class_TLShapedString_method_get_cluster_glyph_advance>` **(** int index, int glyph **)** const                                                  |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | Vector2                                                 | :ref:`get_cluster_glyph_offset<class_TLShapedString_method_get_cluster_glyph_offset>` **(** int index, int glyph **)** const                                                    |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | int                                                     | :ref:`get_cluster_glyphs<class_TLShapedString_method_get_cluster_glyphs>` **(** int index **)** const                                                                           |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | float                                                   | :ref:`get_cluster_height<class_TLShapedString_method_get_cluster_height>` **(** int index **)** const                                                                           |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | int                                                     | :ref:`get_cluster_index<class_TLShapedString_method_get_cluster_index>` **(** int position **)** const                                                                          |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | float                                                   | :ref:`get_cluster_leading_edge<class_TLShapedString_method_get_cluster_leading_edge>` **(** int index **)** const                                                               |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | Rect2                                                   | :ref:`get_cluster_rect<class_TLShapedString_method_get_cluster_rect>` **(** int index **)** const                                                                               |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | int                                                     | :ref:`get_cluster_start<class_TLShapedString_method_get_cluster_start>` **(** int index **)** const                                                                             |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | float                                                   | :ref:`get_cluster_trailing_edge<class_TLShapedString_method_get_cluster_trailing_edge>` **(** int index **)** const                                                             |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | float                                                   | :ref:`get_cluster_width<class_TLShapedString_method_get_cluster_width>` **(** int index **)** const                                                                             |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | Array                                                   | :ref:`get_cursor_positions<class_TLShapedString_method_get_cursor_positions>` **(** int position, int primary_dir **)** const                                                   |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | float                                                   | :ref:`get_descent<class_TLShapedString_method_get_descent>` **(** **)** const                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | float                                                   | :ref:`get_height<class_TLShapedString_method_get_height>` **(** **)** const                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | Array                                                   | :ref:`get_highlight_shapes<class_TLShapedString_method_get_highlight_shapes>` **(** int start, int end **)** const                                                              |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | int                                                     | :ref:`get_para_direction<class_TLShapedString_method_get_para_direction>` **(** **)** const                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | PoolByteArray                                           | :ref:`get_utf16<class_TLShapedString_method_get_utf16>` **(** **)** const                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | PoolByteArray                                           | :ref:`get_utf32<class_TLShapedString_method_get_utf32>` **(** **)** const                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | PoolByteArray                                           | :ref:`get_utf8<class_TLShapedString_method_get_utf8>` **(** **)** const                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | float                                                   | :ref:`get_width<class_TLShapedString_method_get_width>` **(** **)** const                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | int                                                     | :ref:`hit_test<class_TLShapedString_method_hit_test>` **(** float position **)** const                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | int                                                     | :ref:`hit_test_cluster<class_TLShapedString_method_hit_test_cluster>` **(** float position **)** const                                                                          |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | bool                                                    | :ref:`is_valid<class_TLShapedString_method_is_valid>` **(** **)** const                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | int                                                     | :ref:`length<class_TLShapedString_method_length>` **(** **)** const                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | int                                                     | :ref:`next_safe_bound<class_TLShapedString_method_next_safe_bound>` **(** int position **)** const                                                                              |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | int                                                     | :ref:`pos_u16_to_wcs<class_TLShapedString_method_pos_u16_to_wcs>` **(** int position **)** const                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | int                                                     | :ref:`pos_wcs_to_u16<class_TLShapedString_method_pos_wcs_to_u16>` **(** int position **)** const                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | int                                                     | :ref:`prev_safe_bound<class_TLShapedString_method_prev_safe_bound>` **(** int position **)** const                                                                              |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                                    | :ref:`replace_sstring<class_TLShapedString_method_replace_sstring>` **(** int start, int end, :ref:`TLShapedString<class_TLShapedString>` text **)**                            |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                                    | :ref:`replace_text<class_TLShapedString_method_replace_text>` **(** int start, int end, String text **)**                                                                       |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                                    | :ref:`replace_utf16<class_TLShapedString_method_replace_utf16>` **(** int start, int end, PoolByteArray text **)**                                                              |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                                    | :ref:`replace_utf32<class_TLShapedString_method_replace_utf32>` **(** int start, int end, PoolByteArray text **)**                                                              |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                                    | :ref:`replace_utf8<class_TLShapedString_method_replace_utf8>` **(** int start, int end, PoolByteArray text **)**                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                                    | :ref:`set_utf16<class_TLShapedString_method_set_utf16>` **(** PoolByteArray data **)**                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                                    | :ref:`set_utf32<class_TLShapedString_method_set_utf32>` **(** PoolByteArray data **)**                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                                    | :ref:`set_utf8<class_TLShapedString_method_set_utf8>` **(** PoolByteArray data **)**                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | bool                                                    | :ref:`shape<class_TLShapedString_method_shape>` **(** **)**                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | :ref:`TLShapedString<class_TLShapedString>`             | :ref:`substr<class_TLShapedString_method_substr>` **(** int start, int end, int trim **)** const                                                                                |
   +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Signals
-------

.. _class_TLShapedString_signal_string_changed:

- **string_changed** **(** **)**

Emitted when the text or/and other property of the string changes.

----

.. _class_TLShapedString_signal_string_shaped:

- **string_shaped** **(** **)**

Emitted when the text shaping process is completed.

Enumerations
------------

.. _enum_TLShapedString_TextDirection:

.. _class_TLShapedString_constant_TEXT_DIRECTION_LTR:

.. _class_TLShapedString_constant_TEXT_DIRECTION_RTL:

.. _class_TLShapedString_constant_TEXT_DIRECTION_LOCALE:

.. _class_TLShapedString_constant_TEXT_DIRECTION_AUTO:

.. _class_TLShapedString_constant_TEXT_DIRECTION_INVALID:

enum **TextDirection**:

- **TEXT_DIRECTION_LTR** = **0** --- Left-to-right text writing direction.

- **TEXT_DIRECTION_RTL** = **1** --- Right-to-left text writing direction.

- **TEXT_DIRECTION_LOCALE** = **2** --- Text writing direction is derived from the locale's script according to the CLDR metadata.

- **TEXT_DIRECTION_AUTO** = **3** --- Text writing direction is derived from the first character in the string with BiDi class L, R, or AL or locale's script if text is not strongly directional.

- **TEXT_DIRECTION_INVALID** = **4** --- Invalid text direction (Used as return value only).

----

.. _enum_TLShapedString_TextJustification:

.. _class_TLShapedString_constant_TEXT_JUSTIFICATION_NONE:

.. _class_TLShapedString_constant_TEXT_JUSTIFICATION_KASHIDA_AND_WHITESPACE:

.. _class_TLShapedString_constant_TEXT_JUSTIFICATION_KASHIDA_ONLY:

.. _class_TLShapedString_constant_TEXT_JUSTIFICATION_WHITESPACE_ONLY:

.. _class_TLShapedString_constant_TEXT_JUSTIFICATION_KASHIDA_AND_WHITESPACE_AND_INTERCHAR:

.. _class_TLShapedString_constant_TEXT_JUSTIFICATION_KASHIDA_AND_INTERCHAR:

.. _class_TLShapedString_constant_TEXT_JUSTIFICATION_WHITESPACE_AND_INTERCHAR:

.. _class_TLShapedString_constant_TEXT_JUSTIFICATION_INTERCHAR_ONLY:

enum **TextJustification**:

- **TEXT_JUSTIFICATION_NONE** = **0** --- No text justification.

- **TEXT_JUSTIFICATION_KASHIDA_AND_WHITESPACE** = **1** --- Use kashida and white space elongation to justify text.

- **TEXT_JUSTIFICATION_KASHIDA_ONLY** = **2** --- Use kashida elongation to justify text.

- **TEXT_JUSTIFICATION_WHITESPACE_ONLY** = **3** --- Use white space elongation to justify text.

- **TEXT_JUSTIFICATION_KASHIDA_AND_WHITESPACE_AND_INTERCHAR** = **4** --- Use kashida, white space and inter character elongation to justify text.

- **TEXT_JUSTIFICATION_KASHIDA_AND_INTERCHAR** = **5** --- Use kashida and inter character elongation to justify text.

- **TEXT_JUSTIFICATION_WHITESPACE_AND_INTERCHAR** = **6** --- Use white space and inter character elongation to justify text.

- **TEXT_JUSTIFICATION_INTERCHAR_ONLY** = **7** --- Use inter character elongation to justify text.

----

.. _enum_TLShapedString_TextBreak:

.. _class_TLShapedString_constant_TEXT_BREAK_NONE:

.. _class_TLShapedString_constant_TEXT_BREAK_MANDATORY:

.. _class_TLShapedString_constant_TEXT_BREAK_MANDATORY_AND_WORD_BOUND:

.. _class_TLShapedString_constant_TEXT_BREAK_MANDATORY_AND_ANYWHERE:

enum **TextBreak**:

- **TEXT_BREAK_NONE** = **0** --- No line breaking.

- **TEXT_BREAK_MANDATORY** = **1** --- Break lines only at mandatory break points.

- **TEXT_BREAK_MANDATORY_AND_WORD_BOUND** = **2** --- Break lines at mandatory break points and word boundaries.

- **TEXT_BREAK_MANDATORY_AND_ANYWHERE** = **3** --- Break lines at mandatory break points and grapheme cluster boundaries.

----

.. _enum_TLShapedString_TextTrimMode:

.. _class_TLShapedString_constant_TEXT_TRIM_NONE:

.. _class_TLShapedString_constant_TEXT_TRIM_BREAK:

.. _class_TLShapedString_constant_TEXT_TRIM_BREAK_AND_WHITESPACE:

enum **TextTrimMode**:

- **TEXT_TRIM_NONE** = **0** --- No substring trimming.

- **TEXT_TRIM_BREAK** = **1** --- Trim line break characters for substring ends.

- **TEXT_TRIM_BREAK_AND_WHITESPACE** = **2** --- Trim line break and white space characters for substring ends.

Description
-----------

Note 1: Code points, Characters, Clusters and Glyphs

- A code point is a single encoding UTF-16 unit (Unicode character or half of the surrogate pair).

- A character is a full Unicode character.

- A grapheme cluster is the abstract unit of a writing system (a letter, a digit, or punctuation).

- A glyph is a shape used to render a character or a sequence of characters.

In general, code point, characters, clusters and glyphs do not have one-to-one correspondence.

Note 2: Encoding

		TLShapedString uses UTF-16 encoding, all positions accepted and returned by TLShapedString function are measured in UTF-16 code points.

Property Descriptions
---------------------

.. _class_TLShapedString_property_base_direction:

- int **base_direction**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+---------------------------+
   | *Default* | 3                         |
   +-----------+---------------------------+
   | *Setter*  | set_base_direction(value) |
   +-----------+---------------------------+
   | *Getter*  | get_base_direction()      |
   +-----------+---------------------------+

Base text writing direction.

----

.. _class_TLShapedString_property_base_font:

- :ref:`TLFontFamily<class_TLFontFamily>` **base_font**

.. table::
   :class: longtable
   :widths: 7 20

   +----------+----------------------+
   | *Setter* | set_base_font(value) |
   +----------+----------------------+
   | *Getter* | get_base_font()      |
   +----------+----------------------+

Base font family reference.

----

.. _class_TLShapedString_property_base_font_size:

- int **base_font_size**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+---------------------------+
   | *Default* | 12                        |
   +-----------+---------------------------+
   | *Setter*  | set_base_font_size(value) |
   +-----------+---------------------------+
   | *Getter*  | get_base_font_size()      |
   +-----------+---------------------------+

Font size.

----

.. _class_TLShapedString_property_base_font_style:

- String **base_font_style**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+----------------------------+
   | *Default* | "Regular"                  |
   +-----------+----------------------------+
   | *Setter*  | set_base_font_style(value) |
   +-----------+----------------------------+
   | *Getter*  | get_base_font_style()      |
   +-----------+----------------------------+

Style name (Regular, Bold, Italic, Oblique etc.).

----

.. _class_TLShapedString_property_features:

- String **features**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+---------------------+
   | *Default* | ""                  |
   +-----------+---------------------+
   | *Setter*  | set_features(value) |
   +-----------+---------------------+
   | *Getter*  | get_features()      |
   +-----------+---------------------+

Comma separated list of OpenType feature tags. More info: https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags.

----

.. _class_TLShapedString_property_language:

- String **language**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+---------------------+
   | *Default* | "en"                |
   +-----------+---------------------+
   | *Setter*  | set_language(value) |
   +-----------+---------------------+
   | *Getter*  | get_language()      |
   +-----------+---------------------+

Language code for line-breaking and text shaping algorithms.

----

.. _class_TLShapedString_property_preserve_control:

- bool **preserve_control**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+-----------------------------+
   | *Default* | false                       |
   +-----------+-----------------------------+
   | *Setter*  | set_preserve_control(value) |
   +-----------+-----------------------------+
   | *Getter*  | get_preserve_control()      |
   +-----------+-----------------------------+

If ``true``, displays control character.

----

.. _class_TLShapedString_property_text:

- String **text**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+-----------------+
   | *Default* | ""              |
   +-----------+-----------------+
   | *Setter*  | set_text(value) |
   +-----------+-----------------+
   | *Getter*  | get_text()      |
   +-----------+-----------------+

Text string.

Method Descriptions
-------------------

.. _class_TLShapedString_method_add_sstring:

- void **add_sstring** **(** :ref:`TLShapedString<class_TLShapedString>` text **)**

Appends shaped string.

----

.. _class_TLShapedString_method_add_text:

- void **add_text** **(** String text **)**

Appends plain text string.

----

.. _class_TLShapedString_method_add_utf16:

- void **add_utf16** **(** PoolByteArray text **)**

----

.. _class_TLShapedString_method_add_utf32:

- void **add_utf32** **(** PoolByteArray text **)**

----

.. _class_TLShapedString_method_add_utf8:

- void **add_utf8** **(** PoolByteArray text **)**

----

.. _class_TLShapedString_method_break_jst:

- Array **break_jst** **(** **)** const

----

.. _class_TLShapedString_method_break_lines:

- Array **break_lines** **(** float width, int flags **)** const

Breaks text into lines that fit within a specified width.

Returns Array of line boundaries.

----

.. _class_TLShapedString_method_break_words:

- Array **break_words** **(** **)** const

Breaks text into words.

Returns Array of word boundaries.

----

.. _class_TLShapedString_method_char_count:

- int **char_count** **(** **)** const

Returns number of characters in the string.

----

.. _class_TLShapedString_method_clusters:

- int **clusters** **(** **)** const

Returns number of grapheme clusters, clusters are indexed in visual order.

----

.. _class_TLShapedString_method_copy_properties:

- void **copy_properties** **(** :ref:`TLShapedString<class_TLShapedString>` source **)**

----

.. _class_TLShapedString_method_draw:

- void **draw** **(** RID canvas_item, Vector2 position, Color modulate **)**

Draws a string.

----

.. _class_TLShapedString_method_draw_as_hex:

- void **draw_as_hex** **(** RID canvas_item, Vector2 position, Color modulate, bool draw_brk_ops, bool draw_jst_ops **)**

``DEBUG:`` Draws a string using "hexbox" fallback font.

----

.. _class_TLShapedString_method_draw_cluster:

- Vector2 **draw_cluster** **(** RID canvas_item, Vector2 position, int index, Color modulate **)**

Draws single grapheme cluster. Returns advance.

----

.. _class_TLShapedString_method_draw_dbg:

- void **draw_dbg** **(** RID canvas_item, Vector2 position, Color modulate, bool draw_brk_ops, bool draw_jst_ops **)**

``DEBUG:`` Draws a string with additional debug information.

----

.. _class_TLShapedString_method_draw_logical_as_hex:

- void **draw_logical_as_hex** **(** RID canvas_item, Vector2 position, Color modulate, bool draw_brk_ops, bool draw_jst_ops **)**

``DEBUG:`` Draws logical character codes of the string with additional debug information.

----

.. _class_TLShapedString_method_empty:

- bool **empty** **(** **)** const

Returns ``true`` if the string is empty.

----

.. _class_TLShapedString_method_extend_to_width:

- float **extend_to_width** **(** float width, int flags **)**

Increase text width to the specified. Returns new line width.

----

.. _class_TLShapedString_method_get_ascent:

- float **get_ascent** **(** **)** const

Returns ascent of the line.

----

.. _class_TLShapedString_method_get_char_direction:

- :ref:`TextDirection<enum_TLShapedString_TextDirection>` **get_char_direction** **(** int position **)** const

Return writing direction of a character writing direction.

----

.. _class_TLShapedString_method_get_cluster_ascent:

- float **get_cluster_ascent** **(** int index **)** const

Returns cluster ascent.

----

.. _class_TLShapedString_method_get_cluster_debug_info:

- String **get_cluster_debug_info** **(** int index **)** const

----

.. _class_TLShapedString_method_get_cluster_descent:

- float **get_cluster_descent** **(** int index **)** const

Returns cluster descent.

----

.. _class_TLShapedString_method_get_cluster_end:

- int **get_cluster_end** **(** int index **)** const

Returns last character position corresponding cluster.

----

.. _class_TLShapedString_method_get_cluster_face:

- :ref:`TLFontFace<class_TLFontFace>` **get_cluster_face** **(** int position **)** const

Returns font face of the cluster.

----

.. _class_TLShapedString_method_get_cluster_face_size:

- float **get_cluster_face_size** **(** int position **)** const

Returns font size of the cluster. For non-attributed string it's always equal to base size.

----

.. _class_TLShapedString_method_get_cluster_glyph:

- int **get_cluster_glyph** **(** int index, int glyph **)** const

Returns glyph ID.

----

.. _class_TLShapedString_method_get_cluster_glyph_advance:

- Vector2 **get_cluster_glyph_advance** **(** int index, int glyph **)** const

Returns glyph advance.

----

.. _class_TLShapedString_method_get_cluster_glyph_offset:

- Vector2 **get_cluster_glyph_offset** **(** int index, int glyph **)** const

Returns glyph offset.

----

.. _class_TLShapedString_method_get_cluster_glyphs:

- int **get_cluster_glyphs** **(** int index **)** const

Returns number of glyphs in cluster.

----

.. _class_TLShapedString_method_get_cluster_height:

- float **get_cluster_height** **(** int index **)** const

Returns cluster height.

----

.. _class_TLShapedString_method_get_cluster_index:

- int **get_cluster_index** **(** int position **)** const

Returns cluster index corresponding to a specific character position in string.

----

.. _class_TLShapedString_method_get_cluster_leading_edge:

- float **get_cluster_leading_edge** **(** int index **)** const

Returns cluster leading edge offset in pixels.

----

.. _class_TLShapedString_method_get_cluster_rect:

- Rect2 **get_cluster_rect** **(** int index **)** const

Returns cluster bounding rectangle.

----

.. _class_TLShapedString_method_get_cluster_start:

- int **get_cluster_start** **(** int index **)** const

Returns first character position corresponding cluster.

----

.. _class_TLShapedString_method_get_cluster_trailing_edge:

- float **get_cluster_trailing_edge** **(** int index **)** const

Returns cluster trailing edge offset in pixels.

----

.. _class_TLShapedString_method_get_cluster_width:

- float **get_cluster_width** **(** int index **)** const

Returns cluster width.

----

.. _class_TLShapedString_method_get_cursor_positions:

- Array **get_cursor_positions** **(** int position, int primary_dir **)** const

Returns an Array of ``float`` (up to two elements) offsets corresponding to the strong and weak cursor, at the specified character position.

----

.. _class_TLShapedString_method_get_descent:

- float **get_descent** **(** **)** const

Returns descent of the line.

----

.. _class_TLShapedString_method_get_height:

- float **get_height** **(** **)** const

Returns height of the line.

----

.. _class_TLShapedString_method_get_highlight_shapes:

- Array **get_highlight_shapes** **(** int start, int end **)** const

Returns an Array of Rect2 enclosing the selection/highlight in the specified range.

----

.. _class_TLShapedString_method_get_para_direction:

- int **get_para_direction** **(** **)** const

Returns shaped string paragraph direction.

----

.. _class_TLShapedString_method_get_utf16:

- PoolByteArray **get_utf16** **(** **)** const

Returns raw text string in UTF-16 encoding.

----

.. _class_TLShapedString_method_get_utf32:

- PoolByteArray **get_utf32** **(** **)** const

Returns raw text string in UTF-32 encoding.

----

.. _class_TLShapedString_method_get_utf8:

- PoolByteArray **get_utf8** **(** **)** const

Returns raw text string in UTF-8 encoding.

----

.. _class_TLShapedString_method_get_width:

- float **get_width** **(** **)** const

Returns width of the line.

----

.. _class_TLShapedString_method_hit_test:

- int **hit_test** **(** float position **)** const

Returns a cursor position corresponding to the specified pixel offset.

----

.. _class_TLShapedString_method_hit_test_cluster:

- int **hit_test_cluster** **(** float position **)** const

Returns a cluster index corresponding to the specified pixel offset.

----

.. _class_TLShapedString_method_is_valid:

- bool **is_valid** **(** **)** const

Returns ``true`` if the string is shaped successfully.

----

.. _class_TLShapedString_method_length:

- int **length** **(** **)** const

Returns number of UTF-16 codepoints in the string.

----

.. _class_TLShapedString_method_next_safe_bound:

- int **next_safe_bound** **(** int position **)** const

Returns next whole character position in the string.

----

.. _class_TLShapedString_method_pos_u16_to_wcs:

- int **pos_u16_to_wcs** **(** int position **)** const

Returns character position (Characters)

----

.. _class_TLShapedString_method_pos_wcs_to_u16:

- int **pos_wcs_to_u16** **(** int position **)** const

Retruns character position (UTF-16 codepoints)

----

.. _class_TLShapedString_method_prev_safe_bound:

- int **prev_safe_bound** **(** int position **)** const

Returns previous whole character position in the string.

----

.. _class_TLShapedString_method_replace_sstring:

- void **replace_sstring** **(** int start, int end, :ref:`TLShapedString<class_TLShapedString>` text **)**

Replaces substring with contents of another shaped string.

----

.. _class_TLShapedString_method_replace_text:

- void **replace_text** **(** int start, int end, String text **)**

Replaces substring with text.

----

.. _class_TLShapedString_method_replace_utf16:

- void **replace_utf16** **(** int start, int end, PoolByteArray text **)**

Replaces substring with contents of the raw UTF-16 encoded string.

----

.. _class_TLShapedString_method_replace_utf32:

- void **replace_utf32** **(** int start, int end, PoolByteArray text **)**

Replaces substring with contents of the raw UTF-32 encoded string.

----

.. _class_TLShapedString_method_replace_utf8:

- void **replace_utf8** **(** int start, int end, PoolByteArray text **)**

Replaces substring with contents of the raw UTF-8 encoded string.

----

.. _class_TLShapedString_method_set_utf16:

- void **set_utf16** **(** PoolByteArray data **)**

Sets text to the contents of the raw UTF-16 encoded string.

----

.. _class_TLShapedString_method_set_utf32:

- void **set_utf32** **(** PoolByteArray data **)**

Sets text to the contents of the raw UTF-32 encoded string.

----

.. _class_TLShapedString_method_set_utf8:

- void **set_utf8** **(** PoolByteArray data **)**

Sets text to the contents of the raw UTF-8 encoded string.

----

.. _class_TLShapedString_method_shape:

- bool **shape** **(** **)**

Shapes string and returns ``true`` if the string is shaped successfully.

----

.. _class_TLShapedString_method_substr:

- :ref:`TLShapedString<class_TLShapedString>` **substr** **(** int start, int end, int trim **)** const

Returns part of the shaped string from the position ``start`` to ``end``, trims it according to ``trim`` parameter.


text:
:github_url: hide

.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the TLDynamicFontFace.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.

.. _class_TLDynamicFontFace:

TLDynamicFontFace
=================

**Inherits:** :ref:`TLFontFace<class_TLFontFace>`

**Category:** Core

Brief Description
-----------------

A TrueType, OpenType or Graphite font for drawing text.

Properties
----------

+-------+----------------------------------------------------------------------------+-------------+
| bool  | :ref:`force_autohinter<class_TLDynamicFontFace_property_force_autohinter>` | false       |
+-------+----------------------------------------------------------------------------+-------------+
| int   | :ref:`hinting<class_TLDynamicFontFace_property_hinting>`                   | 2           |
+-------+----------------------------------------------------------------------------+-------------+
| float | :ref:`oversampling<class_TLDynamicFontFace_property_oversampling>`         | 1.0         |
+-------+----------------------------------------------------------------------------+-------------+
| int   | texture_flags                                                              | **O:** 2048 |
+-------+----------------------------------------------------------------------------+-------------+

Methods
-------

.. table::
   :class: longtable
   :widths: 7 20

   +------+------------------------------------------------------------------------------------+
   | bool | :ref:`has_graphite<class_TLDynamicFontFace_method_has_graphite>` **(** **)** const |
   +------+------------------------------------------------------------------------------------+

Enumerations
------------

.. _enum_TLDynamicFontFace_DynamicFaceHinting:

.. _class_TLDynamicFontFace_constant_DF_HINTING_NONE:

.. _class_TLDynamicFontFace_constant_DF_HINTING_LIGHT:

.. _class_TLDynamicFontFace_constant_DF_HINTING_NORMAL:

enum **DynamicFaceHinting**:

- **DF_HINTING_NONE** = **0** --- Disable font hinting (smoother but less crisp)

- **DF_HINTING_LIGHT** = **1** --- Use the light font hinting mode

- **DF_HINTING_NORMAL** = **2** --- Use the default font hinting mode (crisper but less smooth)

Property Descriptions
---------------------

.. _class_TLDynamicFontFace_property_force_autohinter:

- bool **force_autohinter**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+-----------------------------+
   | *Default* | false                       |
   +-----------+-----------------------------+
   | *Setter*  | set_force_autohinter(value) |
   +-----------+-----------------------------+
   | *Getter*  | get_force_autohinter()      |
   +-----------+-----------------------------+

If ``true``, prefers FreeType auto-hinter over the font's native hinter.

----

.. _class_TLDynamicFontFace_property_hinting:

- int **hinting**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+--------------------+
   | *Default* | 2                  |
   +-----------+--------------------+
   | *Setter*  | set_hinting(value) |
   +-----------+--------------------+
   | *Getter*  | get_hinting()      |
   +-----------+--------------------+

The font hinting mode used by FreeType auto-hinter.

----

.. _class_TLDynamicFontFace_property_oversampling:

- float **oversampling**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+-------------------------+
   | *Default* | 1.0                     |
   +-----------+-------------------------+
   | *Setter*  | set_oversampling(value) |
   +-----------+-------------------------+
   | *Getter*  | get_oversampling()      |
   +-----------+-------------------------+

Font oversampling factor.

Method Descriptions
-------------------

.. _class_TLDynamicFontFace_method_has_graphite:

- bool **has_graphite** **(** **)** const

Returns ``true`` if module is built with SIL Graphite 2 shaper support.

repo_language: C

mime_type: text/x-c


text:
:github_url: hide

.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the TLShapedParagraph.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.

.. _class_TLShapedParagraph:

TLShapedParagraph
=================

**Inherits:**

**Category:** Core

Brief Description
-----------------

Class for formatting entire paragraphs of text at once.

Properties
----------

+-----------------------------------------------------------------+--------------------------------------------------------------------+---------------------+
| Color                                                           | :ref:`back_color<class_TLShapedParagraph_property_back_color>`     | Color( 1, 1, 1, 0 ) |
+-----------------------------------------------------------------+--------------------------------------------------------------------+---------------------+
| int                                                             | :ref:`brk_flags<class_TLShapedParagraph_property_brk_flags>`       | 2                   |
+-----------------------------------------------------------------+--------------------------------------------------------------------+---------------------+
| int                                                             | :ref:`halign<class_TLShapedParagraph_property_halign>`             | 0                   |
+-----------------------------------------------------------------+--------------------------------------------------------------------+---------------------+
| float                                                           | :ref:`indent<class_TLShapedParagraph_property_indent>`             | 0.0                 |
+-----------------------------------------------------------------+--------------------------------------------------------------------+---------------------+
| int                                                             | :ref:`jst_flags<class_TLShapedParagraph_property_jst_flags>`       | 1                   |
+-----------------------------------------------------------------+--------------------------------------------------------------------+---------------------+
| float                                                           | :ref:`line_spacing<class_TLShapedParagraph_property_line_spacing>` | 1.0                 |
+-----------------------------------------------------------------+--------------------------------------------------------------------+---------------------+
| :ref:`TLShapedAttributedString<class_TLShapedAttributedString>` | :ref:`string<class_TLShapedParagraph_property_string>`             |                     |
+-----------------------------------------------------------------+--------------------------------------------------------------------+---------------------+
| float                                                           | :ref:`width<class_TLShapedParagraph_property_width>`               | -1.0                |
+-----------------------------------------------------------------+--------------------------------------------------------------------+---------------------+

Methods
-------

.. table::
   :class: longtable
   :widths: 7 20

   +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                                            | :ref:`copy_properties<class_TLShapedParagraph_method_copy_properties>` **(** :ref:`TLShapedParagraph<class_TLShapedParagraph>` source **)** |
   +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
   | :ref:`TLShapedAttributedString<class_TLShapedAttributedString>` | :ref:`get_line<class_TLShapedParagraph_method_get_line>` **(** int index **)** const                                                        |
   +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
   | Array                                                           | :ref:`get_line_bounds<class_TLShapedParagraph_method_get_line_bounds>` **(** **)** const                                                    |
   +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
   | int                                                             | :ref:`get_lines<class_TLShapedParagraph_method_get_lines>` **(** **)** const                                                                |
   +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
   | Vector2                                                         | :ref:`get_size<class_TLShapedParagraph_method_get_size>` **(** **)** const                                                                  |
   +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
   | Array                                                           | :ref:`get_word_bounds<class_TLShapedParagraph_method_get_word_bounds>` **(** **)** const                                                    |
   +-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+

Signals
-------

.. _class_TLShapedParagraph_signal_paragraph_changed:

- **paragraph_changed** **(** **)**

Emitted when text or attributes of the paragraph are changed.

Enumerations
------------

.. _enum_TLShapedParagraph_ParaHAlign:

.. _class_TLShapedParagraph_constant_PARA_HALIGN_LEFT:

.. _class_TLShapedParagraph_constant_PARA_HALIGN_CENTER:

.. _class_TLShapedParagraph_constant_PARA_HALIGN_RIGHT:

.. _class_TLShapedParagraph_constant_PARA_HALIGN_FILL:

enum **ParaHAlign**:

- **PARA_HALIGN_LEFT** = **0** --- Align rows to the left (default).

- **PARA_HALIGN_CENTER** = **1** --- Align rows centered.

- **PARA_HALIGN_RIGHT** = **2** --- Align rows to the right.

- **PARA_HALIGN_FILL** = **3** --- Expand row white spaces to fit the width.

Property Descriptions
---------------------

.. _class_TLShapedParagraph_property_back_color:

- Color **back_color**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+-----------------------+
   | *Default* | Color( 1, 1, 1, 0 )   |
   +-----------+-----------------------+
   | *Setter*  | set_back_color(value) |
   +-----------+-----------------------+
   | *Getter*  | get_back_color()      |
   +-----------+-----------------------+

Background color of the paragraph.

----

.. _class_TLShapedParagraph_property_brk_flags:

- int **brk_flags**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+----------------------+
   | *Default* | 2                    |
   +-----------+----------------------+
   | *Setter*  | set_brk_flags(value) |
   +-----------+----------------------+
   | *Getter*  | get_brk_flags()      |
   +-----------+----------------------+

Line breaking flags.

----

.. _class_TLShapedParagraph_property_halign:

- int **halign**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+-------------------+
   | *Default* | 0                 |
   +-----------+-------------------+
   | *Setter*  | set_halign(value) |
   +-----------+-------------------+
   | *Getter*  | get_halign()      |
   +-----------+-------------------+

Horizontal alignment.

----

.. _class_TLShapedParagraph_property_indent:

- float **indent**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+-------------------+
   | *Default* | 0.0               |
   +-----------+-------------------+
   | *Setter*  | set_indent(value) |
   +-----------+-------------------+
   | *Getter*  | get_indent()      |
   +-----------+-------------------+

Indentation.

----

.. _class_TLShapedParagraph_property_jst_flags:

- int **jst_flags**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+----------------------+
   | *Default* | 1                    |
   +-----------+----------------------+
   | *Setter*  | set_jst_flags(value) |
   +-----------+----------------------+
   | *Getter*  | get_jst_flags()      |
   +-----------+----------------------+

Justification flags.

----

.. _class_TLShapedParagraph_property_line_spacing:

- float **line_spacing**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+-------------------------+
   | *Default* | 1.0                     |
   +-----------+-------------------------+
   | *Setter*  | set_line_spacing(value) |
   +-----------+-------------------------+
   | *Getter*  | get_line_spacing()      |
   +-----------+-------------------------+

Lien spacing in pixels.

----

.. _class_TLShapedParagraph_property_string:

- :ref:`TLShapedAttributedString<class_TLShapedAttributedString>` **string**

.. table::
   :class: longtable
   :widths: 7 20

   +----------+-------------------+
   | *Setter* | set_string(value) |
   +----------+-------------------+
   | *Getter* | get_string()      |
   +----------+-------------------+

Text and text attributes of the paragraph.

----

.. _class_TLShapedParagraph_property_width:

- float **width**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+------------------+
   | *Default* | -1.0             |
   +-----------+------------------+
   | *Setter*  | set_width(value) |
   +-----------+------------------+
   | *Getter*  | get_width()      |
   +-----------+------------------+

Max width of the paragraph.

Method Descriptions
-------------------

.. _class_TLShapedParagraph_method_copy_properties:

- void **copy_properties** **(** :ref:`TLShapedParagraph<class_TLShapedParagraph>` source **)**

Copies properties of the another paragraph.

----

.. _class_TLShapedParagraph_method_get_line:

- :ref:`TLShapedAttributedString<class_TLShapedAttributedString>` **get_line** **(** int index **)** const

Returns line of the pargraphs. NOTE: read only, changes to the line will be discarded on paragraph update!

----

.. _class_TLShapedParagraph_method_get_line_bounds:

- Array **get_line_bounds** **(** **)** const

Returns array of the line boundaries as ``Vector2(start, end)``.

----

.. _class_TLShapedParagraph_method_get_lines:

- int **get_lines** **(** **)** const

Returns number of lines in the paragraph.

----

.. _class_TLShapedParagraph_method_get_size:

- Vector2 **get_size** **(** **)** const

Returns size of the paragraph in pixels.

----

.. _class_TLShapedParagraph_method_get_word_bounds:

- Array **get_word_bounds** **(** **)** const

Returns array of the word boundaries as ``Vector2(start, end)``.


text:
:github_url: hide

.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the TLGDFontWrapper.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.

.. _class_TLGDFontWrapper:

TLGDFontWrapper
===============

**Inherits:**

**Category:** Core

Brief Description
-----------------

Properties
----------

+-----------------------------------------+------------------------------------------------------------------------+-----------+
| :ref:`TLFontFamily<class_TLFontFamily>` | :ref:`base_font<class_TLGDFontWrapper_property_base_font>`             |           |
+-----------------------------------------+------------------------------------------------------------------------+-----------+
| int                                     | :ref:`base_font_size<class_TLGDFontWrapper_property_base_font_size>`   | 12        |
+-----------------------------------------+------------------------------------------------------------------------+-----------+
| String                                  | :ref:`base_font_style<class_TLGDFontWrapper_property_base_font_style>` | "Regular" |
+-----------------------------------------+------------------------------------------------------------------------+-----------+
| int                                     | :ref:`cache_depth<class_TLGDFontWrapper_property_cache_depth>`         | 100       |
+-----------------------------------------+------------------------------------------------------------------------+-----------+

Description
-----------

Subclass Font to use with default Godot controls, provides limited shaping support.

Note: This class is only available if module is built with ``use_font_wrapper=true`` flag.

Property Descriptions
---------------------

.. _class_TLGDFontWrapper_property_base_font:

- :ref:`TLFontFamily<class_TLFontFamily>` **base_font**

.. table::
   :class: longtable
   :widths: 7 20

   +----------+----------------------+
   | *Setter* | set_base_font(value) |
   +----------+----------------------+
   | *Getter* | get_base_font()      |
   +----------+----------------------+

Base font to wrap.

----

.. _class_TLGDFontWrapper_property_base_font_size:

- int **base_font_size**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+---------------------------+
   | *Default* | 12                        |
   +-----------+---------------------------+
   | *Setter*  | set_base_font_size(value) |
   +-----------+---------------------------+
   | *Getter*  | get_base_font_size()      |
   +-----------+---------------------------+

Base font size.

----

.. _class_TLGDFontWrapper_property_base_font_style:

- String **base_font_style**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+----------------------------+
   | *Default* | "Regular"                  |
   +-----------+----------------------------+
   | *Setter*  | set_base_font_style(value) |
   +-----------+----------------------------+
   | *Getter*  | get_base_font_style()      |
   +-----------+----------------------------+

Base font style.

----

.. _class_TLGDFontWrapper_property_cache_depth:

- int **cache_depth**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+------------------------+
   | *Default* | 100                    |
   +-----------+------------------------+
   | *Setter*  | set_cache_depth(value) |
   +-----------+------------------------+
   | *Getter*  | get_cache_depth()      |
   +-----------+------------------------+

Number of shaped strings to keep in cache.


text:
:github_url: hide

.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the TLFontFamily.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.

.. _class_TLFontFamily:

TLFontFamily
============

**Inherits:**

**Category:** Core

Brief Description
-----------------

A set of fonts that make up a font family.

Properties
----------

+-------------------------------------+-----------------------------------------------------------------------------------------------------------+
| :ref:`TLFontFace<class_TLFontFace>` | :ref:`{style_name}/{index}<class_TLFontFamily_property_{style_name}/{index}>`                             |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------+
| :ref:`TLFontFace<class_TLFontFace>` | :ref:`{style_name}/script/{tag}/{index}<class_TLFontFamily_property_{style_name}/script/{tag}/{index}>`   |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------+
| :ref:`TLFontFace<class_TLFontFace>` | :ref:`{style_name}/script/{lang}/{index}<class_TLFontFamily_property_{style_name}/script/{lang}/{index}>` |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------+

Methods
-------

.. table::
   :class: longtable
   :widths: 7 20

   +---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                        | :ref:`add_face<class_TLFontFamily_method_add_face>` **(** String style, :ref:`TLFontFace<class_TLFontFace>` ref **)**                                        |
   +---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                        | :ref:`add_face_for_language<class_TLFontFamily_method_add_face_for_language>` **(** String style, :ref:`TLFontFace<class_TLFontFace>` ref, String lang **)** |
   +---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                        | :ref:`add_face_for_script<class_TLFontFamily_method_add_face_for_script>` **(** String style, :ref:`TLFontFace<class_TLFontFace>` ref, String script **)**   |
   +---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                        | :ref:`add_face_unlinked<class_TLFontFamily_method_add_face_unlinked>` **(** String style, :ref:`TLFontFace<class_TLFontFace>` ref **)**                      |
   +---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                        | :ref:`add_language<class_TLFontFamily_method_add_language>` **(** String style, String language **)**                                                        |
   +---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                        | :ref:`add_script<class_TLFontFamily_method_add_script>` **(** String style, String script **)**                                                              |
   +---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                        | :ref:`add_style<class_TLFontFamily_method_add_style>` **(** String style **)**                                                                               |
   +---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | :ref:`TLFontIterator<class_TLFontIterator>` | :ref:`get_face<class_TLFontFamily_method_get_face>` **(** String style **)** const                                                                           |
   +---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | :ref:`TLFontIterator<class_TLFontIterator>` | :ref:`get_face_for_language<class_TLFontFamily_method_get_face_for_language>` **(** String style, String lang **)** const                                    |
   +---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | :ref:`TLFontIterator<class_TLFontIterator>` | :ref:`get_face_for_script<class_TLFontFamily_method_get_face_for_script>` **(** String style, String script **)** const                                      |
   +---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | bool                                        | :ref:`has_style<class_TLFontFamily_method_has_style>` **(** String style **)** const                                                                         |
   +---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                        | :ref:`remove_language<class_TLFontFamily_method_remove_language>` **(** String style, String language **)**                                                  |
   +---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                        | :ref:`remove_script<class_TLFontFamily_method_remove_script>` **(** String style, String script **)**                                                        |
   +---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | void                                        | :ref:`remove_style<class_TLFontFamily_method_remove_style>` **(** String style **)**                                                                         |
   +---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+

Property Descriptions
---------------------

.. _class_TLFontFamily_property_{style_name}/{index}:

- :ref:`TLFontFace<class_TLFontFace>` **{style_name}/{index}**

Font faces not linked to the language or script.

----

.. _class_TLFontFamily_property_{style_name}/script/{tag}/{index}:

- :ref:`TLFontFace<class_TLFontFace>` **{style_name}/script/{tag}/{index}**

Font faces linked to the script.

----

.. _class_TLFontFamily_property_{style_name}/script/{lang}/{index}:

- :ref:`TLFontFace<class_TLFontFace>` **{style_name}/script/{lang}/{index}**

Font faces linked to the language.

Method Descriptions
-------------------

.. _class_TLFontFamily_method_add_face:

- void **add_face** **(** String style, :ref:`TLFontFace<class_TLFontFace>` ref **)**

Adds font face to be used for specific style. Supported scripts are detected automatically.

----

.. _class_TLFontFamily_method_add_face_for_language:

- void **add_face_for_language** **(** String style, :ref:`TLFontFace<class_TLFontFace>` ref, String lang **)**

Adds font face to be used for specific language and style.

----

.. _class_TLFontFamily_method_add_face_for_script:

- void **add_face_for_script** **(** String style, :ref:`TLFontFace<class_TLFontFace>` ref, String script **)**

Adds font face to be used for specific script and style.

----

.. _class_TLFontFamily_method_add_face_unlinked:

- void **add_face_unlinked** **(** String style, :ref:`TLFontFace<class_TLFontFace>` ref **)**

Adds font face to be used for specific style, without associating it with the script or language.

----

.. _class_TLFontFamily_method_add_language:

- void **add_language** **(** String style, String language **)**

Creates new font fallback list for the language, list is created automatically when add_face or add_face_for_language function is called.

Use ISO 639-1 (https://en.wikipedia.org/wiki/ISO_639-1) codes for the language names.

----

.. _class_TLFontFamily_method_add_script:

- void **add_script** **(** String style, String script **)**

Creates new font fallback list for the script, list is created automatically when add_face or add_face_for_script function is called.

Use ISO 15924 (https://en.wikipedia.org/wiki/ISO_15924) for the script names.

----

.. _class_TLFontFamily_method_add_style:

- void **add_style** **(** String style **)**

Adds new style to the family, style is created automatically when any of the add_face functions is called.

----

.. _class_TLFontFamily_method_get_face:

- :ref:`TLFontIterator<class_TLFontIterator>` **get_face** **(** String style **)** const

Returns font iterator for the specific style.

----

.. _class_TLFontFamily_method_get_face_for_language:

- :ref:`TLFontIterator<class_TLFontIterator>` **get_face_for_language** **(** String style, String lang **)** const

Returns font iterator for the specific style and supported language.

----

.. _class_TLFontFamily_method_get_face_for_script:

- :ref:`TLFontIterator<class_TLFontIterator>` **get_face_for_script** **(** String style, String script **)** const

Returns font iterator for the specific style and supported script.

----

.. _class_TLFontFamily_method_has_style:

- bool **has_style** **(** String style **)** const

Returns ``true`` if font family has style.

----

.. _class_TLFontFamily_method_remove_language:

- void **remove_language** **(** String style, String language **)**

Removes font fallback list for the language.

----

.. _class_TLFontFamily_method_remove_script:

- void **remove_script** **(** String style, String script **)**

Removes font fallback list for the script.

----

.. _class_TLFontFamily_method_remove_style:

- void **remove_style** **(** String style **)**

Removes style from the font family.


text:
:github_url: hide

.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the TLFontIterator.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.

.. _class_TLFontIterator:

TLFontIterator
==============

**Inherits:**

**Category:** Core

Brief Description
-----------------

Methods
-------

.. table::
   :class: longtable
   :widths: 7 20

   +-------------------------------------+---------------------------------------------------------------------------+
   | bool                                | :ref:`is_linked<class_TLFontIterator_method_is_linked>` **(** **)** const |
   +-------------------------------------+---------------------------------------------------------------------------+
   | bool                                | :ref:`is_valid<class_TLFontIterator_method_is_valid>` **(** **)** const   |
   +-------------------------------------+---------------------------------------------------------------------------+
   | bool                                | :ref:`next<class_TLFontIterator_method_next>` **(** **)**                 |
   +-------------------------------------+---------------------------------------------------------------------------+
   | :ref:`TLFontFace<class_TLFontFace>` | :ref:`value<class_TLFontIterator_method_value>` **(** **)** const         |
   +-------------------------------------+---------------------------------------------------------------------------+

Method Descriptions
-------------------

.. _class_TLFontIterator_method_is_linked:

- bool **is_linked** **(** **)** const

Return ``true`` if current iterator value is part of language/script specific fallback list.

----

.. _class_TLFontIterator_method_is_valid:

- bool **is_valid** **(** **)** const

Return ``true`` if current iterator value is valid.

----

.. _class_TLFontIterator_method_next:

- bool **next** **(** **)**

Advances iterator. Return ``true`` if current iterator value is valid.

----

.. _class_TLFontIterator_method_value:

- :ref:`TLFontFace<class_TLFontFace>` **value** **(** **)** const

Return current font face.


text:
:github_url: hide

.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the TLRichTextEditSelection.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.

.. _class_TLRichTextEditSelection:

TLRichTextEditSelection
=======================

**Inherits:**

**Category:** Core

Brief Description
-----------------

Selection and caret info of the :ref:`TLRichTextEdit<class_TLRichTextEdit>`

Properties
----------

+-----+--------------------------------------------------------------------------+---+
| int | :ref:`caret_offset<class_TLRichTextEditSelection_property_caret_offset>` | 0 |
+-----+--------------------------------------------------------------------------+---+
| int | :ref:`caret_para<class_TLRichTextEditSelection_property_caret_para>`     | 0 |
+-----+--------------------------------------------------------------------------+---+
| int | :ref:`end_offset<class_TLRichTextEditSelection_property_end_offset>`     | 0 |
+-----+--------------------------------------------------------------------------+---+
| int | :ref:`end_para<class_TLRichTextEditSelection_property_end_para>`         | 0 |
+-----+--------------------------------------------------------------------------+---+
| int | :ref:`start_offset<class_TLRichTextEditSelection_property_start_offset>` | 0 |
+-----+--------------------------------------------------------------------------+---+
| int | :ref:`start_para<class_TLRichTextEditSelection_property_start_para>`     | 0 |
+-----+--------------------------------------------------------------------------+---+

Signals
-------

.. _class_TLRichTextEditSelection_signal_selection_changed:

- **selection_changed** **(** **)**

Emitted when selection range is changed or caret moved.

Property Descriptions
---------------------

.. _class_TLRichTextEditSelection_property_caret_offset:

- int **caret_offset**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+-------------------------+
   | *Default* | 0                       |
   +-----------+-------------------------+
   | *Setter*  | set_caret_offset(value) |
   +-----------+-------------------------+
   | *Getter*  | get_caret_offset()      |
   +-----------+-------------------------+

Caret position in the paragraph :ref:`caret_para<class_TLRichTextEditSelection_property_caret_para>`.

----

.. _class_TLRichTextEditSelection_property_caret_para:

- int **caret_para**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+-----------------------+
   | *Default* | 0                     |
   +-----------+-----------------------+
   | *Setter*  | set_caret_para(value) |
   +-----------+-----------------------+
   | *Getter*  | get_caret_para()      |
   +-----------+-----------------------+

Paragraph where caret currently is in.

----

.. _class_TLRichTextEditSelection_property_end_offset:

- int **end_offset**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+-----------------------+
   | *Default* | 0                     |
   +-----------+-----------------------+
   | *Setter*  | set_end_offset(value) |
   +-----------+-----------------------+
   | *Getter*  | get_end_offset()      |
   +-----------+-----------------------+

Offset of the end of selection in the paragraph :ref:`end_para<class_TLRichTextEditSelection_property_end_para>`.

----

.. _class_TLRichTextEditSelection_property_end_para:

- int **end_para**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+---------------------+
   | *Default* | 0                   |
   +-----------+---------------------+
   | *Setter*  | set_end_para(value) |
   +-----------+---------------------+
   | *Getter*  | get_end_para()      |
   +-----------+---------------------+

Last paragraph in the selection.

----

.. _class_TLRichTextEditSelection_property_start_offset:

- int **start_offset**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+-------------------------+
   | *Default* | 0                       |
   +-----------+-------------------------+
   | *Setter*  | set_start_offset(value) |
   +-----------+-------------------------+
   | *Getter*  | get_start_offset()      |
   +-----------+-------------------------+

Offset of the start of selection in the paragraph :ref:`start_para<class_TLRichTextEditSelection_property_start_para>`.

----

.. _class_TLRichTextEditSelection_property_start_para:

- int **start_para**

.. table::
   :class: longtable
   :widths: 7 20

   +-----------+-----------------------+
   | *Default* | 0                     |
   +-----------+-----------------------+
   | *Setter*  | set_start_para(value) |
   +-----------+-----------------------+
   | *Getter*  | get_start_para()      |
   +-----------+-----------------------+

First paragraph in the selection.


text:
.. _doc_about_intro:

libgdtl introduction
====================

BiDi, shaping and basic text layout for Godot Engine.

Dependencies
------------

- Godot 3.1+
- C++14 compiler
- Meson build system (for gdnative module build only)
- SCons build system

Compiling (as builtin module)
-----------------------------

Build options
^^^^^^^^^^^^^

+------------------+------------------------------------------------+---------------+
| Name             | Description                                    | Default value |
+==================+================================================+===============+
| builtin_runtime  | Use the built-in libraries                     | true          |
+------------------+------------------------------------------------+---------------+
| use_graphite2    | Enable SIL Graphite 2 complementary shaper     | true          |
+------------------+------------------------------------------------+---------------+
| use_font_wrapper | Enable Godot font wrapper for default controls | false         |
+------------------+------------------------------------------------+---------------+

If `use_font_wrapper` is enabled, apply `patch_font.diff` from the root of this repository to the Godot engine source first.

Building `libdgtl` module
^^^^^^^^^^^^^^^^^^^^^^^^^

Clone this repository (without `--recursive` flag) into Godot's `modules` subfolder as `godot_tl`.
Rebuild Godot engine as usual.

Compiling (as gdnative module)
------------------------------

Build options
^^^^^^^^^^^^^

+--------------------+------------------------------------------------------------------+---------------+
| Name               | Description                                                      | Default value |
+====================+==================================================================+===============+
| godot-cpp-lib-name | godot-cpp static library name (without `.a` or `.lib` extension) | libgodot-cpp  |
+--------------------+------------------------------------------------------------------+---------------+
| static-lib         | Build static library                                             | false         |
+--------------------+------------------------------------------------------------------+---------------+
| static-runtime     | Link libraries statically for better portability                 | false         |
+--------------------+------------------------------------------------------------------+---------------+
| builtin-runtime    | Use the built-in libraries                                       | false         |
+--------------------+------------------------------------------------------------------+---------------+
| use-graphite2      | Enable SIL Graphite 2 complementary shaper                       | true          |
+--------------------+------------------------------------------------------------------+---------------+

Building `godot-cpp` static library
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

See `<https://github.com/GodotNativeTools/godot-cpp/blob/master/README.md#compiling-the-cpp-bindings-library>`_

Building `libdgtl` module
^^^^^^^^^^^^^^^^^^^^^^^^^

See :ref:`doc_compile_desktop`, :ref:`doc_compile_android` and :ref:`doc_compile_ios` for build instructions.

License
-------

- The source code of the **libgdtl** module is released under unlicense.

  For more information, see `<http://unlicense.org/>`_ or the accompanying UNLICENSE file.
- **Godot** and **GodotNativeTools** are licensed under MIT license.

  For more information, see `<https://github.com/godotengine/godot/blob/master/LICENSE.txt>`_.
- **HarfBuzz** is licensed under MIT-like License.

  For more information, see `<https://github.com/harfbuzz/harfbuzz/blob/master/COPYING>`_
- **ICU4C** is licensed under Unicode, Inc. License.

  For more information, see `<http://www.unicode.org/copyright.html#License>`_
- **FreeType** is licensed under FreeType License (BSD-like) or GNU General Public License (GPL), version 2.

  For more information, see `<https://www.freetype.org/license.html>`_
- **SIL Graphite engine** is licensed under GNU Lesser General Public License (LGPL), version 2.1+ or GNU General Public License (GPL), version 2 or Mozilla Public License.

  For more information, see `<https://github.com/silnrsi/graphite/blob/master/COPYING>`_

Demo data
---------

`Montserrat <https://github.com/JulietaUla/Montserrat/>`_, `Awami Nastaliq <https://software.sil.org/awami/download/>`_, `Comic Neue <http://comicneue.com/>`_ and `Noto <https://www.google.com/get/noto/>`_ fonts are published under the `SIL Open Font License, Version 1.1 <https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL>`_

`Material Design icons by Google <https://github.com/google/material-design-icons>`_ are published under the `Apache License Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0.txt>`_

Noto Color Emoji font is cut down to single glyph (U+1F604) using `glyphhanger <https://github.com/filamentgroup/glyphhanger>`_.


text:
.. _doc_compile_ios:

Compiling GDNative module for iOS
=================================

Requirements
^^^^^^^^^^^^

- Meson build system
- SCons build system
- Xcode 10.0 (or later) with the iOS (10.0) SDK and the command line tools.

Building `godot-cpp` static library
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1. Open a Terminal and navigate to the `godot-cpp` subdirectory.

2. Apply provided patch for iOS build:

::

    $ git apply ../patch_gdcpp_ios.diff

3. Compile `godot-cpp` static libraries for required platforms (`arm64` and `armv7` for real devices and `x86_64` for simulator), by typing:

::

    $ scons platform=ios target=release ios_arch=arm64 generate_bindings=yes
    $ scons platform=ios target=release ios_arch=armv7 generate_bindings=yes
    $ scons platform=ios target=release ios_arch=x86_64 generate_bindings=yes

Building `libgdtl` static library and built-in dependencies
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1. Navigate to the root directory of the source.
2. Edit iOS SDK and toolchain paths in the Meson cross compile files (`toolchains/ios.{arch}.toolchain`).
3. Configure `libgdtl` static libraries, by typing:

::

    $ meson ./_ios_arm8 -Dgodot-cpp-lib-name=libgodot-cpp.ios.release.arm64 --buildtype=release --cross-file ./toolchains/ios.arm64.toolchain
    $ meson ./_ios_arm7 -Dgodot-cpp-lib-name=libgodot-cpp.ios.release.armv7 --buildtype=release --cross-file ./toolchains/ios.armv7.toolchain
    $ meson ./_ios_x86_64 -Dgodot-cpp-lib-name=libgodot-cpp.ios.release.x86_64 --buildtype=release --cross-file ./toolchains/ios.x86_64.toolchain

4. Compile `libgdtl` static libraries, by typing:

::

    $ ninja -C ./_ios_arm8
    $ ninja -C ./_ios_arm7
    $ ninja -C ./_ios_x86_64

5. (Optional) Bundle `libgdtl` and it's dependencies into one file:

::

    $ libtool -static -o ./_ios_arm8/libgdtl_full.a ./_ios_arm8/libgdtl.a ./_ios_arm8/subprojects/freetype2/libfreetype2.a ./_ios_arm8/subprojects/graphite2/libgraphite2.a ./_ios_arm8/subprojects/harfbuzz/libharfbuzz.a ./_ios_arm8/subprojects/icu4c/libicu4c.a ./_ios_arm8/subprojects/libpng/liblibpng.a ./_ios_arm8/subprojects/zlib/libzlib.a ./godot-cpp/bin/libgodot-cpp.ios.release.arm64.a
    $ libtool -static -o ./_ios_arm7/libgdtl_full.a ./_ios_arm7/libgdtl.a ./_ios_arm7/subprojects/freetype2/libfreetype2.a ./_ios_arm7/subprojects/graphite2/libgraphite2.a ./_ios_arm7/subprojects/harfbuzz/libharfbuzz.a ./_ios_arm7/subprojects/icu4c/libicu4c.a ./_ios_arm7/subprojects/libpng/liblibpng.a ./_ios_arm7/subprojects/zlib/libzlib.a ./godot-cpp/bin/libgodot-cpp.ios.release.armv7.a
    $ libtool -static -o ./_ios_x86_64/libgdtl_full.a ./_ios_x86_64/libgdtl.a ./_ios_x86_64/subprojects/freetype2/libfreetype2.a ./_ios_x86_64/subprojects/graphite2/libgraphite2.a ./_ios_x86_64/subprojects/harfbuzz/libharfbuzz.a ./_ios_x86_64/subprojects/icu4c/libicu4c.a ./_ios_x86_64/subprojects/libpng/liblibpng.a ./_ios_x86_64/subprojects/zlib/libzlib.a ./godot-cpp/bin/libgodot-cpp.ios.release.x86_64.a

6. (Optional) Bundle static libs for all platforms into one "fat" file:

::

    $ lipo -create ./_ios_arm8/libgdtl_full.a ./_ios_arm7/libgdtl_full.a ./_ios_x86_64/libgdtl_full.a -output ./libgdtl/bin/libgdtl_ios_fat.a

Adding `libgdtl` static library to the exported Xcode project
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1. Copy `libgdtl` static library file(s) into exported project directory (alongside with `{app_name}.xcode` and `{app_name}.a` files).
2. Open exported project in the Xcode.
3. Select `Targets` > Exported App Name > `General` > `Frameworks, Libraries, and Embedded Content`
4. Drag-and-drop (or use `+` button) `libgdtl` fat (or individual platform) file(s) to the list.

.. image:: img/ios_adding_static_lib.png