class_textparagraph.rst 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/TextParagraph.xml.
  6. .. _class_TextParagraph:
  7. TextParagraph
  8. =============
  9. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Holds a paragraph of text.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Abstraction over :ref:`TextServer<class_TextServer>` for handling a single paragraph of text.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +---------------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  21. | :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` | :ref:`alignment<class_TextParagraph_property_alignment>` | ``0`` |
  22. +---------------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  23. | |bitfield|\[:ref:`LineBreakFlag<enum_TextServer_LineBreakFlag>`\] | :ref:`break_flags<class_TextParagraph_property_break_flags>` | ``3`` |
  24. +---------------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  25. | :ref:`String<class_String>` | :ref:`custom_punctuation<class_TextParagraph_property_custom_punctuation>` | ``""`` |
  26. +---------------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  27. | :ref:`Direction<enum_TextServer_Direction>` | :ref:`direction<class_TextParagraph_property_direction>` | ``0`` |
  28. +---------------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  29. | :ref:`String<class_String>` | :ref:`ellipsis_char<class_TextParagraph_property_ellipsis_char>` | ``"…"`` |
  30. +---------------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  31. | |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] | :ref:`justification_flags<class_TextParagraph_property_justification_flags>` | ``163`` |
  32. +---------------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  33. | :ref:`float<class_float>` | :ref:`line_spacing<class_TextParagraph_property_line_spacing>` | ``0.0`` |
  34. +---------------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  35. | :ref:`int<class_int>` | :ref:`max_lines_visible<class_TextParagraph_property_max_lines_visible>` | ``-1`` |
  36. +---------------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  37. | :ref:`Orientation<enum_TextServer_Orientation>` | :ref:`orientation<class_TextParagraph_property_orientation>` | ``0`` |
  38. +---------------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  39. | :ref:`bool<class_bool>` | :ref:`preserve_control<class_TextParagraph_property_preserve_control>` | ``false`` |
  40. +---------------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  41. | :ref:`bool<class_bool>` | :ref:`preserve_invalid<class_TextParagraph_property_preserve_invalid>` | ``true`` |
  42. +---------------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  43. | :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` | :ref:`text_overrun_behavior<class_TextParagraph_property_text_overrun_behavior>` | ``0`` |
  44. +---------------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  45. | :ref:`float<class_float>` | :ref:`width<class_TextParagraph_property_width>` | ``-1.0`` |
  46. +---------------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  47. .. rst-class:: classref-reftable-group
  48. Methods
  49. -------
  50. .. table::
  51. :widths: auto
  52. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`bool<class_bool>` | :ref:`add_object<class_TextParagraph_method_add_object>`\ (\ key\: :ref:`Variant<class_Variant>`, size\: :ref:`Vector2<class_Vector2>`, inline_align\: :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` = 5, length\: :ref:`int<class_int>` = 1, baseline\: :ref:`float<class_float>` = 0.0\ ) |
  54. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`bool<class_bool>` | :ref:`add_string<class_TextParagraph_method_add_string>`\ (\ text\: :ref:`String<class_String>`, font\: :ref:`Font<class_Font>`, font_size\: :ref:`int<class_int>`, language\: :ref:`String<class_String>` = "", meta\: :ref:`Variant<class_Variant>` = null\ ) |
  56. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | |void| | :ref:`clear<class_TextParagraph_method_clear>`\ (\ ) |
  58. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | |void| | :ref:`clear_dropcap<class_TextParagraph_method_clear_dropcap>`\ (\ ) |
  60. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | |void| | :ref:`draw<class_TextParagraph_method_draw>`\ (\ canvas\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), dc_color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| |
  62. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | |void| | :ref:`draw_dropcap<class_TextParagraph_method_draw_dropcap>`\ (\ canvas\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| |
  64. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | |void| | :ref:`draw_dropcap_outline<class_TextParagraph_method_draw_dropcap_outline>`\ (\ canvas\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, outline_size\: :ref:`int<class_int>` = 1, color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| |
  66. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | |void| | :ref:`draw_line<class_TextParagraph_method_draw_line>`\ (\ canvas\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, line\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| |
  68. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | |void| | :ref:`draw_line_outline<class_TextParagraph_method_draw_line_outline>`\ (\ canvas\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, line\: :ref:`int<class_int>`, outline_size\: :ref:`int<class_int>` = 1, color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| |
  70. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | |void| | :ref:`draw_outline<class_TextParagraph_method_draw_outline>`\ (\ canvas\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, outline_size\: :ref:`int<class_int>` = 1, color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), dc_color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| |
  72. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`int<class_int>` | :ref:`get_dropcap_lines<class_TextParagraph_method_get_dropcap_lines>`\ (\ ) |const| |
  74. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`RID<class_RID>` | :ref:`get_dropcap_rid<class_TextParagraph_method_get_dropcap_rid>`\ (\ ) |const| |
  76. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`Vector2<class_Vector2>` | :ref:`get_dropcap_size<class_TextParagraph_method_get_dropcap_size>`\ (\ ) |const| |
  78. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`Direction<enum_TextServer_Direction>` | :ref:`get_inferred_direction<class_TextParagraph_method_get_inferred_direction>`\ (\ ) |const| |
  80. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`float<class_float>` | :ref:`get_line_ascent<class_TextParagraph_method_get_line_ascent>`\ (\ line\: :ref:`int<class_int>`\ ) |const| |
  82. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | :ref:`int<class_int>` | :ref:`get_line_count<class_TextParagraph_method_get_line_count>`\ (\ ) |const| |
  84. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | :ref:`float<class_float>` | :ref:`get_line_descent<class_TextParagraph_method_get_line_descent>`\ (\ line\: :ref:`int<class_int>`\ ) |const| |
  86. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`Rect2<class_Rect2>` | :ref:`get_line_object_rect<class_TextParagraph_method_get_line_object_rect>`\ (\ line\: :ref:`int<class_int>`, key\: :ref:`Variant<class_Variant>`\ ) |const| |
  88. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`Array<class_Array>` | :ref:`get_line_objects<class_TextParagraph_method_get_line_objects>`\ (\ line\: :ref:`int<class_int>`\ ) |const| |
  90. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | :ref:`Vector2i<class_Vector2i>` | :ref:`get_line_range<class_TextParagraph_method_get_line_range>`\ (\ line\: :ref:`int<class_int>`\ ) |const| |
  92. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | :ref:`RID<class_RID>` | :ref:`get_line_rid<class_TextParagraph_method_get_line_rid>`\ (\ line\: :ref:`int<class_int>`\ ) |const| |
  94. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | :ref:`Vector2<class_Vector2>` | :ref:`get_line_size<class_TextParagraph_method_get_line_size>`\ (\ line\: :ref:`int<class_int>`\ ) |const| |
  96. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`float<class_float>` | :ref:`get_line_underline_position<class_TextParagraph_method_get_line_underline_position>`\ (\ line\: :ref:`int<class_int>`\ ) |const| |
  98. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :ref:`float<class_float>` | :ref:`get_line_underline_thickness<class_TextParagraph_method_get_line_underline_thickness>`\ (\ line\: :ref:`int<class_int>`\ ) |const| |
  100. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | :ref:`float<class_float>` | :ref:`get_line_width<class_TextParagraph_method_get_line_width>`\ (\ line\: :ref:`int<class_int>`\ ) |const| |
  102. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | :ref:`Vector2<class_Vector2>` | :ref:`get_non_wrapped_size<class_TextParagraph_method_get_non_wrapped_size>`\ (\ ) |const| |
  104. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`Vector2i<class_Vector2i>` | :ref:`get_range<class_TextParagraph_method_get_range>`\ (\ ) |const| |
  106. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | :ref:`RID<class_RID>` | :ref:`get_rid<class_TextParagraph_method_get_rid>`\ (\ ) |const| |
  108. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | :ref:`Vector2<class_Vector2>` | :ref:`get_size<class_TextParagraph_method_get_size>`\ (\ ) |const| |
  110. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | :ref:`int<class_int>` | :ref:`hit_test<class_TextParagraph_method_hit_test>`\ (\ coords\: :ref:`Vector2<class_Vector2>`\ ) |const| |
  112. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | :ref:`bool<class_bool>` | :ref:`resize_object<class_TextParagraph_method_resize_object>`\ (\ key\: :ref:`Variant<class_Variant>`, size\: :ref:`Vector2<class_Vector2>`, inline_align\: :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` = 5, baseline\: :ref:`float<class_float>` = 0.0\ ) |
  114. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | |void| | :ref:`set_bidi_override<class_TextParagraph_method_set_bidi_override>`\ (\ override\: :ref:`Array<class_Array>`\ ) |
  116. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | :ref:`bool<class_bool>` | :ref:`set_dropcap<class_TextParagraph_method_set_dropcap>`\ (\ text\: :ref:`String<class_String>`, font\: :ref:`Font<class_Font>`, font_size\: :ref:`int<class_int>`, dropcap_margins\: :ref:`Rect2<class_Rect2>` = Rect2(0, 0, 0, 0), language\: :ref:`String<class_String>` = ""\ ) |
  118. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | |void| | :ref:`tab_align<class_TextParagraph_method_tab_align>`\ (\ tab_stops\: :ref:`PackedFloat32Array<class_PackedFloat32Array>`\ ) |
  120. +---------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. .. rst-class:: classref-section-separator
  122. ----
  123. .. rst-class:: classref-descriptions-group
  124. Property Descriptions
  125. ---------------------
  126. .. _class_TextParagraph_property_alignment:
  127. .. rst-class:: classref-property
  128. :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **alignment** = ``0`` :ref:`🔗<class_TextParagraph_property_alignment>`
  129. .. rst-class:: classref-property-setget
  130. - |void| **set_alignment**\ (\ value\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>`\ )
  131. - :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **get_alignment**\ (\ )
  132. Paragraph horizontal alignment.
  133. .. rst-class:: classref-item-separator
  134. ----
  135. .. _class_TextParagraph_property_break_flags:
  136. .. rst-class:: classref-property
  137. |bitfield|\[:ref:`LineBreakFlag<enum_TextServer_LineBreakFlag>`\] **break_flags** = ``3`` :ref:`🔗<class_TextParagraph_property_break_flags>`
  138. .. rst-class:: classref-property-setget
  139. - |void| **set_break_flags**\ (\ value\: |bitfield|\[:ref:`LineBreakFlag<enum_TextServer_LineBreakFlag>`\]\ )
  140. - |bitfield|\[:ref:`LineBreakFlag<enum_TextServer_LineBreakFlag>`\] **get_break_flags**\ (\ )
  141. Line breaking rules. For more info see :ref:`TextServer<class_TextServer>`.
  142. .. rst-class:: classref-item-separator
  143. ----
  144. .. _class_TextParagraph_property_custom_punctuation:
  145. .. rst-class:: classref-property
  146. :ref:`String<class_String>` **custom_punctuation** = ``""`` :ref:`🔗<class_TextParagraph_property_custom_punctuation>`
  147. .. rst-class:: classref-property-setget
  148. - |void| **set_custom_punctuation**\ (\ value\: :ref:`String<class_String>`\ )
  149. - :ref:`String<class_String>` **get_custom_punctuation**\ (\ )
  150. Custom punctuation character list, used for word breaking. If set to empty string, server defaults are used.
  151. .. rst-class:: classref-item-separator
  152. ----
  153. .. _class_TextParagraph_property_direction:
  154. .. rst-class:: classref-property
  155. :ref:`Direction<enum_TextServer_Direction>` **direction** = ``0`` :ref:`🔗<class_TextParagraph_property_direction>`
  156. .. rst-class:: classref-property-setget
  157. - |void| **set_direction**\ (\ value\: :ref:`Direction<enum_TextServer_Direction>`\ )
  158. - :ref:`Direction<enum_TextServer_Direction>` **get_direction**\ (\ )
  159. Text writing direction.
  160. .. rst-class:: classref-item-separator
  161. ----
  162. .. _class_TextParagraph_property_ellipsis_char:
  163. .. rst-class:: classref-property
  164. :ref:`String<class_String>` **ellipsis_char** = ``"…"`` :ref:`🔗<class_TextParagraph_property_ellipsis_char>`
  165. .. rst-class:: classref-property-setget
  166. - |void| **set_ellipsis_char**\ (\ value\: :ref:`String<class_String>`\ )
  167. - :ref:`String<class_String>` **get_ellipsis_char**\ (\ )
  168. Ellipsis character used for text clipping.
  169. .. rst-class:: classref-item-separator
  170. ----
  171. .. _class_TextParagraph_property_justification_flags:
  172. .. rst-class:: classref-property
  173. |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] **justification_flags** = ``163`` :ref:`🔗<class_TextParagraph_property_justification_flags>`
  174. .. rst-class:: classref-property-setget
  175. - |void| **set_justification_flags**\ (\ value\: |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\]\ )
  176. - |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] **get_justification_flags**\ (\ )
  177. Line fill alignment rules.
  178. .. rst-class:: classref-item-separator
  179. ----
  180. .. _class_TextParagraph_property_line_spacing:
  181. .. rst-class:: classref-property
  182. :ref:`float<class_float>` **line_spacing** = ``0.0`` :ref:`🔗<class_TextParagraph_property_line_spacing>`
  183. .. rst-class:: classref-property-setget
  184. - |void| **set_line_spacing**\ (\ value\: :ref:`float<class_float>`\ )
  185. - :ref:`float<class_float>` **get_line_spacing**\ (\ )
  186. Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
  187. .. rst-class:: classref-item-separator
  188. ----
  189. .. _class_TextParagraph_property_max_lines_visible:
  190. .. rst-class:: classref-property
  191. :ref:`int<class_int>` **max_lines_visible** = ``-1`` :ref:`🔗<class_TextParagraph_property_max_lines_visible>`
  192. .. rst-class:: classref-property-setget
  193. - |void| **set_max_lines_visible**\ (\ value\: :ref:`int<class_int>`\ )
  194. - :ref:`int<class_int>` **get_max_lines_visible**\ (\ )
  195. Limits the lines of text shown.
  196. .. rst-class:: classref-item-separator
  197. ----
  198. .. _class_TextParagraph_property_orientation:
  199. .. rst-class:: classref-property
  200. :ref:`Orientation<enum_TextServer_Orientation>` **orientation** = ``0`` :ref:`🔗<class_TextParagraph_property_orientation>`
  201. .. rst-class:: classref-property-setget
  202. - |void| **set_orientation**\ (\ value\: :ref:`Orientation<enum_TextServer_Orientation>`\ )
  203. - :ref:`Orientation<enum_TextServer_Orientation>` **get_orientation**\ (\ )
  204. Text orientation.
  205. .. rst-class:: classref-item-separator
  206. ----
  207. .. _class_TextParagraph_property_preserve_control:
  208. .. rst-class:: classref-property
  209. :ref:`bool<class_bool>` **preserve_control** = ``false`` :ref:`🔗<class_TextParagraph_property_preserve_control>`
  210. .. rst-class:: classref-property-setget
  211. - |void| **set_preserve_control**\ (\ value\: :ref:`bool<class_bool>`\ )
  212. - :ref:`bool<class_bool>` **get_preserve_control**\ (\ )
  213. If set to ``true`` text will display control characters.
  214. .. rst-class:: classref-item-separator
  215. ----
  216. .. _class_TextParagraph_property_preserve_invalid:
  217. .. rst-class:: classref-property
  218. :ref:`bool<class_bool>` **preserve_invalid** = ``true`` :ref:`🔗<class_TextParagraph_property_preserve_invalid>`
  219. .. rst-class:: classref-property-setget
  220. - |void| **set_preserve_invalid**\ (\ value\: :ref:`bool<class_bool>`\ )
  221. - :ref:`bool<class_bool>` **get_preserve_invalid**\ (\ )
  222. If set to ``true`` text will display invalid characters.
  223. .. rst-class:: classref-item-separator
  224. ----
  225. .. _class_TextParagraph_property_text_overrun_behavior:
  226. .. rst-class:: classref-property
  227. :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` **text_overrun_behavior** = ``0`` :ref:`🔗<class_TextParagraph_property_text_overrun_behavior>`
  228. .. rst-class:: classref-property-setget
  229. - |void| **set_text_overrun_behavior**\ (\ value\: :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>`\ )
  230. - :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` **get_text_overrun_behavior**\ (\ )
  231. The clipping behavior when the text exceeds the paragraph's set width.
  232. .. rst-class:: classref-item-separator
  233. ----
  234. .. _class_TextParagraph_property_width:
  235. .. rst-class:: classref-property
  236. :ref:`float<class_float>` **width** = ``-1.0`` :ref:`🔗<class_TextParagraph_property_width>`
  237. .. rst-class:: classref-property-setget
  238. - |void| **set_width**\ (\ value\: :ref:`float<class_float>`\ )
  239. - :ref:`float<class_float>` **get_width**\ (\ )
  240. Paragraph width.
  241. .. rst-class:: classref-section-separator
  242. ----
  243. .. rst-class:: classref-descriptions-group
  244. Method Descriptions
  245. -------------------
  246. .. _class_TextParagraph_method_add_object:
  247. .. rst-class:: classref-method
  248. :ref:`bool<class_bool>` **add_object**\ (\ key\: :ref:`Variant<class_Variant>`, size\: :ref:`Vector2<class_Vector2>`, inline_align\: :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` = 5, length\: :ref:`int<class_int>` = 1, baseline\: :ref:`float<class_float>` = 0.0\ ) :ref:`🔗<class_TextParagraph_method_add_object>`
  249. Adds inline object to the text buffer, ``key`` must be unique. In the text, object is represented as ``length`` object replacement characters.
  250. .. rst-class:: classref-item-separator
  251. ----
  252. .. _class_TextParagraph_method_add_string:
  253. .. rst-class:: classref-method
  254. :ref:`bool<class_bool>` **add_string**\ (\ text\: :ref:`String<class_String>`, font\: :ref:`Font<class_Font>`, font_size\: :ref:`int<class_int>`, language\: :ref:`String<class_String>` = "", meta\: :ref:`Variant<class_Variant>` = null\ ) :ref:`🔗<class_TextParagraph_method_add_string>`
  255. Adds text span and font to draw it.
  256. .. rst-class:: classref-item-separator
  257. ----
  258. .. _class_TextParagraph_method_clear:
  259. .. rst-class:: classref-method
  260. |void| **clear**\ (\ ) :ref:`🔗<class_TextParagraph_method_clear>`
  261. Clears text paragraph (removes text and inline objects).
  262. .. rst-class:: classref-item-separator
  263. ----
  264. .. _class_TextParagraph_method_clear_dropcap:
  265. .. rst-class:: classref-method
  266. |void| **clear_dropcap**\ (\ ) :ref:`🔗<class_TextParagraph_method_clear_dropcap>`
  267. Removes dropcap.
  268. .. rst-class:: classref-item-separator
  269. ----
  270. .. _class_TextParagraph_method_draw:
  271. .. rst-class:: classref-method
  272. |void| **draw**\ (\ canvas\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), dc_color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| :ref:`🔗<class_TextParagraph_method_draw>`
  273. Draw all lines of the text and drop cap into a canvas item at a given position, with ``color``. ``pos`` specifies the top left corner of the bounding box. If ``oversampling`` is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.
  274. .. rst-class:: classref-item-separator
  275. ----
  276. .. _class_TextParagraph_method_draw_dropcap:
  277. .. rst-class:: classref-method
  278. |void| **draw_dropcap**\ (\ canvas\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| :ref:`🔗<class_TextParagraph_method_draw_dropcap>`
  279. Draw drop cap into a canvas item at a given position, with ``color``. ``pos`` specifies the top left corner of the bounding box. If ``oversampling`` is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.
  280. .. rst-class:: classref-item-separator
  281. ----
  282. .. _class_TextParagraph_method_draw_dropcap_outline:
  283. .. rst-class:: classref-method
  284. |void| **draw_dropcap_outline**\ (\ canvas\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, outline_size\: :ref:`int<class_int>` = 1, color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| :ref:`🔗<class_TextParagraph_method_draw_dropcap_outline>`
  285. Draw drop cap outline into a canvas item at a given position, with ``color``. ``pos`` specifies the top left corner of the bounding box. If ``oversampling`` is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.
  286. .. rst-class:: classref-item-separator
  287. ----
  288. .. _class_TextParagraph_method_draw_line:
  289. .. rst-class:: classref-method
  290. |void| **draw_line**\ (\ canvas\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, line\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| :ref:`🔗<class_TextParagraph_method_draw_line>`
  291. Draw single line of text into a canvas item at a given position, with ``color``. ``pos`` specifies the top left corner of the bounding box. If ``oversampling`` is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.
  292. .. rst-class:: classref-item-separator
  293. ----
  294. .. _class_TextParagraph_method_draw_line_outline:
  295. .. rst-class:: classref-method
  296. |void| **draw_line_outline**\ (\ canvas\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, line\: :ref:`int<class_int>`, outline_size\: :ref:`int<class_int>` = 1, color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| :ref:`🔗<class_TextParagraph_method_draw_line_outline>`
  297. Draw outline of the single line of text into a canvas item at a given position, with ``color``. ``pos`` specifies the top left corner of the bounding box. If ``oversampling`` is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.
  298. .. rst-class:: classref-item-separator
  299. ----
  300. .. _class_TextParagraph_method_draw_outline:
  301. .. rst-class:: classref-method
  302. |void| **draw_outline**\ (\ canvas\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, outline_size\: :ref:`int<class_int>` = 1, color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), dc_color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| :ref:`🔗<class_TextParagraph_method_draw_outline>`
  303. Draw outlines of all lines of the text and drop cap into a canvas item at a given position, with ``color``. ``pos`` specifies the top left corner of the bounding box. If ``oversampling`` is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.
  304. .. rst-class:: classref-item-separator
  305. ----
  306. .. _class_TextParagraph_method_get_dropcap_lines:
  307. .. rst-class:: classref-method
  308. :ref:`int<class_int>` **get_dropcap_lines**\ (\ ) |const| :ref:`🔗<class_TextParagraph_method_get_dropcap_lines>`
  309. Returns number of lines used by dropcap.
  310. .. rst-class:: classref-item-separator
  311. ----
  312. .. _class_TextParagraph_method_get_dropcap_rid:
  313. .. rst-class:: classref-method
  314. :ref:`RID<class_RID>` **get_dropcap_rid**\ (\ ) |const| :ref:`🔗<class_TextParagraph_method_get_dropcap_rid>`
  315. Returns drop cap text buffer RID.
  316. .. rst-class:: classref-item-separator
  317. ----
  318. .. _class_TextParagraph_method_get_dropcap_size:
  319. .. rst-class:: classref-method
  320. :ref:`Vector2<class_Vector2>` **get_dropcap_size**\ (\ ) |const| :ref:`🔗<class_TextParagraph_method_get_dropcap_size>`
  321. Returns drop cap bounding box size.
  322. .. rst-class:: classref-item-separator
  323. ----
  324. .. _class_TextParagraph_method_get_inferred_direction:
  325. .. rst-class:: classref-method
  326. :ref:`Direction<enum_TextServer_Direction>` **get_inferred_direction**\ (\ ) |const| :ref:`🔗<class_TextParagraph_method_get_inferred_direction>`
  327. Returns the text writing direction inferred by the BiDi algorithm.
  328. .. rst-class:: classref-item-separator
  329. ----
  330. .. _class_TextParagraph_method_get_line_ascent:
  331. .. rst-class:: classref-method
  332. :ref:`float<class_float>` **get_line_ascent**\ (\ line\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TextParagraph_method_get_line_ascent>`
  333. Returns the text line ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical).
  334. .. rst-class:: classref-item-separator
  335. ----
  336. .. _class_TextParagraph_method_get_line_count:
  337. .. rst-class:: classref-method
  338. :ref:`int<class_int>` **get_line_count**\ (\ ) |const| :ref:`🔗<class_TextParagraph_method_get_line_count>`
  339. Returns number of lines in the paragraph.
  340. .. rst-class:: classref-item-separator
  341. ----
  342. .. _class_TextParagraph_method_get_line_descent:
  343. .. rst-class:: classref-method
  344. :ref:`float<class_float>` **get_line_descent**\ (\ line\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TextParagraph_method_get_line_descent>`
  345. Returns the text line descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical).
  346. .. rst-class:: classref-item-separator
  347. ----
  348. .. _class_TextParagraph_method_get_line_object_rect:
  349. .. rst-class:: classref-method
  350. :ref:`Rect2<class_Rect2>` **get_line_object_rect**\ (\ line\: :ref:`int<class_int>`, key\: :ref:`Variant<class_Variant>`\ ) |const| :ref:`🔗<class_TextParagraph_method_get_line_object_rect>`
  351. Returns bounding rectangle of the inline object.
  352. .. rst-class:: classref-item-separator
  353. ----
  354. .. _class_TextParagraph_method_get_line_objects:
  355. .. rst-class:: classref-method
  356. :ref:`Array<class_Array>` **get_line_objects**\ (\ line\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TextParagraph_method_get_line_objects>`
  357. Returns array of inline objects in the line.
  358. .. rst-class:: classref-item-separator
  359. ----
  360. .. _class_TextParagraph_method_get_line_range:
  361. .. rst-class:: classref-method
  362. :ref:`Vector2i<class_Vector2i>` **get_line_range**\ (\ line\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TextParagraph_method_get_line_range>`
  363. Returns character range of the line.
  364. .. rst-class:: classref-item-separator
  365. ----
  366. .. _class_TextParagraph_method_get_line_rid:
  367. .. rst-class:: classref-method
  368. :ref:`RID<class_RID>` **get_line_rid**\ (\ line\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TextParagraph_method_get_line_rid>`
  369. Returns TextServer line buffer RID.
  370. .. rst-class:: classref-item-separator
  371. ----
  372. .. _class_TextParagraph_method_get_line_size:
  373. .. rst-class:: classref-method
  374. :ref:`Vector2<class_Vector2>` **get_line_size**\ (\ line\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TextParagraph_method_get_line_size>`
  375. Returns size of the bounding box of the line of text. Returned size is rounded up.
  376. .. rst-class:: classref-item-separator
  377. ----
  378. .. _class_TextParagraph_method_get_line_underline_position:
  379. .. rst-class:: classref-method
  380. :ref:`float<class_float>` **get_line_underline_position**\ (\ line\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TextParagraph_method_get_line_underline_position>`
  381. Returns pixel offset of the underline below the baseline.
  382. .. rst-class:: classref-item-separator
  383. ----
  384. .. _class_TextParagraph_method_get_line_underline_thickness:
  385. .. rst-class:: classref-method
  386. :ref:`float<class_float>` **get_line_underline_thickness**\ (\ line\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TextParagraph_method_get_line_underline_thickness>`
  387. Returns thickness of the underline.
  388. .. rst-class:: classref-item-separator
  389. ----
  390. .. _class_TextParagraph_method_get_line_width:
  391. .. rst-class:: classref-method
  392. :ref:`float<class_float>` **get_line_width**\ (\ line\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TextParagraph_method_get_line_width>`
  393. Returns width (for horizontal layout) or height (for vertical) of the line of text.
  394. .. rst-class:: classref-item-separator
  395. ----
  396. .. _class_TextParagraph_method_get_non_wrapped_size:
  397. .. rst-class:: classref-method
  398. :ref:`Vector2<class_Vector2>` **get_non_wrapped_size**\ (\ ) |const| :ref:`🔗<class_TextParagraph_method_get_non_wrapped_size>`
  399. Returns the size of the bounding box of the paragraph, without line breaks.
  400. .. rst-class:: classref-item-separator
  401. ----
  402. .. _class_TextParagraph_method_get_range:
  403. .. rst-class:: classref-method
  404. :ref:`Vector2i<class_Vector2i>` **get_range**\ (\ ) |const| :ref:`🔗<class_TextParagraph_method_get_range>`
  405. Returns the character range of the paragraph.
  406. .. rst-class:: classref-item-separator
  407. ----
  408. .. _class_TextParagraph_method_get_rid:
  409. .. rst-class:: classref-method
  410. :ref:`RID<class_RID>` **get_rid**\ (\ ) |const| :ref:`🔗<class_TextParagraph_method_get_rid>`
  411. Returns TextServer full string buffer RID.
  412. .. rst-class:: classref-item-separator
  413. ----
  414. .. _class_TextParagraph_method_get_size:
  415. .. rst-class:: classref-method
  416. :ref:`Vector2<class_Vector2>` **get_size**\ (\ ) |const| :ref:`🔗<class_TextParagraph_method_get_size>`
  417. Returns the size of the bounding box of the paragraph.
  418. .. rst-class:: classref-item-separator
  419. ----
  420. .. _class_TextParagraph_method_hit_test:
  421. .. rst-class:: classref-method
  422. :ref:`int<class_int>` **hit_test**\ (\ coords\: :ref:`Vector2<class_Vector2>`\ ) |const| :ref:`🔗<class_TextParagraph_method_hit_test>`
  423. Returns caret character offset at the specified coordinates. This function always returns a valid position.
  424. .. rst-class:: classref-item-separator
  425. ----
  426. .. _class_TextParagraph_method_resize_object:
  427. .. rst-class:: classref-method
  428. :ref:`bool<class_bool>` **resize_object**\ (\ key\: :ref:`Variant<class_Variant>`, size\: :ref:`Vector2<class_Vector2>`, inline_align\: :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` = 5, baseline\: :ref:`float<class_float>` = 0.0\ ) :ref:`🔗<class_TextParagraph_method_resize_object>`
  429. Sets new size and alignment of embedded object.
  430. .. rst-class:: classref-item-separator
  431. ----
  432. .. _class_TextParagraph_method_set_bidi_override:
  433. .. rst-class:: classref-method
  434. |void| **set_bidi_override**\ (\ override\: :ref:`Array<class_Array>`\ ) :ref:`🔗<class_TextParagraph_method_set_bidi_override>`
  435. Overrides BiDi for the structured text.
  436. Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately.
  437. .. rst-class:: classref-item-separator
  438. ----
  439. .. _class_TextParagraph_method_set_dropcap:
  440. .. rst-class:: classref-method
  441. :ref:`bool<class_bool>` **set_dropcap**\ (\ text\: :ref:`String<class_String>`, font\: :ref:`Font<class_Font>`, font_size\: :ref:`int<class_int>`, dropcap_margins\: :ref:`Rect2<class_Rect2>` = Rect2(0, 0, 0, 0), language\: :ref:`String<class_String>` = ""\ ) :ref:`🔗<class_TextParagraph_method_set_dropcap>`
  442. Sets drop cap, overrides previously set drop cap. Drop cap (dropped capital) is a decorative element at the beginning of a paragraph that is larger than the rest of the text.
  443. .. rst-class:: classref-item-separator
  444. ----
  445. .. _class_TextParagraph_method_tab_align:
  446. .. rst-class:: classref-method
  447. |void| **tab_align**\ (\ tab_stops\: :ref:`PackedFloat32Array<class_PackedFloat32Array>`\ ) :ref:`🔗<class_TextParagraph_method_tab_align>`
  448. Aligns paragraph to the given tab-stops.
  449. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  450. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  451. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  452. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  453. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  454. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  455. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  456. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  457. .. |void| replace:: :abbr:`void (No return value.)`