class_textparagraph.rst 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  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. Description
  12. -----------
  13. Abstraction over :ref:`TextServer<class_TextServer>` for handling paragraph of text.
  14. Properties
  15. ----------
  16. +-------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  17. | :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` | :ref:`alignment<class_TextParagraph_property_alignment>` | ``0`` |
  18. +-------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  19. | :ref:`LineBreakFlag<enum_TextServer_LineBreakFlag>` | :ref:`break_flags<class_TextParagraph_property_break_flags>` | ``3`` |
  20. +-------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  21. | :ref:`String<class_String>` | :ref:`custom_punctuation<class_TextParagraph_property_custom_punctuation>` | ``""`` |
  22. +-------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  23. | :ref:`Direction<enum_TextServer_Direction>` | :ref:`direction<class_TextParagraph_property_direction>` | ``0`` |
  24. +-------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  25. | :ref:`JustificationFlag<enum_TextServer_JustificationFlag>` | :ref:`justification_flags<class_TextParagraph_property_justification_flags>` | ``3`` |
  26. +-------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  27. | :ref:`int<class_int>` | :ref:`max_lines_visible<class_TextParagraph_property_max_lines_visible>` | ``-1`` |
  28. +-------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  29. | :ref:`Orientation<enum_TextServer_Orientation>` | :ref:`orientation<class_TextParagraph_property_orientation>` | ``0`` |
  30. +-------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  31. | :ref:`bool<class_bool>` | :ref:`preserve_control<class_TextParagraph_property_preserve_control>` | ``false`` |
  32. +-------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  33. | :ref:`bool<class_bool>` | :ref:`preserve_invalid<class_TextParagraph_property_preserve_invalid>` | ``true`` |
  34. +-------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  35. | :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` | :ref:`text_overrun_behavior<class_TextParagraph_property_text_overrun_behavior>` | ``0`` |
  36. +-------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  37. | :ref:`float<class_float>` | :ref:`width<class_TextParagraph_property_width>` | ``-1.0`` |
  38. +-------------------------------------------------------------------+----------------------------------------------------------------------------------+-----------+
  39. Methods
  40. -------
  41. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`bool<class_bool>` | :ref:`add_object<class_TextParagraph_method_add_object>` **(** :ref:`Variant<class_Variant>` key, :ref:`Vector2<class_Vector2>` size, :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` inline_align=5, :ref:`int<class_int>` length=1 **)** |
  43. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`bool<class_bool>` | :ref:`add_string<class_TextParagraph_method_add_string>` **(** :ref:`String<class_String>` text, :ref:`Font<class_Font>` font, :ref:`int<class_int>` font_size, :ref:`String<class_String>` language="", :ref:`Variant<class_Variant>` meta=null **)** |
  45. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | void | :ref:`clear<class_TextParagraph_method_clear>` **(** **)** |
  47. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | void | :ref:`clear_dropcap<class_TextParagraph_method_clear_dropcap>` **(** **)** |
  49. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | void | :ref:`draw<class_TextParagraph_method_draw>` **(** :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1), :ref:`Color<class_Color>` dc_color=Color(1, 1, 1, 1) **)** |const| |
  51. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | void | :ref:`draw_dropcap<class_TextParagraph_method_draw_dropcap>` **(** :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1) **)** |const| |
  53. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | void | :ref:`draw_dropcap_outline<class_TextParagraph_method_draw_dropcap_outline>` **(** :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` outline_size=1, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1) **)** |const| |
  55. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | void | :ref:`draw_line<class_TextParagraph_method_draw_line>` **(** :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` line, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1) **)** |const| |
  57. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | void | :ref:`draw_line_outline<class_TextParagraph_method_draw_line_outline>` **(** :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` line, :ref:`int<class_int>` outline_size=1, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1) **)** |const| |
  59. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | void | :ref:`draw_outline<class_TextParagraph_method_draw_outline>` **(** :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` outline_size=1, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1), :ref:`Color<class_Color>` dc_color=Color(1, 1, 1, 1) **)** |const| |
  61. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`int<class_int>` | :ref:`get_dropcap_lines<class_TextParagraph_method_get_dropcap_lines>` **(** **)** |const| |
  63. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`RID<class_RID>` | :ref:`get_dropcap_rid<class_TextParagraph_method_get_dropcap_rid>` **(** **)** |const| |
  65. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`Vector2<class_Vector2>` | :ref:`get_dropcap_size<class_TextParagraph_method_get_dropcap_size>` **(** **)** |const| |
  67. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`float<class_float>` | :ref:`get_line_ascent<class_TextParagraph_method_get_line_ascent>` **(** :ref:`int<class_int>` line **)** |const| |
  69. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`int<class_int>` | :ref:`get_line_count<class_TextParagraph_method_get_line_count>` **(** **)** |const| |
  71. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`float<class_float>` | :ref:`get_line_descent<class_TextParagraph_method_get_line_descent>` **(** :ref:`int<class_int>` line **)** |const| |
  73. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`Rect2<class_Rect2>` | :ref:`get_line_object_rect<class_TextParagraph_method_get_line_object_rect>` **(** :ref:`int<class_int>` line, :ref:`Variant<class_Variant>` key **)** |const| |
  75. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`Array<class_Array>` | :ref:`get_line_objects<class_TextParagraph_method_get_line_objects>` **(** :ref:`int<class_int>` line **)** |const| |
  77. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`Vector2i<class_Vector2i>` | :ref:`get_line_range<class_TextParagraph_method_get_line_range>` **(** :ref:`int<class_int>` line **)** |const| |
  79. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`RID<class_RID>` | :ref:`get_line_rid<class_TextParagraph_method_get_line_rid>` **(** :ref:`int<class_int>` line **)** |const| |
  81. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`Vector2<class_Vector2>` | :ref:`get_line_size<class_TextParagraph_method_get_line_size>` **(** :ref:`int<class_int>` line **)** |const| |
  83. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`float<class_float>` | :ref:`get_line_underline_position<class_TextParagraph_method_get_line_underline_position>` **(** :ref:`int<class_int>` line **)** |const| |
  85. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`float<class_float>` | :ref:`get_line_underline_thickness<class_TextParagraph_method_get_line_underline_thickness>` **(** :ref:`int<class_int>` line **)** |const| |
  87. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`float<class_float>` | :ref:`get_line_width<class_TextParagraph_method_get_line_width>` **(** :ref:`int<class_int>` line **)** |const| |
  89. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`Vector2<class_Vector2>` | :ref:`get_non_wrapped_size<class_TextParagraph_method_get_non_wrapped_size>` **(** **)** |const| |
  91. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`RID<class_RID>` | :ref:`get_rid<class_TextParagraph_method_get_rid>` **(** **)** |const| |
  93. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`Vector2<class_Vector2>` | :ref:`get_size<class_TextParagraph_method_get_size>` **(** **)** |const| |
  95. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`int<class_int>` | :ref:`hit_test<class_TextParagraph_method_hit_test>` **(** :ref:`Vector2<class_Vector2>` coords **)** |const| |
  97. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`bool<class_bool>` | :ref:`resize_object<class_TextParagraph_method_resize_object>` **(** :ref:`Variant<class_Variant>` key, :ref:`Vector2<class_Vector2>` size, :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` inline_align=5 **)** |
  99. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | void | :ref:`set_bidi_override<class_TextParagraph_method_set_bidi_override>` **(** :ref:`Array<class_Array>` override **)** |
  101. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`bool<class_bool>` | :ref:`set_dropcap<class_TextParagraph_method_set_dropcap>` **(** :ref:`String<class_String>` text, :ref:`Font<class_Font>` font, :ref:`int<class_int>` font_size, :ref:`Rect2<class_Rect2>` dropcap_margins=Rect2(0, 0, 0, 0), :ref:`String<class_String>` language="" **)** |
  103. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | void | :ref:`tab_align<class_TextParagraph_method_tab_align>` **(** :ref:`PackedFloat32Array<class_PackedFloat32Array>` tab_stops **)** |
  105. +---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. Property Descriptions
  107. ---------------------
  108. .. _class_TextParagraph_property_alignment:
  109. - :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **alignment**
  110. +-----------+----------------------+
  111. | *Default* | ``0`` |
  112. +-----------+----------------------+
  113. | *Setter* | set_alignment(value) |
  114. +-----------+----------------------+
  115. | *Getter* | get_alignment() |
  116. +-----------+----------------------+
  117. Paragraph horizontal alignment.
  118. ----
  119. .. _class_TextParagraph_property_break_flags:
  120. - :ref:`LineBreakFlag<enum_TextServer_LineBreakFlag>` **break_flags**
  121. +-----------+------------------------+
  122. | *Default* | ``3`` |
  123. +-----------+------------------------+
  124. | *Setter* | set_break_flags(value) |
  125. +-----------+------------------------+
  126. | *Getter* | get_break_flags() |
  127. +-----------+------------------------+
  128. Line breaking rules. For more info see :ref:`TextServer<class_TextServer>`.
  129. ----
  130. .. _class_TextParagraph_property_custom_punctuation:
  131. - :ref:`String<class_String>` **custom_punctuation**
  132. +-----------+-------------------------------+
  133. | *Default* | ``""`` |
  134. +-----------+-------------------------------+
  135. | *Setter* | set_custom_punctuation(value) |
  136. +-----------+-------------------------------+
  137. | *Getter* | get_custom_punctuation() |
  138. +-----------+-------------------------------+
  139. Custom punctuation character list, used for word breaking. If set to empty string, server defaults are used.
  140. ----
  141. .. _class_TextParagraph_property_direction:
  142. - :ref:`Direction<enum_TextServer_Direction>` **direction**
  143. +-----------+----------------------+
  144. | *Default* | ``0`` |
  145. +-----------+----------------------+
  146. | *Setter* | set_direction(value) |
  147. +-----------+----------------------+
  148. | *Getter* | get_direction() |
  149. +-----------+----------------------+
  150. Text writing direction.
  151. ----
  152. .. _class_TextParagraph_property_justification_flags:
  153. - :ref:`JustificationFlag<enum_TextServer_JustificationFlag>` **justification_flags**
  154. +-----------+--------------------------------+
  155. | *Default* | ``3`` |
  156. +-----------+--------------------------------+
  157. | *Setter* | set_justification_flags(value) |
  158. +-----------+--------------------------------+
  159. | *Getter* | get_justification_flags() |
  160. +-----------+--------------------------------+
  161. Line alignment rules. For more info see :ref:`TextServer<class_TextServer>`.
  162. ----
  163. .. _class_TextParagraph_property_max_lines_visible:
  164. - :ref:`int<class_int>` **max_lines_visible**
  165. +-----------+------------------------------+
  166. | *Default* | ``-1`` |
  167. +-----------+------------------------------+
  168. | *Setter* | set_max_lines_visible(value) |
  169. +-----------+------------------------------+
  170. | *Getter* | get_max_lines_visible() |
  171. +-----------+------------------------------+
  172. Limits the lines of text shown.
  173. ----
  174. .. _class_TextParagraph_property_orientation:
  175. - :ref:`Orientation<enum_TextServer_Orientation>` **orientation**
  176. +-----------+------------------------+
  177. | *Default* | ``0`` |
  178. +-----------+------------------------+
  179. | *Setter* | set_orientation(value) |
  180. +-----------+------------------------+
  181. | *Getter* | get_orientation() |
  182. +-----------+------------------------+
  183. Text orientation.
  184. ----
  185. .. _class_TextParagraph_property_preserve_control:
  186. - :ref:`bool<class_bool>` **preserve_control**
  187. +-----------+-----------------------------+
  188. | *Default* | ``false`` |
  189. +-----------+-----------------------------+
  190. | *Setter* | set_preserve_control(value) |
  191. +-----------+-----------------------------+
  192. | *Getter* | get_preserve_control() |
  193. +-----------+-----------------------------+
  194. If set to ``true`` text will display control characters.
  195. ----
  196. .. _class_TextParagraph_property_preserve_invalid:
  197. - :ref:`bool<class_bool>` **preserve_invalid**
  198. +-----------+-----------------------------+
  199. | *Default* | ``true`` |
  200. +-----------+-----------------------------+
  201. | *Setter* | set_preserve_invalid(value) |
  202. +-----------+-----------------------------+
  203. | *Getter* | get_preserve_invalid() |
  204. +-----------+-----------------------------+
  205. If set to ``true`` text will display invalid characters.
  206. ----
  207. .. _class_TextParagraph_property_text_overrun_behavior:
  208. - :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` **text_overrun_behavior**
  209. +-----------+----------------------------------+
  210. | *Default* | ``0`` |
  211. +-----------+----------------------------------+
  212. | *Setter* | set_text_overrun_behavior(value) |
  213. +-----------+----------------------------------+
  214. | *Getter* | get_text_overrun_behavior() |
  215. +-----------+----------------------------------+
  216. Sets the clipping behavior when the text exceeds the paragraph's set width. See :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` for a description of all modes.
  217. ----
  218. .. _class_TextParagraph_property_width:
  219. - :ref:`float<class_float>` **width**
  220. +-----------+------------------+
  221. | *Default* | ``-1.0`` |
  222. +-----------+------------------+
  223. | *Setter* | set_width(value) |
  224. +-----------+------------------+
  225. | *Getter* | get_width() |
  226. +-----------+------------------+
  227. Paragraph width.
  228. Method Descriptions
  229. -------------------
  230. .. _class_TextParagraph_method_add_object:
  231. - :ref:`bool<class_bool>` **add_object** **(** :ref:`Variant<class_Variant>` key, :ref:`Vector2<class_Vector2>` size, :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` inline_align=5, :ref:`int<class_int>` length=1 **)**
  232. Adds inline object to the text buffer, ``key`` must be unique. In the text, object is represented as ``length`` object replacement characters.
  233. ----
  234. .. _class_TextParagraph_method_add_string:
  235. - :ref:`bool<class_bool>` **add_string** **(** :ref:`String<class_String>` text, :ref:`Font<class_Font>` font, :ref:`int<class_int>` font_size, :ref:`String<class_String>` language="", :ref:`Variant<class_Variant>` meta=null **)**
  236. Adds text span and font to draw it.
  237. ----
  238. .. _class_TextParagraph_method_clear:
  239. - void **clear** **(** **)**
  240. Clears text paragraph (removes text and inline objects).
  241. ----
  242. .. _class_TextParagraph_method_clear_dropcap:
  243. - void **clear_dropcap** **(** **)**
  244. Removes dropcap.
  245. ----
  246. .. _class_TextParagraph_method_draw:
  247. - void **draw** **(** :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1), :ref:`Color<class_Color>` dc_color=Color(1, 1, 1, 1) **)** |const|
  248. 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.
  249. ----
  250. .. _class_TextParagraph_method_draw_dropcap:
  251. - void **draw_dropcap** **(** :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1) **)** |const|
  252. Draw drop cap into a canvas item at a given position, with ``color``. ``pos`` specifies the top left corner of the bounding box.
  253. ----
  254. .. _class_TextParagraph_method_draw_dropcap_outline:
  255. - void **draw_dropcap_outline** **(** :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` outline_size=1, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1) **)** |const|
  256. Draw drop cap outline into a canvas item at a given position, with ``color``. ``pos`` specifies the top left corner of the bounding box.
  257. ----
  258. .. _class_TextParagraph_method_draw_line:
  259. - void **draw_line** **(** :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` line, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1) **)** |const|
  260. 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.
  261. ----
  262. .. _class_TextParagraph_method_draw_line_outline:
  263. - void **draw_line_outline** **(** :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` line, :ref:`int<class_int>` outline_size=1, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1) **)** |const|
  264. 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.
  265. ----
  266. .. _class_TextParagraph_method_draw_outline:
  267. - void **draw_outline** **(** :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` outline_size=1, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1), :ref:`Color<class_Color>` dc_color=Color(1, 1, 1, 1) **)** |const|
  268. 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.
  269. ----
  270. .. _class_TextParagraph_method_get_dropcap_lines:
  271. - :ref:`int<class_int>` **get_dropcap_lines** **(** **)** |const|
  272. Returns number of lines used by dropcap.
  273. ----
  274. .. _class_TextParagraph_method_get_dropcap_rid:
  275. - :ref:`RID<class_RID>` **get_dropcap_rid** **(** **)** |const|
  276. Returns drop cap text buffer RID.
  277. ----
  278. .. _class_TextParagraph_method_get_dropcap_size:
  279. - :ref:`Vector2<class_Vector2>` **get_dropcap_size** **(** **)** |const|
  280. Returns drop cap bounding box size.
  281. ----
  282. .. _class_TextParagraph_method_get_line_ascent:
  283. - :ref:`float<class_float>` **get_line_ascent** **(** :ref:`int<class_int>` line **)** |const|
  284. Returns the text line ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical).
  285. ----
  286. .. _class_TextParagraph_method_get_line_count:
  287. - :ref:`int<class_int>` **get_line_count** **(** **)** |const|
  288. Returns number of lines in the paragraph.
  289. ----
  290. .. _class_TextParagraph_method_get_line_descent:
  291. - :ref:`float<class_float>` **get_line_descent** **(** :ref:`int<class_int>` line **)** |const|
  292. Returns the text line descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical).
  293. ----
  294. .. _class_TextParagraph_method_get_line_object_rect:
  295. - :ref:`Rect2<class_Rect2>` **get_line_object_rect** **(** :ref:`int<class_int>` line, :ref:`Variant<class_Variant>` key **)** |const|
  296. Returns bounding rectangle of the inline object.
  297. ----
  298. .. _class_TextParagraph_method_get_line_objects:
  299. - :ref:`Array<class_Array>` **get_line_objects** **(** :ref:`int<class_int>` line **)** |const|
  300. Returns array of inline objects in the line.
  301. ----
  302. .. _class_TextParagraph_method_get_line_range:
  303. - :ref:`Vector2i<class_Vector2i>` **get_line_range** **(** :ref:`int<class_int>` line **)** |const|
  304. Returns character range of the line.
  305. ----
  306. .. _class_TextParagraph_method_get_line_rid:
  307. - :ref:`RID<class_RID>` **get_line_rid** **(** :ref:`int<class_int>` line **)** |const|
  308. Returns TextServer line buffer RID.
  309. ----
  310. .. _class_TextParagraph_method_get_line_size:
  311. - :ref:`Vector2<class_Vector2>` **get_line_size** **(** :ref:`int<class_int>` line **)** |const|
  312. Returns size of the bounding box of the line of text.
  313. ----
  314. .. _class_TextParagraph_method_get_line_underline_position:
  315. - :ref:`float<class_float>` **get_line_underline_position** **(** :ref:`int<class_int>` line **)** |const|
  316. Returns pixel offset of the underline below the baseline.
  317. ----
  318. .. _class_TextParagraph_method_get_line_underline_thickness:
  319. - :ref:`float<class_float>` **get_line_underline_thickness** **(** :ref:`int<class_int>` line **)** |const|
  320. Returns thickness of the underline.
  321. ----
  322. .. _class_TextParagraph_method_get_line_width:
  323. - :ref:`float<class_float>` **get_line_width** **(** :ref:`int<class_int>` line **)** |const|
  324. Returns width (for horizontal layout) or height (for vertical) of the line of text.
  325. ----
  326. .. _class_TextParagraph_method_get_non_wrapped_size:
  327. - :ref:`Vector2<class_Vector2>` **get_non_wrapped_size** **(** **)** |const|
  328. Returns the size of the bounding box of the paragraph, without line breaks.
  329. ----
  330. .. _class_TextParagraph_method_get_rid:
  331. - :ref:`RID<class_RID>` **get_rid** **(** **)** |const|
  332. Returns TextServer full string buffer RID.
  333. ----
  334. .. _class_TextParagraph_method_get_size:
  335. - :ref:`Vector2<class_Vector2>` **get_size** **(** **)** |const|
  336. Returns the size of the bounding box of the paragraph.
  337. ----
  338. .. _class_TextParagraph_method_hit_test:
  339. - :ref:`int<class_int>` **hit_test** **(** :ref:`Vector2<class_Vector2>` coords **)** |const|
  340. Returns caret character offset at the specified coordinates. This function always returns a valid position.
  341. ----
  342. .. _class_TextParagraph_method_resize_object:
  343. - :ref:`bool<class_bool>` **resize_object** **(** :ref:`Variant<class_Variant>` key, :ref:`Vector2<class_Vector2>` size, :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` inline_align=5 **)**
  344. Sets new size and alignment of embedded object.
  345. ----
  346. .. _class_TextParagraph_method_set_bidi_override:
  347. - void **set_bidi_override** **(** :ref:`Array<class_Array>` override **)**
  348. Overrides BiDi for the structured text.
  349. Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately.
  350. ----
  351. .. _class_TextParagraph_method_set_dropcap:
  352. - :ref:`bool<class_bool>` **set_dropcap** **(** :ref:`String<class_String>` text, :ref:`Font<class_Font>` font, :ref:`int<class_int>` font_size, :ref:`Rect2<class_Rect2>` dropcap_margins=Rect2(0, 0, 0, 0), :ref:`String<class_String>` language="" **)**
  353. 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.
  354. ----
  355. .. _class_TextParagraph_method_tab_align:
  356. - void **tab_align** **(** :ref:`PackedFloat32Array<class_PackedFloat32Array>` tab_stops **)**
  357. Aligns paragraph to the given tab-stops.
  358. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  359. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  360. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  361. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  362. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  363. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`