text_server_extension.cpp 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585
  1. /**************************************************************************/
  2. /* text_server_extension.cpp */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /**************************************************************************/
  30. #include "text_server_extension.h"
  31. void TextServerExtension::_bind_methods() {
  32. GDVIRTUAL_BIND(_has_feature, "feature");
  33. GDVIRTUAL_BIND(_get_name);
  34. GDVIRTUAL_BIND(_get_features);
  35. GDVIRTUAL_BIND(_free_rid, "rid");
  36. GDVIRTUAL_BIND(_has, "rid");
  37. GDVIRTUAL_BIND(_load_support_data, "filename");
  38. GDVIRTUAL_BIND(_get_support_data_filename);
  39. GDVIRTUAL_BIND(_get_support_data_info);
  40. GDVIRTUAL_BIND(_save_support_data, "filename");
  41. GDVIRTUAL_BIND(_is_locale_right_to_left, "locale");
  42. GDVIRTUAL_BIND(_name_to_tag, "name");
  43. GDVIRTUAL_BIND(_tag_to_name, "tag");
  44. /* Font interface */
  45. GDVIRTUAL_BIND(_create_font);
  46. GDVIRTUAL_BIND(_create_font_linked_variation, "font_rid");
  47. GDVIRTUAL_BIND(_font_set_data, "font_rid", "data");
  48. GDVIRTUAL_BIND(_font_set_data_ptr, "font_rid", "data_ptr", "data_size");
  49. GDVIRTUAL_BIND(_font_set_face_index, "font_rid", "face_index");
  50. GDVIRTUAL_BIND(_font_get_face_index, "font_rid");
  51. GDVIRTUAL_BIND(_font_get_face_count, "font_rid");
  52. GDVIRTUAL_BIND(_font_set_style, "font_rid", "style");
  53. GDVIRTUAL_BIND(_font_get_style, "font_rid");
  54. GDVIRTUAL_BIND(_font_set_name, "font_rid", "name");
  55. GDVIRTUAL_BIND(_font_get_name, "font_rid");
  56. GDVIRTUAL_BIND(_font_get_ot_name_strings, "font_rid");
  57. GDVIRTUAL_BIND(_font_set_style_name, "font_rid", "name_style");
  58. GDVIRTUAL_BIND(_font_get_style_name, "font_rid");
  59. GDVIRTUAL_BIND(_font_set_weight, "font_rid", "weight");
  60. GDVIRTUAL_BIND(_font_get_weight, "font_rid");
  61. GDVIRTUAL_BIND(_font_set_stretch, "font_rid", "stretch");
  62. GDVIRTUAL_BIND(_font_get_stretch, "font_rid");
  63. GDVIRTUAL_BIND(_font_set_antialiasing, "font_rid", "antialiasing");
  64. GDVIRTUAL_BIND(_font_get_antialiasing, "font_rid");
  65. GDVIRTUAL_BIND(_font_set_disable_embedded_bitmaps, "font_rid", "disable_embedded_bitmaps");
  66. GDVIRTUAL_BIND(_font_get_disable_embedded_bitmaps, "font_rid");
  67. GDVIRTUAL_BIND(_font_set_generate_mipmaps, "font_rid", "generate_mipmaps");
  68. GDVIRTUAL_BIND(_font_get_generate_mipmaps, "font_rid");
  69. GDVIRTUAL_BIND(_font_set_multichannel_signed_distance_field, "font_rid", "msdf");
  70. GDVIRTUAL_BIND(_font_is_multichannel_signed_distance_field, "font_rid");
  71. GDVIRTUAL_BIND(_font_set_msdf_pixel_range, "font_rid", "msdf_pixel_range");
  72. GDVIRTUAL_BIND(_font_get_msdf_pixel_range, "font_rid");
  73. GDVIRTUAL_BIND(_font_set_msdf_size, "font_rid", "msdf_size");
  74. GDVIRTUAL_BIND(_font_get_msdf_size, "font_rid");
  75. GDVIRTUAL_BIND(_font_set_fixed_size, "font_rid", "fixed_size");
  76. GDVIRTUAL_BIND(_font_get_fixed_size, "font_rid");
  77. GDVIRTUAL_BIND(_font_set_fixed_size_scale_mode, "font_rid", "fixed_size_scale_mode");
  78. GDVIRTUAL_BIND(_font_get_fixed_size_scale_mode, "font_rid");
  79. GDVIRTUAL_BIND(_font_set_allow_system_fallback, "font_rid", "allow_system_fallback");
  80. GDVIRTUAL_BIND(_font_is_allow_system_fallback, "font_rid");
  81. GDVIRTUAL_BIND(_font_set_force_autohinter, "font_rid", "force_autohinter");
  82. GDVIRTUAL_BIND(_font_is_force_autohinter, "font_rid");
  83. GDVIRTUAL_BIND(_font_set_hinting, "font_rid", "hinting");
  84. GDVIRTUAL_BIND(_font_get_hinting, "font_rid");
  85. GDVIRTUAL_BIND(_font_set_subpixel_positioning, "font_rid", "subpixel_positioning");
  86. GDVIRTUAL_BIND(_font_get_subpixel_positioning, "font_rid");
  87. GDVIRTUAL_BIND(_font_set_embolden, "font_rid", "strength");
  88. GDVIRTUAL_BIND(_font_get_embolden, "font_rid");
  89. GDVIRTUAL_BIND(_font_set_spacing, "font_rid", "spacing", "value");
  90. GDVIRTUAL_BIND(_font_get_spacing, "font_rid", "spacing");
  91. GDVIRTUAL_BIND(_font_set_baseline_offset, "font_rid", "baseline_offset");
  92. GDVIRTUAL_BIND(_font_get_baseline_offset, "font_rid");
  93. GDVIRTUAL_BIND(_font_set_transform, "font_rid", "transform");
  94. GDVIRTUAL_BIND(_font_get_transform, "font_rid");
  95. GDVIRTUAL_BIND(_font_set_variation_coordinates, "font_rid", "variation_coordinates");
  96. GDVIRTUAL_BIND(_font_get_variation_coordinates, "font_rid");
  97. GDVIRTUAL_BIND(_font_set_oversampling, "font_rid", "oversampling");
  98. GDVIRTUAL_BIND(_font_get_oversampling, "font_rid");
  99. GDVIRTUAL_BIND(_font_get_size_cache_list, "font_rid");
  100. GDVIRTUAL_BIND(_font_clear_size_cache, "font_rid");
  101. GDVIRTUAL_BIND(_font_remove_size_cache, "font_rid", "size");
  102. GDVIRTUAL_BIND(_font_set_ascent, "font_rid", "size", "ascent");
  103. GDVIRTUAL_BIND(_font_get_ascent, "font_rid", "size");
  104. GDVIRTUAL_BIND(_font_set_descent, "font_rid", "size", "descent");
  105. GDVIRTUAL_BIND(_font_get_descent, "font_rid", "size");
  106. GDVIRTUAL_BIND(_font_set_underline_position, "font_rid", "size", "underline_position");
  107. GDVIRTUAL_BIND(_font_get_underline_position, "font_rid", "size");
  108. GDVIRTUAL_BIND(_font_set_underline_thickness, "font_rid", "size", "underline_thickness");
  109. GDVIRTUAL_BIND(_font_get_underline_thickness, "font_rid", "size");
  110. GDVIRTUAL_BIND(_font_set_scale, "font_rid", "size", "scale");
  111. GDVIRTUAL_BIND(_font_get_scale, "font_rid", "size");
  112. GDVIRTUAL_BIND(_font_get_texture_count, "font_rid", "size");
  113. GDVIRTUAL_BIND(_font_clear_textures, "font_rid", "size");
  114. GDVIRTUAL_BIND(_font_remove_texture, "font_rid", "size", "texture_index");
  115. GDVIRTUAL_BIND(_font_set_texture_image, "font_rid", "size", "texture_index", "image");
  116. GDVIRTUAL_BIND(_font_get_texture_image, "font_rid", "size", "texture_index");
  117. GDVIRTUAL_BIND(_font_set_texture_offsets, "font_rid", "size", "texture_index", "offset");
  118. GDVIRTUAL_BIND(_font_get_texture_offsets, "font_rid", "size", "texture_index");
  119. GDVIRTUAL_BIND(_font_get_glyph_list, "font_rid", "size");
  120. GDVIRTUAL_BIND(_font_clear_glyphs, "font_rid", "size");
  121. GDVIRTUAL_BIND(_font_remove_glyph, "font_rid", "size", "glyph");
  122. GDVIRTUAL_BIND(_font_get_glyph_advance, "font_rid", "size", "glyph");
  123. GDVIRTUAL_BIND(_font_set_glyph_advance, "font_rid", "size", "glyph", "advance");
  124. GDVIRTUAL_BIND(_font_get_glyph_offset, "font_rid", "size", "glyph");
  125. GDVIRTUAL_BIND(_font_set_glyph_offset, "font_rid", "size", "glyph", "offset");
  126. GDVIRTUAL_BIND(_font_get_glyph_size, "font_rid", "size", "glyph");
  127. GDVIRTUAL_BIND(_font_set_glyph_size, "font_rid", "size", "glyph", "gl_size");
  128. GDVIRTUAL_BIND(_font_get_glyph_uv_rect, "font_rid", "size", "glyph");
  129. GDVIRTUAL_BIND(_font_set_glyph_uv_rect, "font_rid", "size", "glyph", "uv_rect");
  130. GDVIRTUAL_BIND(_font_get_glyph_texture_idx, "font_rid", "size", "glyph");
  131. GDVIRTUAL_BIND(_font_set_glyph_texture_idx, "font_rid", "size", "glyph", "texture_idx");
  132. GDVIRTUAL_BIND(_font_get_glyph_texture_rid, "font_rid", "size", "glyph");
  133. GDVIRTUAL_BIND(_font_get_glyph_texture_size, "font_rid", "size", "glyph");
  134. GDVIRTUAL_BIND(_font_get_glyph_contours, "font_rid", "size", "index");
  135. GDVIRTUAL_BIND(_font_get_kerning_list, "font_rid", "size");
  136. GDVIRTUAL_BIND(_font_clear_kerning_map, "font_rid", "size");
  137. GDVIRTUAL_BIND(_font_remove_kerning, "font_rid", "size", "glyph_pair");
  138. GDVIRTUAL_BIND(_font_set_kerning, "font_rid", "size", "glyph_pair", "kerning");
  139. GDVIRTUAL_BIND(_font_get_kerning, "font_rid", "size", "glyph_pair");
  140. GDVIRTUAL_BIND(_font_get_glyph_index, "font_rid", "size", "char", "variation_selector");
  141. GDVIRTUAL_BIND(_font_get_char_from_glyph_index, "font_rid", "size", "glyph_index");
  142. GDVIRTUAL_BIND(_font_has_char, "font_rid", "char");
  143. GDVIRTUAL_BIND(_font_get_supported_chars, "font_rid");
  144. GDVIRTUAL_BIND(_font_render_range, "font_rid", "size", "start", "end");
  145. GDVIRTUAL_BIND(_font_render_glyph, "font_rid", "size", "index");
  146. GDVIRTUAL_BIND(_font_draw_glyph, "font_rid", "canvas", "size", "pos", "index", "color");
  147. GDVIRTUAL_BIND(_font_draw_glyph_outline, "font_rid", "canvas", "size", "outline_size", "pos", "index", "color");
  148. GDVIRTUAL_BIND(_font_is_language_supported, "font_rid", "language");
  149. GDVIRTUAL_BIND(_font_set_language_support_override, "font_rid", "language", "supported");
  150. GDVIRTUAL_BIND(_font_get_language_support_override, "font_rid", "language");
  151. GDVIRTUAL_BIND(_font_remove_language_support_override, "font_rid", "language");
  152. GDVIRTUAL_BIND(_font_get_language_support_overrides, "font_rid");
  153. GDVIRTUAL_BIND(_font_is_script_supported, "font_rid", "script");
  154. GDVIRTUAL_BIND(_font_set_script_support_override, "font_rid", "script", "supported");
  155. GDVIRTUAL_BIND(_font_get_script_support_override, "font_rid", "script");
  156. GDVIRTUAL_BIND(_font_remove_script_support_override, "font_rid", "script");
  157. GDVIRTUAL_BIND(_font_get_script_support_overrides, "font_rid");
  158. GDVIRTUAL_BIND(_font_set_opentype_feature_overrides, "font_rid", "overrides");
  159. GDVIRTUAL_BIND(_font_get_opentype_feature_overrides, "font_rid");
  160. GDVIRTUAL_BIND(_font_supported_feature_list, "font_rid");
  161. GDVIRTUAL_BIND(_font_supported_variation_list, "font_rid");
  162. GDVIRTUAL_BIND(_font_get_global_oversampling);
  163. GDVIRTUAL_BIND(_font_set_global_oversampling, "oversampling");
  164. GDVIRTUAL_BIND(_get_hex_code_box_size, "size", "index");
  165. GDVIRTUAL_BIND(_draw_hex_code_box, "canvas", "size", "pos", "index", "color");
  166. /* Shaped text buffer interface */
  167. GDVIRTUAL_BIND(_create_shaped_text, "direction", "orientation");
  168. GDVIRTUAL_BIND(_shaped_text_clear, "shaped");
  169. GDVIRTUAL_BIND(_shaped_text_set_direction, "shaped", "direction");
  170. GDVIRTUAL_BIND(_shaped_text_get_direction, "shaped");
  171. GDVIRTUAL_BIND(_shaped_text_get_inferred_direction, "shaped");
  172. GDVIRTUAL_BIND(_shaped_text_set_bidi_override, "shaped", "override");
  173. GDVIRTUAL_BIND(_shaped_text_set_custom_punctuation, "shaped", "punct");
  174. GDVIRTUAL_BIND(_shaped_text_get_custom_punctuation, "shaped");
  175. GDVIRTUAL_BIND(_shaped_text_set_custom_ellipsis, "shaped", "char");
  176. GDVIRTUAL_BIND(_shaped_text_get_custom_ellipsis, "shaped");
  177. GDVIRTUAL_BIND(_shaped_text_set_orientation, "shaped", "orientation");
  178. GDVIRTUAL_BIND(_shaped_text_get_orientation, "shaped");
  179. GDVIRTUAL_BIND(_shaped_text_set_preserve_invalid, "shaped", "enabled");
  180. GDVIRTUAL_BIND(_shaped_text_get_preserve_invalid, "shaped");
  181. GDVIRTUAL_BIND(_shaped_text_set_preserve_control, "shaped", "enabled");
  182. GDVIRTUAL_BIND(_shaped_text_get_preserve_control, "shaped");
  183. GDVIRTUAL_BIND(_shaped_text_set_spacing, "shaped", "spacing", "value");
  184. GDVIRTUAL_BIND(_shaped_text_get_spacing, "shaped", "spacing");
  185. GDVIRTUAL_BIND(_shaped_text_add_string, "shaped", "text", "fonts", "size", "opentype_features", "language", "meta");
  186. GDVIRTUAL_BIND(_shaped_text_add_object, "shaped", "key", "size", "inline_align", "length", "baseline");
  187. GDVIRTUAL_BIND(_shaped_text_resize_object, "shaped", "key", "size", "inline_align", "baseline");
  188. GDVIRTUAL_BIND(_shaped_get_span_count, "shaped");
  189. GDVIRTUAL_BIND(_shaped_get_span_meta, "shaped", "index");
  190. GDVIRTUAL_BIND(_shaped_set_span_update_font, "shaped", "index", "fonts", "size", "opentype_features");
  191. GDVIRTUAL_BIND(_shaped_text_substr, "shaped", "start", "length");
  192. GDVIRTUAL_BIND(_shaped_text_get_parent, "shaped");
  193. GDVIRTUAL_BIND(_shaped_text_fit_to_width, "shaped", "width", "justification_flags");
  194. GDVIRTUAL_BIND(_shaped_text_tab_align, "shaped", "tab_stops");
  195. GDVIRTUAL_BIND(_shaped_text_shape, "shaped");
  196. GDVIRTUAL_BIND(_shaped_text_update_breaks, "shaped");
  197. GDVIRTUAL_BIND(_shaped_text_update_justification_ops, "shaped");
  198. GDVIRTUAL_BIND(_shaped_text_is_ready, "shaped");
  199. GDVIRTUAL_BIND(_shaped_text_get_glyphs, "shaped");
  200. GDVIRTUAL_BIND(_shaped_text_sort_logical, "shaped");
  201. GDVIRTUAL_BIND(_shaped_text_get_glyph_count, "shaped");
  202. GDVIRTUAL_BIND(_shaped_text_get_range, "shaped");
  203. GDVIRTUAL_BIND(_shaped_text_get_line_breaks_adv, "shaped", "width", "start", "once", "break_flags");
  204. GDVIRTUAL_BIND(_shaped_text_get_line_breaks, "shaped", "width", "start", "break_flags");
  205. GDVIRTUAL_BIND(_shaped_text_get_word_breaks, "shaped", "grapheme_flags", "skip_grapheme_flags");
  206. GDVIRTUAL_BIND(_shaped_text_get_trim_pos, "shaped");
  207. GDVIRTUAL_BIND(_shaped_text_get_ellipsis_pos, "shaped");
  208. GDVIRTUAL_BIND(_shaped_text_get_ellipsis_glyph_count, "shaped");
  209. GDVIRTUAL_BIND(_shaped_text_get_ellipsis_glyphs, "shaped");
  210. GDVIRTUAL_BIND(_shaped_text_overrun_trim_to_width, "shaped", "width", "trim_flags");
  211. GDVIRTUAL_BIND(_shaped_text_get_objects, "shaped");
  212. GDVIRTUAL_BIND(_shaped_text_get_object_rect, "shaped", "key");
  213. GDVIRTUAL_BIND(_shaped_text_get_object_range, "shaped", "key");
  214. GDVIRTUAL_BIND(_shaped_text_get_object_glyph, "shaped", "key");
  215. GDVIRTUAL_BIND(_shaped_text_get_size, "shaped");
  216. GDVIRTUAL_BIND(_shaped_text_get_ascent, "shaped");
  217. GDVIRTUAL_BIND(_shaped_text_get_descent, "shaped");
  218. GDVIRTUAL_BIND(_shaped_text_get_width, "shaped");
  219. GDVIRTUAL_BIND(_shaped_text_get_underline_position, "shaped");
  220. GDVIRTUAL_BIND(_shaped_text_get_underline_thickness, "shaped");
  221. GDVIRTUAL_BIND(_shaped_text_get_dominant_direction_in_range, "shaped", "start", "end");
  222. GDVIRTUAL_BIND(_shaped_text_get_carets, "shaped", "position", "caret");
  223. GDVIRTUAL_BIND(_shaped_text_get_selection, "shaped", "start", "end");
  224. GDVIRTUAL_BIND(_shaped_text_hit_test_grapheme, "shaped", "coord");
  225. GDVIRTUAL_BIND(_shaped_text_hit_test_position, "shaped", "coord");
  226. GDVIRTUAL_BIND(_shaped_text_draw, "shaped", "canvas", "pos", "clip_l", "clip_r", "color");
  227. GDVIRTUAL_BIND(_shaped_text_draw_outline, "shaped", "canvas", "pos", "clip_l", "clip_r", "outline_size", "color");
  228. GDVIRTUAL_BIND(_shaped_text_get_grapheme_bounds, "shaped", "pos");
  229. GDVIRTUAL_BIND(_shaped_text_next_grapheme_pos, "shaped", "pos");
  230. GDVIRTUAL_BIND(_shaped_text_prev_grapheme_pos, "shaped", "pos");
  231. GDVIRTUAL_BIND(_shaped_text_get_character_breaks, "shaped");
  232. GDVIRTUAL_BIND(_shaped_text_next_character_pos, "shaped", "pos");
  233. GDVIRTUAL_BIND(_shaped_text_prev_character_pos, "shaped", "pos");
  234. GDVIRTUAL_BIND(_shaped_text_closest_character_pos, "shaped", "pos");
  235. GDVIRTUAL_BIND(_format_number, "number", "language");
  236. GDVIRTUAL_BIND(_parse_number, "number", "language");
  237. GDVIRTUAL_BIND(_percent_sign, "language");
  238. GDVIRTUAL_BIND(_strip_diacritics, "string");
  239. GDVIRTUAL_BIND(_is_valid_identifier, "string");
  240. GDVIRTUAL_BIND(_is_valid_letter, "unicode");
  241. GDVIRTUAL_BIND(_string_get_word_breaks, "string", "language", "chars_per_line");
  242. GDVIRTUAL_BIND(_string_get_character_breaks, "string", "language");
  243. GDVIRTUAL_BIND(_is_confusable, "string", "dict");
  244. GDVIRTUAL_BIND(_spoof_check, "string");
  245. GDVIRTUAL_BIND(_string_to_upper, "string", "language");
  246. GDVIRTUAL_BIND(_string_to_lower, "string", "language");
  247. GDVIRTUAL_BIND(_string_to_title, "string", "language");
  248. GDVIRTUAL_BIND(_parse_structured_text, "parser_type", "args", "text");
  249. GDVIRTUAL_BIND(_cleanup);
  250. }
  251. bool TextServerExtension::has_feature(Feature p_feature) const {
  252. bool ret = false;
  253. GDVIRTUAL_REQUIRED_CALL(_has_feature, p_feature, ret);
  254. return ret;
  255. }
  256. String TextServerExtension::get_name() const {
  257. String ret = "Unknown";
  258. GDVIRTUAL_REQUIRED_CALL(_get_name, ret);
  259. return ret;
  260. }
  261. int64_t TextServerExtension::get_features() const {
  262. int64_t ret = 0;
  263. GDVIRTUAL_REQUIRED_CALL(_get_features, ret);
  264. return ret;
  265. }
  266. void TextServerExtension::free_rid(const RID &p_rid) {
  267. GDVIRTUAL_REQUIRED_CALL(_free_rid, p_rid);
  268. }
  269. bool TextServerExtension::has(const RID &p_rid) {
  270. bool ret = false;
  271. GDVIRTUAL_REQUIRED_CALL(_has, p_rid, ret);
  272. return ret;
  273. }
  274. bool TextServerExtension::load_support_data(const String &p_filename) {
  275. bool ret = false;
  276. GDVIRTUAL_CALL(_load_support_data, p_filename, ret);
  277. return ret;
  278. }
  279. String TextServerExtension::get_support_data_filename() const {
  280. String ret;
  281. GDVIRTUAL_CALL(_get_support_data_filename, ret);
  282. return ret;
  283. }
  284. String TextServerExtension::get_support_data_info() const {
  285. String ret;
  286. GDVIRTUAL_CALL(_get_support_data_info, ret);
  287. return ret;
  288. }
  289. bool TextServerExtension::save_support_data(const String &p_filename) const {
  290. bool ret = false;
  291. GDVIRTUAL_CALL(_save_support_data, p_filename, ret);
  292. return ret;
  293. }
  294. bool TextServerExtension::is_locale_right_to_left(const String &p_locale) const {
  295. bool ret = false;
  296. GDVIRTUAL_CALL(_is_locale_right_to_left, p_locale, ret);
  297. return ret;
  298. }
  299. int64_t TextServerExtension::name_to_tag(const String &p_name) const {
  300. int64_t ret = 0;
  301. if (GDVIRTUAL_CALL(_name_to_tag, p_name, ret)) {
  302. return ret;
  303. }
  304. return TextServer::name_to_tag(p_name);
  305. }
  306. String TextServerExtension::tag_to_name(int64_t p_tag) const {
  307. String ret;
  308. if (GDVIRTUAL_CALL(_tag_to_name, p_tag, ret)) {
  309. return ret;
  310. }
  311. return TextServer::tag_to_name(p_tag);
  312. }
  313. /*************************************************************************/
  314. /* Font */
  315. /*************************************************************************/
  316. RID TextServerExtension::create_font() {
  317. RID ret;
  318. GDVIRTUAL_REQUIRED_CALL(_create_font, ret);
  319. return ret;
  320. }
  321. RID TextServerExtension::create_font_linked_variation(const RID &p_font_rid) {
  322. RID ret;
  323. GDVIRTUAL_CALL(_create_font_linked_variation, p_font_rid, ret);
  324. return ret;
  325. }
  326. void TextServerExtension::font_set_data(const RID &p_font_rid, const PackedByteArray &p_data) {
  327. GDVIRTUAL_CALL(_font_set_data, p_font_rid, p_data);
  328. }
  329. void TextServerExtension::font_set_data_ptr(const RID &p_font_rid, const uint8_t *p_data_ptr, int64_t p_data_size) {
  330. GDVIRTUAL_CALL(_font_set_data_ptr, p_font_rid, p_data_ptr, p_data_size);
  331. }
  332. void TextServerExtension::font_set_face_index(const RID &p_font_rid, int64_t p_index) {
  333. GDVIRTUAL_CALL(_font_set_face_index, p_font_rid, p_index);
  334. }
  335. int64_t TextServerExtension::font_get_face_index(const RID &p_font_rid) const {
  336. int64_t ret = 0;
  337. GDVIRTUAL_CALL(_font_get_face_index, p_font_rid, ret);
  338. return ret;
  339. }
  340. int64_t TextServerExtension::font_get_face_count(const RID &p_font_rid) const {
  341. int64_t ret = 1;
  342. GDVIRTUAL_CALL(_font_get_face_count, p_font_rid, ret);
  343. return ret;
  344. }
  345. void TextServerExtension::font_set_style(const RID &p_font_rid, BitField<TextServer::FontStyle> p_style) {
  346. GDVIRTUAL_CALL(_font_set_style, p_font_rid, p_style);
  347. }
  348. BitField<TextServer::FontStyle> TextServerExtension::font_get_style(const RID &p_font_rid) const {
  349. BitField<TextServer::FontStyle> ret = 0;
  350. GDVIRTUAL_CALL(_font_get_style, p_font_rid, ret);
  351. return ret;
  352. }
  353. void TextServerExtension::font_set_style_name(const RID &p_font_rid, const String &p_name) {
  354. GDVIRTUAL_CALL(_font_set_style_name, p_font_rid, p_name);
  355. }
  356. String TextServerExtension::font_get_style_name(const RID &p_font_rid) const {
  357. String ret;
  358. GDVIRTUAL_CALL(_font_get_style_name, p_font_rid, ret);
  359. return ret;
  360. }
  361. void TextServerExtension::font_set_weight(const RID &p_font_rid, int64_t p_weight) {
  362. GDVIRTUAL_CALL(_font_set_weight, p_font_rid, p_weight);
  363. }
  364. int64_t TextServerExtension::font_get_weight(const RID &p_font_rid) const {
  365. int64_t ret = 400;
  366. GDVIRTUAL_CALL(_font_get_weight, p_font_rid, ret);
  367. return ret;
  368. }
  369. void TextServerExtension::font_set_stretch(const RID &p_font_rid, int64_t p_stretch) {
  370. GDVIRTUAL_CALL(_font_set_stretch, p_font_rid, p_stretch);
  371. }
  372. int64_t TextServerExtension::font_get_stretch(const RID &p_font_rid) const {
  373. int64_t ret = 100;
  374. GDVIRTUAL_CALL(_font_get_stretch, p_font_rid, ret);
  375. return ret;
  376. }
  377. void TextServerExtension::font_set_name(const RID &p_font_rid, const String &p_name) {
  378. GDVIRTUAL_CALL(_font_set_name, p_font_rid, p_name);
  379. }
  380. String TextServerExtension::font_get_name(const RID &p_font_rid) const {
  381. String ret;
  382. GDVIRTUAL_CALL(_font_get_name, p_font_rid, ret);
  383. return ret;
  384. }
  385. Dictionary TextServerExtension::font_get_ot_name_strings(const RID &p_font_rid) const {
  386. Dictionary ret;
  387. GDVIRTUAL_CALL(_font_get_ot_name_strings, p_font_rid, ret);
  388. return ret;
  389. }
  390. void TextServerExtension::font_set_antialiasing(const RID &p_font_rid, TextServer::FontAntialiasing p_antialiasing) {
  391. GDVIRTUAL_CALL(_font_set_antialiasing, p_font_rid, p_antialiasing);
  392. }
  393. TextServer::FontAntialiasing TextServerExtension::font_get_antialiasing(const RID &p_font_rid) const {
  394. TextServer::FontAntialiasing ret = TextServer::FONT_ANTIALIASING_NONE;
  395. GDVIRTUAL_CALL(_font_get_antialiasing, p_font_rid, ret);
  396. return ret;
  397. }
  398. void TextServerExtension::font_set_disable_embedded_bitmaps(const RID &p_font_rid, bool p_disable_embedded_bitmaps) {
  399. GDVIRTUAL_CALL(_font_set_disable_embedded_bitmaps, p_font_rid, p_disable_embedded_bitmaps);
  400. }
  401. bool TextServerExtension::font_get_disable_embedded_bitmaps(const RID &p_font_rid) const {
  402. bool ret = false;
  403. GDVIRTUAL_CALL(_font_get_disable_embedded_bitmaps, p_font_rid, ret);
  404. return ret;
  405. }
  406. void TextServerExtension::font_set_generate_mipmaps(const RID &p_font_rid, bool p_generate_mipmaps) {
  407. GDVIRTUAL_CALL(_font_set_generate_mipmaps, p_font_rid, p_generate_mipmaps);
  408. }
  409. bool TextServerExtension::font_get_generate_mipmaps(const RID &p_font_rid) const {
  410. bool ret = false;
  411. GDVIRTUAL_CALL(_font_get_generate_mipmaps, p_font_rid, ret);
  412. return ret;
  413. }
  414. void TextServerExtension::font_set_multichannel_signed_distance_field(const RID &p_font_rid, bool p_msdf) {
  415. GDVIRTUAL_CALL(_font_set_multichannel_signed_distance_field, p_font_rid, p_msdf);
  416. }
  417. bool TextServerExtension::font_is_multichannel_signed_distance_field(const RID &p_font_rid) const {
  418. bool ret = false;
  419. GDVIRTUAL_CALL(_font_is_multichannel_signed_distance_field, p_font_rid, ret);
  420. return ret;
  421. }
  422. void TextServerExtension::font_set_msdf_pixel_range(const RID &p_font_rid, int64_t p_msdf_pixel_range) {
  423. GDVIRTUAL_CALL(_font_set_msdf_pixel_range, p_font_rid, p_msdf_pixel_range);
  424. }
  425. int64_t TextServerExtension::font_get_msdf_pixel_range(const RID &p_font_rid) const {
  426. int64_t ret = 0;
  427. GDVIRTUAL_CALL(_font_get_msdf_pixel_range, p_font_rid, ret);
  428. return ret;
  429. }
  430. void TextServerExtension::font_set_msdf_size(const RID &p_font_rid, int64_t p_msdf_size) {
  431. GDVIRTUAL_CALL(_font_set_msdf_size, p_font_rid, p_msdf_size);
  432. }
  433. int64_t TextServerExtension::font_get_msdf_size(const RID &p_font_rid) const {
  434. int64_t ret = 0;
  435. GDVIRTUAL_CALL(_font_get_msdf_size, p_font_rid, ret);
  436. return ret;
  437. }
  438. void TextServerExtension::font_set_fixed_size(const RID &p_font_rid, int64_t p_fixed_size) {
  439. GDVIRTUAL_REQUIRED_CALL(_font_set_fixed_size, p_font_rid, p_fixed_size);
  440. }
  441. int64_t TextServerExtension::font_get_fixed_size(const RID &p_font_rid) const {
  442. int64_t ret = 0;
  443. GDVIRTUAL_REQUIRED_CALL(_font_get_fixed_size, p_font_rid, ret);
  444. return ret;
  445. }
  446. void TextServerExtension::font_set_fixed_size_scale_mode(const RID &p_font_rid, TextServer::FixedSizeScaleMode p_fixed_size_scale_mode) {
  447. GDVIRTUAL_REQUIRED_CALL(_font_set_fixed_size_scale_mode, p_font_rid, p_fixed_size_scale_mode);
  448. }
  449. TextServer::FixedSizeScaleMode TextServerExtension::font_get_fixed_size_scale_mode(const RID &p_font_rid) const {
  450. FixedSizeScaleMode ret = FIXED_SIZE_SCALE_DISABLE;
  451. GDVIRTUAL_REQUIRED_CALL(_font_get_fixed_size_scale_mode, p_font_rid, ret);
  452. return ret;
  453. }
  454. void TextServerExtension::font_set_allow_system_fallback(const RID &p_font_rid, bool p_allow_system_fallback) {
  455. GDVIRTUAL_CALL(_font_set_allow_system_fallback, p_font_rid, p_allow_system_fallback);
  456. }
  457. bool TextServerExtension::font_is_allow_system_fallback(const RID &p_font_rid) const {
  458. bool ret = false;
  459. GDVIRTUAL_CALL(_font_is_allow_system_fallback, p_font_rid, ret);
  460. return ret;
  461. }
  462. void TextServerExtension::font_set_force_autohinter(const RID &p_font_rid, bool p_force_autohinter) {
  463. GDVIRTUAL_CALL(_font_set_force_autohinter, p_font_rid, p_force_autohinter);
  464. }
  465. bool TextServerExtension::font_is_force_autohinter(const RID &p_font_rid) const {
  466. bool ret = false;
  467. GDVIRTUAL_CALL(_font_is_force_autohinter, p_font_rid, ret);
  468. return ret;
  469. }
  470. void TextServerExtension::font_set_hinting(const RID &p_font_rid, TextServer::Hinting p_hinting) {
  471. GDVIRTUAL_CALL(_font_set_hinting, p_font_rid, p_hinting);
  472. }
  473. TextServer::Hinting TextServerExtension::font_get_hinting(const RID &p_font_rid) const {
  474. TextServer::Hinting ret = TextServer::HINTING_NONE;
  475. GDVIRTUAL_CALL(_font_get_hinting, p_font_rid, ret);
  476. return ret;
  477. }
  478. void TextServerExtension::font_set_subpixel_positioning(const RID &p_font_rid, TextServer::SubpixelPositioning p_subpixel) {
  479. GDVIRTUAL_CALL(_font_set_subpixel_positioning, p_font_rid, p_subpixel);
  480. }
  481. TextServer::SubpixelPositioning TextServerExtension::font_get_subpixel_positioning(const RID &p_font_rid) const {
  482. TextServer::SubpixelPositioning ret = TextServer::SUBPIXEL_POSITIONING_DISABLED;
  483. GDVIRTUAL_CALL(_font_get_subpixel_positioning, p_font_rid, ret);
  484. return ret;
  485. }
  486. void TextServerExtension::font_set_embolden(const RID &p_font_rid, double p_strength) {
  487. GDVIRTUAL_CALL(_font_set_embolden, p_font_rid, p_strength);
  488. }
  489. double TextServerExtension::font_get_embolden(const RID &p_font_rid) const {
  490. double ret = 0;
  491. GDVIRTUAL_CALL(_font_get_embolden, p_font_rid, ret);
  492. return ret;
  493. }
  494. void TextServerExtension::font_set_spacing(const RID &p_font_rid, SpacingType p_spacing, int64_t p_value) {
  495. GDVIRTUAL_CALL(_font_set_spacing, p_font_rid, p_spacing, p_value);
  496. }
  497. int64_t TextServerExtension::font_get_spacing(const RID &p_font_rid, SpacingType p_spacing) const {
  498. int64_t ret = 0;
  499. GDVIRTUAL_CALL(_font_get_spacing, p_font_rid, p_spacing, ret);
  500. return ret;
  501. }
  502. void TextServerExtension::font_set_baseline_offset(const RID &p_font_rid, double p_baseline_offset) {
  503. GDVIRTUAL_CALL(_font_set_baseline_offset, p_font_rid, p_baseline_offset);
  504. }
  505. double TextServerExtension::font_get_baseline_offset(const RID &p_font_rid) const {
  506. double ret = 0.0;
  507. GDVIRTUAL_CALL(_font_get_baseline_offset, p_font_rid, ret);
  508. return ret;
  509. }
  510. void TextServerExtension::font_set_transform(const RID &p_font_rid, const Transform2D &p_transform) {
  511. GDVIRTUAL_CALL(_font_set_transform, p_font_rid, p_transform);
  512. }
  513. Transform2D TextServerExtension::font_get_transform(const RID &p_font_rid) const {
  514. Transform2D ret;
  515. GDVIRTUAL_CALL(_font_get_transform, p_font_rid, ret);
  516. return ret;
  517. }
  518. void TextServerExtension::font_set_variation_coordinates(const RID &p_font_rid, const Dictionary &p_variation_coordinates) {
  519. GDVIRTUAL_CALL(_font_set_variation_coordinates, p_font_rid, p_variation_coordinates);
  520. }
  521. Dictionary TextServerExtension::font_get_variation_coordinates(const RID &p_font_rid) const {
  522. Dictionary ret;
  523. GDVIRTUAL_CALL(_font_get_variation_coordinates, p_font_rid, ret);
  524. return ret;
  525. }
  526. void TextServerExtension::font_set_oversampling(const RID &p_font_rid, double p_oversampling) {
  527. GDVIRTUAL_CALL(_font_set_oversampling, p_font_rid, p_oversampling);
  528. }
  529. double TextServerExtension::font_get_oversampling(const RID &p_font_rid) const {
  530. double ret = 0;
  531. GDVIRTUAL_CALL(_font_get_oversampling, p_font_rid, ret);
  532. return ret;
  533. }
  534. TypedArray<Vector2i> TextServerExtension::font_get_size_cache_list(const RID &p_font_rid) const {
  535. TypedArray<Vector2i> ret;
  536. GDVIRTUAL_REQUIRED_CALL(_font_get_size_cache_list, p_font_rid, ret);
  537. return ret;
  538. }
  539. void TextServerExtension::font_clear_size_cache(const RID &p_font_rid) {
  540. GDVIRTUAL_REQUIRED_CALL(_font_clear_size_cache, p_font_rid);
  541. }
  542. void TextServerExtension::font_remove_size_cache(const RID &p_font_rid, const Vector2i &p_size) {
  543. GDVIRTUAL_REQUIRED_CALL(_font_remove_size_cache, p_font_rid, p_size);
  544. }
  545. void TextServerExtension::font_set_ascent(const RID &p_font_rid, int64_t p_size, double p_ascent) {
  546. GDVIRTUAL_REQUIRED_CALL(_font_set_ascent, p_font_rid, p_size, p_ascent);
  547. }
  548. double TextServerExtension::font_get_ascent(const RID &p_font_rid, int64_t p_size) const {
  549. double ret = 0;
  550. GDVIRTUAL_REQUIRED_CALL(_font_get_ascent, p_font_rid, p_size, ret);
  551. return ret;
  552. }
  553. void TextServerExtension::font_set_descent(const RID &p_font_rid, int64_t p_size, double p_descent) {
  554. GDVIRTUAL_REQUIRED_CALL(_font_set_descent, p_font_rid, p_size, p_descent);
  555. }
  556. double TextServerExtension::font_get_descent(const RID &p_font_rid, int64_t p_size) const {
  557. double ret = 0;
  558. GDVIRTUAL_REQUIRED_CALL(_font_get_descent, p_font_rid, p_size, ret);
  559. return ret;
  560. }
  561. void TextServerExtension::font_set_underline_position(const RID &p_font_rid, int64_t p_size, double p_underline_position) {
  562. GDVIRTUAL_REQUIRED_CALL(_font_set_underline_position, p_font_rid, p_size, p_underline_position);
  563. }
  564. double TextServerExtension::font_get_underline_position(const RID &p_font_rid, int64_t p_size) const {
  565. double ret = 0;
  566. GDVIRTUAL_REQUIRED_CALL(_font_get_underline_position, p_font_rid, p_size, ret);
  567. return ret;
  568. }
  569. void TextServerExtension::font_set_underline_thickness(const RID &p_font_rid, int64_t p_size, double p_underline_thickness) {
  570. GDVIRTUAL_REQUIRED_CALL(_font_set_underline_thickness, p_font_rid, p_size, p_underline_thickness);
  571. }
  572. double TextServerExtension::font_get_underline_thickness(const RID &p_font_rid, int64_t p_size) const {
  573. double ret = 0;
  574. GDVIRTUAL_REQUIRED_CALL(_font_get_underline_thickness, p_font_rid, p_size, ret);
  575. return ret;
  576. }
  577. void TextServerExtension::font_set_scale(const RID &p_font_rid, int64_t p_size, double p_scale) {
  578. GDVIRTUAL_REQUIRED_CALL(_font_set_scale, p_font_rid, p_size, p_scale);
  579. }
  580. double TextServerExtension::font_get_scale(const RID &p_font_rid, int64_t p_size) const {
  581. double ret = 0;
  582. GDVIRTUAL_REQUIRED_CALL(_font_get_scale, p_font_rid, p_size, ret);
  583. return ret;
  584. }
  585. int64_t TextServerExtension::font_get_texture_count(const RID &p_font_rid, const Vector2i &p_size) const {
  586. int64_t ret = 0;
  587. GDVIRTUAL_REQUIRED_CALL(_font_get_texture_count, p_font_rid, p_size, ret);
  588. return ret;
  589. }
  590. void TextServerExtension::font_clear_textures(const RID &p_font_rid, const Vector2i &p_size) {
  591. GDVIRTUAL_REQUIRED_CALL(_font_clear_textures, p_font_rid, p_size);
  592. }
  593. void TextServerExtension::font_remove_texture(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) {
  594. GDVIRTUAL_REQUIRED_CALL(_font_remove_texture, p_font_rid, p_size, p_texture_index);
  595. }
  596. void TextServerExtension::font_set_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const Ref<Image> &p_image) {
  597. GDVIRTUAL_REQUIRED_CALL(_font_set_texture_image, p_font_rid, p_size, p_texture_index, p_image);
  598. }
  599. Ref<Image> TextServerExtension::font_get_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const {
  600. Ref<Image> ret;
  601. GDVIRTUAL_REQUIRED_CALL(_font_get_texture_image, p_font_rid, p_size, p_texture_index, ret);
  602. return ret;
  603. }
  604. void TextServerExtension::font_set_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const PackedInt32Array &p_offset) {
  605. GDVIRTUAL_CALL(_font_set_texture_offsets, p_font_rid, p_size, p_texture_index, p_offset);
  606. }
  607. PackedInt32Array TextServerExtension::font_get_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const {
  608. PackedInt32Array ret;
  609. GDVIRTUAL_CALL(_font_get_texture_offsets, p_font_rid, p_size, p_texture_index, ret);
  610. return ret;
  611. }
  612. PackedInt32Array TextServerExtension::font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const {
  613. PackedInt32Array ret;
  614. GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_list, p_font_rid, p_size, ret);
  615. return ret;
  616. }
  617. void TextServerExtension::font_clear_glyphs(const RID &p_font_rid, const Vector2i &p_size) {
  618. GDVIRTUAL_REQUIRED_CALL(_font_clear_glyphs, p_font_rid, p_size);
  619. }
  620. void TextServerExtension::font_remove_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) {
  621. GDVIRTUAL_REQUIRED_CALL(_font_remove_glyph, p_font_rid, p_size, p_glyph);
  622. }
  623. Vector2 TextServerExtension::font_get_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph) const {
  624. Vector2 ret;
  625. GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_advance, p_font_rid, p_size, p_glyph, ret);
  626. return ret;
  627. }
  628. void TextServerExtension::font_set_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph, const Vector2 &p_advance) {
  629. GDVIRTUAL_REQUIRED_CALL(_font_set_glyph_advance, p_font_rid, p_size, p_glyph, p_advance);
  630. }
  631. Vector2 TextServerExtension::font_get_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const {
  632. Vector2 ret;
  633. GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_offset, p_font_rid, p_size, p_glyph, ret);
  634. return ret;
  635. }
  636. void TextServerExtension::font_set_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_offset) {
  637. GDVIRTUAL_REQUIRED_CALL(_font_set_glyph_offset, p_font_rid, p_size, p_glyph, p_offset);
  638. }
  639. Vector2 TextServerExtension::font_get_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const {
  640. Vector2 ret;
  641. GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_size, p_font_rid, p_size, p_glyph, ret);
  642. return ret;
  643. }
  644. void TextServerExtension::font_set_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_gl_size) {
  645. GDVIRTUAL_REQUIRED_CALL(_font_set_glyph_size, p_font_rid, p_size, p_glyph, p_gl_size);
  646. }
  647. Rect2 TextServerExtension::font_get_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const {
  648. Rect2 ret;
  649. GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_uv_rect, p_font_rid, p_size, p_glyph, ret);
  650. return ret;
  651. }
  652. void TextServerExtension::font_set_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Rect2 &p_uv_rect) {
  653. GDVIRTUAL_REQUIRED_CALL(_font_set_glyph_uv_rect, p_font_rid, p_size, p_glyph, p_uv_rect);
  654. }
  655. int64_t TextServerExtension::font_get_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const {
  656. int64_t ret = 0;
  657. GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_texture_idx, p_font_rid, p_size, p_glyph, ret);
  658. return ret;
  659. }
  660. void TextServerExtension::font_set_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, int64_t p_texture_idx) {
  661. GDVIRTUAL_REQUIRED_CALL(_font_set_glyph_texture_idx, p_font_rid, p_size, p_glyph, p_texture_idx);
  662. }
  663. RID TextServerExtension::font_get_glyph_texture_rid(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const {
  664. RID ret;
  665. GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_texture_rid, p_font_rid, p_size, p_glyph, ret);
  666. return ret;
  667. }
  668. Size2 TextServerExtension::font_get_glyph_texture_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const {
  669. Size2 ret;
  670. GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_texture_size, p_font_rid, p_size, p_glyph, ret);
  671. return ret;
  672. }
  673. Dictionary TextServerExtension::font_get_glyph_contours(const RID &p_font_rid, int64_t p_size, int64_t p_index) const {
  674. Dictionary ret;
  675. GDVIRTUAL_CALL(_font_get_glyph_contours, p_font_rid, p_size, p_index, ret);
  676. return ret;
  677. }
  678. TypedArray<Vector2i> TextServerExtension::font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const {
  679. TypedArray<Vector2i> ret;
  680. GDVIRTUAL_CALL(_font_get_kerning_list, p_font_rid, p_size, ret);
  681. return ret;
  682. }
  683. void TextServerExtension::font_clear_kerning_map(const RID &p_font_rid, int64_t p_size) {
  684. GDVIRTUAL_CALL(_font_clear_kerning_map, p_font_rid, p_size);
  685. }
  686. void TextServerExtension::font_remove_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) {
  687. GDVIRTUAL_CALL(_font_remove_kerning, p_font_rid, p_size, p_glyph_pair);
  688. }
  689. void TextServerExtension::font_set_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair, const Vector2 &p_kerning) {
  690. GDVIRTUAL_CALL(_font_set_kerning, p_font_rid, p_size, p_glyph_pair, p_kerning);
  691. }
  692. Vector2 TextServerExtension::font_get_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) const {
  693. Vector2 ret;
  694. GDVIRTUAL_CALL(_font_get_kerning, p_font_rid, p_size, p_glyph_pair, ret);
  695. return ret;
  696. }
  697. int64_t TextServerExtension::font_get_glyph_index(const RID &p_font_rid, int64_t p_size, int64_t p_char, int64_t p_variation_selector) const {
  698. int64_t ret = 0;
  699. GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_index, p_font_rid, p_size, p_char, p_variation_selector, ret);
  700. return ret;
  701. }
  702. int64_t TextServerExtension::font_get_char_from_glyph_index(const RID &p_font_rid, int64_t p_size, int64_t p_glyph_index) const {
  703. int64_t ret = 0;
  704. GDVIRTUAL_REQUIRED_CALL(_font_get_char_from_glyph_index, p_font_rid, p_size, p_glyph_index, ret);
  705. return ret;
  706. }
  707. bool TextServerExtension::font_has_char(const RID &p_font_rid, int64_t p_char) const {
  708. bool ret = false;
  709. GDVIRTUAL_REQUIRED_CALL(_font_has_char, p_font_rid, p_char, ret);
  710. return ret;
  711. }
  712. String TextServerExtension::font_get_supported_chars(const RID &p_font_rid) const {
  713. String ret;
  714. GDVIRTUAL_REQUIRED_CALL(_font_get_supported_chars, p_font_rid, ret);
  715. return ret;
  716. }
  717. void TextServerExtension::font_render_range(const RID &p_font_rid, const Vector2i &p_size, int64_t p_start, int64_t p_end) {
  718. GDVIRTUAL_CALL(_font_render_range, p_font_rid, p_size, p_start, p_end);
  719. }
  720. void TextServerExtension::font_render_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_index) {
  721. GDVIRTUAL_CALL(_font_render_glyph, p_font_rid, p_size, p_index);
  722. }
  723. void TextServerExtension::font_draw_glyph(const RID &p_font_rid, const RID &p_canvas, int64_t p_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color) const {
  724. GDVIRTUAL_REQUIRED_CALL(_font_draw_glyph, p_font_rid, p_canvas, p_size, p_pos, p_index, p_color);
  725. }
  726. void TextServerExtension::font_draw_glyph_outline(const RID &p_font_rid, const RID &p_canvas, int64_t p_size, int64_t p_outline_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color) const {
  727. GDVIRTUAL_REQUIRED_CALL(_font_draw_glyph_outline, p_font_rid, p_canvas, p_size, p_outline_size, p_pos, p_index, p_color);
  728. }
  729. bool TextServerExtension::font_is_language_supported(const RID &p_font_rid, const String &p_language) const {
  730. bool ret = false;
  731. GDVIRTUAL_CALL(_font_is_language_supported, p_font_rid, p_language, ret);
  732. return ret;
  733. }
  734. void TextServerExtension::font_set_language_support_override(const RID &p_font_rid, const String &p_language, bool p_supported) {
  735. GDVIRTUAL_CALL(_font_set_language_support_override, p_font_rid, p_language, p_supported);
  736. }
  737. bool TextServerExtension::font_get_language_support_override(const RID &p_font_rid, const String &p_language) {
  738. bool ret = false;
  739. GDVIRTUAL_CALL(_font_get_language_support_override, p_font_rid, p_language, ret);
  740. return ret;
  741. }
  742. void TextServerExtension::font_remove_language_support_override(const RID &p_font_rid, const String &p_language) {
  743. GDVIRTUAL_CALL(_font_remove_language_support_override, p_font_rid, p_language);
  744. }
  745. PackedStringArray TextServerExtension::font_get_language_support_overrides(const RID &p_font_rid) {
  746. PackedStringArray ret;
  747. GDVIRTUAL_CALL(_font_get_language_support_overrides, p_font_rid, ret);
  748. return ret;
  749. }
  750. bool TextServerExtension::font_is_script_supported(const RID &p_font_rid, const String &p_script) const {
  751. bool ret = false;
  752. GDVIRTUAL_CALL(_font_is_script_supported, p_font_rid, p_script, ret);
  753. return ret;
  754. }
  755. void TextServerExtension::font_set_script_support_override(const RID &p_font_rid, const String &p_script, bool p_supported) {
  756. GDVIRTUAL_CALL(_font_set_script_support_override, p_font_rid, p_script, p_supported);
  757. }
  758. bool TextServerExtension::font_get_script_support_override(const RID &p_font_rid, const String &p_script) {
  759. bool ret = false;
  760. GDVIRTUAL_CALL(_font_get_script_support_override, p_font_rid, p_script, ret);
  761. return ret;
  762. }
  763. void TextServerExtension::font_remove_script_support_override(const RID &p_font_rid, const String &p_script) {
  764. GDVIRTUAL_CALL(_font_remove_script_support_override, p_font_rid, p_script);
  765. }
  766. PackedStringArray TextServerExtension::font_get_script_support_overrides(const RID &p_font_rid) {
  767. PackedStringArray ret;
  768. GDVIRTUAL_CALL(_font_get_script_support_overrides, p_font_rid, ret);
  769. return ret;
  770. }
  771. void TextServerExtension::font_set_opentype_feature_overrides(const RID &p_font_rid, const Dictionary &p_overrides) {
  772. GDVIRTUAL_CALL(_font_set_opentype_feature_overrides, p_font_rid, p_overrides);
  773. }
  774. Dictionary TextServerExtension::font_get_opentype_feature_overrides(const RID &p_font_rid) const {
  775. Dictionary ret;
  776. GDVIRTUAL_CALL(_font_get_opentype_feature_overrides, p_font_rid, ret);
  777. return ret;
  778. }
  779. Dictionary TextServerExtension::font_supported_feature_list(const RID &p_font_rid) const {
  780. Dictionary ret;
  781. GDVIRTUAL_CALL(_font_supported_feature_list, p_font_rid, ret);
  782. return ret;
  783. }
  784. Dictionary TextServerExtension::font_supported_variation_list(const RID &p_font_rid) const {
  785. Dictionary ret;
  786. GDVIRTUAL_CALL(_font_supported_variation_list, p_font_rid, ret);
  787. return ret;
  788. }
  789. double TextServerExtension::font_get_global_oversampling() const {
  790. double ret = 0;
  791. GDVIRTUAL_CALL(_font_get_global_oversampling, ret);
  792. return ret;
  793. }
  794. void TextServerExtension::font_set_global_oversampling(double p_oversampling) {
  795. GDVIRTUAL_CALL(_font_set_global_oversampling, p_oversampling);
  796. }
  797. Vector2 TextServerExtension::get_hex_code_box_size(int64_t p_size, int64_t p_index) const {
  798. Vector2 ret;
  799. if (GDVIRTUAL_CALL(_get_hex_code_box_size, p_size, p_index, ret)) {
  800. return ret;
  801. }
  802. return TextServer::get_hex_code_box_size(p_size, p_index);
  803. }
  804. void TextServerExtension::draw_hex_code_box(const RID &p_canvas, int64_t p_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color) const {
  805. if (!GDVIRTUAL_CALL(_draw_hex_code_box, p_canvas, p_size, p_pos, p_index, p_color)) {
  806. TextServer::draw_hex_code_box(p_canvas, p_size, p_pos, p_index, p_color);
  807. }
  808. }
  809. /*************************************************************************/
  810. /* Shaped text buffer interface */
  811. /*************************************************************************/
  812. RID TextServerExtension::create_shaped_text(TextServer::Direction p_direction, TextServer::Orientation p_orientation) {
  813. RID ret;
  814. GDVIRTUAL_REQUIRED_CALL(_create_shaped_text, p_direction, p_orientation, ret);
  815. return ret;
  816. }
  817. void TextServerExtension::shaped_text_clear(const RID &p_shaped) {
  818. GDVIRTUAL_REQUIRED_CALL(_shaped_text_clear, p_shaped);
  819. }
  820. void TextServerExtension::shaped_text_set_direction(const RID &p_shaped, TextServer::Direction p_direction) {
  821. GDVIRTUAL_CALL(_shaped_text_set_direction, p_shaped, p_direction);
  822. }
  823. TextServer::Direction TextServerExtension::shaped_text_get_direction(const RID &p_shaped) const {
  824. TextServer::Direction ret = TextServer::DIRECTION_AUTO;
  825. GDVIRTUAL_CALL(_shaped_text_get_direction, p_shaped, ret);
  826. return ret;
  827. }
  828. TextServer::Direction TextServerExtension::shaped_text_get_inferred_direction(const RID &p_shaped) const {
  829. TextServer::Direction ret = TextServer::DIRECTION_LTR;
  830. GDVIRTUAL_CALL(_shaped_text_get_inferred_direction, p_shaped, ret);
  831. return ret;
  832. }
  833. void TextServerExtension::shaped_text_set_orientation(const RID &p_shaped, TextServer::Orientation p_orientation) {
  834. GDVIRTUAL_CALL(_shaped_text_set_orientation, p_shaped, p_orientation);
  835. }
  836. TextServer::Orientation TextServerExtension::shaped_text_get_orientation(const RID &p_shaped) const {
  837. TextServer::Orientation ret = TextServer::ORIENTATION_HORIZONTAL;
  838. GDVIRTUAL_CALL(_shaped_text_get_orientation, p_shaped, ret);
  839. return ret;
  840. }
  841. void TextServerExtension::shaped_text_set_bidi_override(const RID &p_shaped, const Array &p_override) {
  842. GDVIRTUAL_CALL(_shaped_text_set_bidi_override, p_shaped, p_override);
  843. }
  844. void TextServerExtension::shaped_text_set_custom_punctuation(const RID &p_shaped, const String &p_punct) {
  845. GDVIRTUAL_CALL(_shaped_text_set_custom_punctuation, p_shaped, p_punct);
  846. }
  847. String TextServerExtension::shaped_text_get_custom_punctuation(const RID &p_shaped) const {
  848. String ret;
  849. GDVIRTUAL_CALL(_shaped_text_get_custom_punctuation, p_shaped, ret);
  850. return ret;
  851. }
  852. void TextServerExtension::shaped_text_set_custom_ellipsis(const RID &p_shaped, int64_t p_char) {
  853. GDVIRTUAL_CALL(_shaped_text_set_custom_ellipsis, p_shaped, p_char);
  854. }
  855. int64_t TextServerExtension::shaped_text_get_custom_ellipsis(const RID &p_shaped) const {
  856. int64_t ret = 0;
  857. GDVIRTUAL_CALL(_shaped_text_get_custom_ellipsis, p_shaped, ret);
  858. return ret;
  859. }
  860. void TextServerExtension::shaped_text_set_preserve_invalid(const RID &p_shaped, bool p_enabled) {
  861. GDVIRTUAL_CALL(_shaped_text_set_preserve_invalid, p_shaped, p_enabled);
  862. }
  863. bool TextServerExtension::shaped_text_get_preserve_invalid(const RID &p_shaped) const {
  864. bool ret = false;
  865. GDVIRTUAL_CALL(_shaped_text_get_preserve_invalid, p_shaped, ret);
  866. return ret;
  867. }
  868. void TextServerExtension::shaped_text_set_preserve_control(const RID &p_shaped, bool p_enabled) {
  869. GDVIRTUAL_CALL(_shaped_text_set_preserve_control, p_shaped, p_enabled);
  870. }
  871. bool TextServerExtension::shaped_text_get_preserve_control(const RID &p_shaped) const {
  872. bool ret = false;
  873. GDVIRTUAL_CALL(_shaped_text_get_preserve_control, p_shaped, ret);
  874. return ret;
  875. }
  876. void TextServerExtension::shaped_text_set_spacing(const RID &p_shaped, TextServer::SpacingType p_spacing, int64_t p_value) {
  877. GDVIRTUAL_CALL(_shaped_text_set_spacing, p_shaped, p_spacing, p_value);
  878. }
  879. int64_t TextServerExtension::shaped_text_get_spacing(const RID &p_shaped, TextServer::SpacingType p_spacing) const {
  880. int64_t ret = 0;
  881. GDVIRTUAL_CALL(_shaped_text_get_spacing, p_shaped, p_spacing, ret);
  882. return ret;
  883. }
  884. bool TextServerExtension::shaped_text_add_string(const RID &p_shaped, const String &p_text, const TypedArray<RID> &p_fonts, int64_t p_size, const Dictionary &p_opentype_features, const String &p_language, const Variant &p_meta) {
  885. bool ret = false;
  886. GDVIRTUAL_REQUIRED_CALL(_shaped_text_add_string, p_shaped, p_text, p_fonts, p_size, p_opentype_features, p_language, p_meta, ret);
  887. return ret;
  888. }
  889. bool TextServerExtension::shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align, int64_t p_length, double p_baseline) {
  890. bool ret = false;
  891. GDVIRTUAL_REQUIRED_CALL(_shaped_text_add_object, p_shaped, p_key, p_size, p_inline_align, p_length, p_baseline, ret);
  892. return ret;
  893. }
  894. bool TextServerExtension::shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align, double p_baseline) {
  895. bool ret = false;
  896. GDVIRTUAL_REQUIRED_CALL(_shaped_text_resize_object, p_shaped, p_key, p_size, p_inline_align, p_baseline, ret);
  897. return ret;
  898. }
  899. int64_t TextServerExtension::shaped_get_span_count(const RID &p_shaped) const {
  900. int64_t ret = 0;
  901. GDVIRTUAL_REQUIRED_CALL(_shaped_get_span_count, p_shaped, ret);
  902. return ret;
  903. }
  904. Variant TextServerExtension::shaped_get_span_meta(const RID &p_shaped, int64_t p_index) const {
  905. Variant ret = false;
  906. GDVIRTUAL_REQUIRED_CALL(_shaped_get_span_meta, p_shaped, p_index, ret);
  907. return ret;
  908. }
  909. void TextServerExtension::shaped_set_span_update_font(const RID &p_shaped, int64_t p_index, const TypedArray<RID> &p_fonts, int64_t p_size, const Dictionary &p_opentype_features) {
  910. GDVIRTUAL_REQUIRED_CALL(_shaped_set_span_update_font, p_shaped, p_index, p_fonts, p_size, p_opentype_features);
  911. }
  912. RID TextServerExtension::shaped_text_substr(const RID &p_shaped, int64_t p_start, int64_t p_length) const {
  913. RID ret;
  914. GDVIRTUAL_REQUIRED_CALL(_shaped_text_substr, p_shaped, p_start, p_length, ret);
  915. return ret;
  916. }
  917. RID TextServerExtension::shaped_text_get_parent(const RID &p_shaped) const {
  918. RID ret;
  919. GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_parent, p_shaped, ret);
  920. return ret;
  921. }
  922. double TextServerExtension::shaped_text_fit_to_width(const RID &p_shaped, double p_width, BitField<TextServer::JustificationFlag> p_jst_flags) {
  923. double ret = 0;
  924. GDVIRTUAL_CALL(_shaped_text_fit_to_width, p_shaped, p_width, p_jst_flags, ret);
  925. return ret;
  926. }
  927. double TextServerExtension::shaped_text_tab_align(const RID &p_shaped, const PackedFloat32Array &p_tab_stops) {
  928. double ret = 0;
  929. GDVIRTUAL_CALL(_shaped_text_tab_align, p_shaped, p_tab_stops, ret);
  930. return ret;
  931. }
  932. bool TextServerExtension::shaped_text_shape(const RID &p_shaped) {
  933. bool ret = false;
  934. GDVIRTUAL_REQUIRED_CALL(_shaped_text_shape, p_shaped, ret);
  935. return ret;
  936. }
  937. bool TextServerExtension::shaped_text_update_breaks(const RID &p_shaped) {
  938. bool ret = false;
  939. GDVIRTUAL_CALL(_shaped_text_update_breaks, p_shaped, ret);
  940. return ret;
  941. }
  942. bool TextServerExtension::shaped_text_update_justification_ops(const RID &p_shaped) {
  943. bool ret = false;
  944. GDVIRTUAL_CALL(_shaped_text_update_justification_ops, p_shaped, ret);
  945. return ret;
  946. }
  947. bool TextServerExtension::shaped_text_is_ready(const RID &p_shaped) const {
  948. bool ret = false;
  949. GDVIRTUAL_REQUIRED_CALL(_shaped_text_is_ready, p_shaped, ret);
  950. return ret;
  951. }
  952. const Glyph *TextServerExtension::shaped_text_get_glyphs(const RID &p_shaped) const {
  953. GDExtensionConstPtr<const Glyph> ret;
  954. GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_glyphs, p_shaped, ret);
  955. return ret;
  956. }
  957. const Glyph *TextServerExtension::shaped_text_sort_logical(const RID &p_shaped) {
  958. GDExtensionConstPtr<const Glyph> ret;
  959. GDVIRTUAL_REQUIRED_CALL(_shaped_text_sort_logical, p_shaped, ret);
  960. return ret;
  961. }
  962. int64_t TextServerExtension::shaped_text_get_glyph_count(const RID &p_shaped) const {
  963. int64_t ret = 0;
  964. GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_glyph_count, p_shaped, ret);
  965. return ret;
  966. }
  967. Vector2i TextServerExtension::shaped_text_get_range(const RID &p_shaped) const {
  968. Vector2i ret;
  969. GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_range, p_shaped, ret);
  970. return ret;
  971. }
  972. PackedInt32Array TextServerExtension::shaped_text_get_line_breaks_adv(const RID &p_shaped, const PackedFloat32Array &p_width, int64_t p_start, bool p_once, BitField<TextServer::LineBreakFlag> p_break_flags) const {
  973. PackedInt32Array ret;
  974. if (GDVIRTUAL_CALL(_shaped_text_get_line_breaks_adv, p_shaped, p_width, p_start, p_once, p_break_flags, ret)) {
  975. return ret;
  976. }
  977. return TextServer::shaped_text_get_line_breaks_adv(p_shaped, p_width, p_start, p_once, p_break_flags);
  978. }
  979. PackedInt32Array TextServerExtension::shaped_text_get_line_breaks(const RID &p_shaped, double p_width, int64_t p_start, BitField<TextServer::LineBreakFlag> p_break_flags) const {
  980. PackedInt32Array ret;
  981. if (GDVIRTUAL_CALL(_shaped_text_get_line_breaks, p_shaped, p_width, p_start, p_break_flags, ret)) {
  982. return ret;
  983. }
  984. return TextServer::shaped_text_get_line_breaks(p_shaped, p_width, p_start, p_break_flags);
  985. }
  986. PackedInt32Array TextServerExtension::shaped_text_get_word_breaks(const RID &p_shaped, BitField<TextServer::GraphemeFlag> p_grapheme_flags, BitField<TextServer::GraphemeFlag> p_skip_grapheme_flags) const {
  987. PackedInt32Array ret;
  988. if (GDVIRTUAL_CALL(_shaped_text_get_word_breaks, p_shaped, p_grapheme_flags, p_skip_grapheme_flags, ret)) {
  989. return ret;
  990. }
  991. return TextServer::shaped_text_get_word_breaks(p_shaped, p_grapheme_flags, p_skip_grapheme_flags);
  992. }
  993. int64_t TextServerExtension::shaped_text_get_trim_pos(const RID &p_shaped) const {
  994. int64_t ret = -1;
  995. GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_trim_pos, p_shaped, ret);
  996. return ret;
  997. }
  998. int64_t TextServerExtension::shaped_text_get_ellipsis_pos(const RID &p_shaped) const {
  999. int64_t ret = -1;
  1000. GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_ellipsis_pos, p_shaped, ret);
  1001. return ret;
  1002. }
  1003. const Glyph *TextServerExtension::shaped_text_get_ellipsis_glyphs(const RID &p_shaped) const {
  1004. GDExtensionConstPtr<const Glyph> ret;
  1005. GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_ellipsis_glyphs, p_shaped, ret);
  1006. return ret;
  1007. }
  1008. int64_t TextServerExtension::shaped_text_get_ellipsis_glyph_count(const RID &p_shaped) const {
  1009. int64_t ret = -1;
  1010. GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_ellipsis_glyph_count, p_shaped, ret);
  1011. return ret;
  1012. }
  1013. void TextServerExtension::shaped_text_overrun_trim_to_width(const RID &p_shaped_line, double p_width, BitField<TextServer::TextOverrunFlag> p_trim_flags) {
  1014. GDVIRTUAL_CALL(_shaped_text_overrun_trim_to_width, p_shaped_line, p_width, p_trim_flags);
  1015. }
  1016. Array TextServerExtension::shaped_text_get_objects(const RID &p_shaped) const {
  1017. Array ret;
  1018. GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_objects, p_shaped, ret);
  1019. return ret;
  1020. }
  1021. Rect2 TextServerExtension::shaped_text_get_object_rect(const RID &p_shaped, const Variant &p_key) const {
  1022. Rect2 ret;
  1023. GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_object_rect, p_shaped, p_key, ret);
  1024. return ret;
  1025. }
  1026. Vector2i TextServerExtension::shaped_text_get_object_range(const RID &p_shaped, const Variant &p_key) const {
  1027. Vector2i ret;
  1028. GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_object_range, p_shaped, p_key, ret);
  1029. return ret;
  1030. }
  1031. int64_t TextServerExtension::shaped_text_get_object_glyph(const RID &p_shaped, const Variant &p_key) const {
  1032. int64_t ret = -1;
  1033. GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_object_glyph, p_shaped, p_key, ret);
  1034. return ret;
  1035. }
  1036. Size2 TextServerExtension::shaped_text_get_size(const RID &p_shaped) const {
  1037. Size2 ret;
  1038. GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_size, p_shaped, ret);
  1039. return ret;
  1040. }
  1041. double TextServerExtension::shaped_text_get_ascent(const RID &p_shaped) const {
  1042. double ret = 0;
  1043. GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_ascent, p_shaped, ret);
  1044. return ret;
  1045. }
  1046. double TextServerExtension::shaped_text_get_descent(const RID &p_shaped) const {
  1047. double ret = 0;
  1048. GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_descent, p_shaped, ret);
  1049. return ret;
  1050. }
  1051. double TextServerExtension::shaped_text_get_width(const RID &p_shaped) const {
  1052. double ret = 0;
  1053. GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_width, p_shaped, ret);
  1054. return ret;
  1055. }
  1056. double TextServerExtension::shaped_text_get_underline_position(const RID &p_shaped) const {
  1057. double ret = 0;
  1058. GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_underline_position, p_shaped, ret);
  1059. return ret;
  1060. }
  1061. double TextServerExtension::shaped_text_get_underline_thickness(const RID &p_shaped) const {
  1062. double ret = 0;
  1063. GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_underline_thickness, p_shaped, ret);
  1064. return ret;
  1065. }
  1066. TextServer::Direction TextServerExtension::shaped_text_get_dominant_direction_in_range(const RID &p_shaped, int64_t p_start, int64_t p_end) const {
  1067. int64_t ret;
  1068. if (GDVIRTUAL_CALL(_shaped_text_get_dominant_direction_in_range, p_shaped, p_start, p_end, ret)) {
  1069. return (TextServer::Direction)ret;
  1070. }
  1071. return TextServer::shaped_text_get_dominant_direction_in_range(p_shaped, p_start, p_end);
  1072. }
  1073. CaretInfo TextServerExtension::shaped_text_get_carets(const RID &p_shaped, int64_t p_position) const {
  1074. CaretInfo ret;
  1075. if (GDVIRTUAL_CALL(_shaped_text_get_carets, p_shaped, p_position, &ret)) {
  1076. return ret;
  1077. }
  1078. return TextServer::shaped_text_get_carets(p_shaped, p_position);
  1079. }
  1080. Vector<Vector2> TextServerExtension::shaped_text_get_selection(const RID &p_shaped, int64_t p_start, int64_t p_end) const {
  1081. Vector<Vector2> ret;
  1082. if (GDVIRTUAL_CALL(_shaped_text_get_selection, p_shaped, p_start, p_end, ret)) {
  1083. return ret;
  1084. }
  1085. return TextServer::shaped_text_get_selection(p_shaped, p_start, p_end);
  1086. }
  1087. int64_t TextServerExtension::shaped_text_hit_test_grapheme(const RID &p_shaped, double p_coords) const {
  1088. int64_t ret;
  1089. if (GDVIRTUAL_CALL(_shaped_text_hit_test_grapheme, p_shaped, p_coords, ret)) {
  1090. return ret;
  1091. }
  1092. return TextServer::shaped_text_hit_test_grapheme(p_shaped, p_coords);
  1093. }
  1094. int64_t TextServerExtension::shaped_text_hit_test_position(const RID &p_shaped, double p_coords) const {
  1095. int64_t ret;
  1096. if (GDVIRTUAL_CALL(_shaped_text_hit_test_position, p_shaped, p_coords, ret)) {
  1097. return ret;
  1098. }
  1099. return TextServer::shaped_text_hit_test_position(p_shaped, p_coords);
  1100. }
  1101. void TextServerExtension::shaped_text_draw(const RID &p_shaped, const RID &p_canvas, const Vector2 &p_pos, double p_clip_l, double p_clip_r, const Color &p_color) const {
  1102. if (GDVIRTUAL_CALL(_shaped_text_draw, p_shaped, p_canvas, p_pos, p_clip_l, p_clip_r, p_color)) {
  1103. return;
  1104. }
  1105. TextServer::shaped_text_draw(p_shaped, p_canvas, p_pos, p_clip_l, p_clip_r, p_color);
  1106. }
  1107. void TextServerExtension::shaped_text_draw_outline(const RID &p_shaped, const RID &p_canvas, const Vector2 &p_pos, double p_clip_l, double p_clip_r, int64_t p_outline_size, const Color &p_color) const {
  1108. if (GDVIRTUAL_CALL(_shaped_text_draw_outline, p_shaped, p_canvas, p_pos, p_clip_l, p_clip_r, p_outline_size, p_color)) {
  1109. return;
  1110. }
  1111. TextServer::shaped_text_draw_outline(p_shaped, p_canvas, p_pos, p_clip_l, p_clip_r, p_outline_size, p_color);
  1112. }
  1113. Vector2 TextServerExtension::shaped_text_get_grapheme_bounds(const RID &p_shaped, int64_t p_pos) const {
  1114. Vector2 ret;
  1115. if (GDVIRTUAL_CALL(_shaped_text_get_grapheme_bounds, p_shaped, p_pos, ret)) {
  1116. return ret;
  1117. }
  1118. return TextServer::shaped_text_get_grapheme_bounds(p_shaped, p_pos);
  1119. }
  1120. int64_t TextServerExtension::shaped_text_next_grapheme_pos(const RID &p_shaped, int64_t p_pos) const {
  1121. int64_t ret;
  1122. if (GDVIRTUAL_CALL(_shaped_text_next_grapheme_pos, p_shaped, p_pos, ret)) {
  1123. return ret;
  1124. }
  1125. return TextServer::shaped_text_next_grapheme_pos(p_shaped, p_pos);
  1126. }
  1127. int64_t TextServerExtension::shaped_text_prev_grapheme_pos(const RID &p_shaped, int64_t p_pos) const {
  1128. int64_t ret;
  1129. if (GDVIRTUAL_CALL(_shaped_text_prev_grapheme_pos, p_shaped, p_pos, ret)) {
  1130. return ret;
  1131. }
  1132. return TextServer::shaped_text_prev_grapheme_pos(p_shaped, p_pos);
  1133. }
  1134. PackedInt32Array TextServerExtension::shaped_text_get_character_breaks(const RID &p_shaped) const {
  1135. PackedInt32Array ret;
  1136. if (GDVIRTUAL_CALL(_shaped_text_get_character_breaks, p_shaped, ret)) {
  1137. return ret;
  1138. }
  1139. return PackedInt32Array();
  1140. }
  1141. int64_t TextServerExtension::shaped_text_next_character_pos(const RID &p_shaped, int64_t p_pos) const {
  1142. int64_t ret;
  1143. if (GDVIRTUAL_CALL(_shaped_text_next_character_pos, p_shaped, p_pos, ret)) {
  1144. return ret;
  1145. }
  1146. return TextServer::shaped_text_next_character_pos(p_shaped, p_pos);
  1147. }
  1148. int64_t TextServerExtension::shaped_text_prev_character_pos(const RID &p_shaped, int64_t p_pos) const {
  1149. int64_t ret;
  1150. if (GDVIRTUAL_CALL(_shaped_text_prev_character_pos, p_shaped, p_pos, ret)) {
  1151. return ret;
  1152. }
  1153. return TextServer::shaped_text_prev_character_pos(p_shaped, p_pos);
  1154. }
  1155. int64_t TextServerExtension::shaped_text_closest_character_pos(const RID &p_shaped, int64_t p_pos) const {
  1156. int64_t ret;
  1157. if (GDVIRTUAL_CALL(_shaped_text_closest_character_pos, p_shaped, p_pos, ret)) {
  1158. return ret;
  1159. }
  1160. return TextServer::shaped_text_closest_character_pos(p_shaped, p_pos);
  1161. }
  1162. String TextServerExtension::format_number(const String &p_string, const String &p_language) const {
  1163. String ret;
  1164. if (GDVIRTUAL_CALL(_format_number, p_string, p_language, ret)) {
  1165. return ret;
  1166. }
  1167. return p_string;
  1168. }
  1169. String TextServerExtension::parse_number(const String &p_string, const String &p_language) const {
  1170. String ret;
  1171. if (GDVIRTUAL_CALL(_parse_number, p_string, p_language, ret)) {
  1172. return ret;
  1173. }
  1174. return p_string;
  1175. }
  1176. String TextServerExtension::percent_sign(const String &p_language) const {
  1177. String ret = "%";
  1178. GDVIRTUAL_CALL(_percent_sign, p_language, ret);
  1179. return ret;
  1180. }
  1181. bool TextServerExtension::is_valid_identifier(const String &p_string) const {
  1182. bool ret;
  1183. if (GDVIRTUAL_CALL(_is_valid_identifier, p_string, ret)) {
  1184. return ret;
  1185. }
  1186. return TextServer::is_valid_identifier(p_string);
  1187. }
  1188. bool TextServerExtension::is_valid_letter(uint64_t p_unicode) const {
  1189. bool ret;
  1190. if (GDVIRTUAL_CALL(_is_valid_letter, p_unicode, ret)) {
  1191. return ret;
  1192. }
  1193. return TextServer::is_valid_letter(p_unicode);
  1194. }
  1195. String TextServerExtension::strip_diacritics(const String &p_string) const {
  1196. String ret;
  1197. if (GDVIRTUAL_CALL(_strip_diacritics, p_string, ret)) {
  1198. return ret;
  1199. }
  1200. return TextServer::strip_diacritics(p_string);
  1201. }
  1202. String TextServerExtension::string_to_upper(const String &p_string, const String &p_language) const {
  1203. String ret;
  1204. if (GDVIRTUAL_CALL(_string_to_upper, p_string, p_language, ret)) {
  1205. return ret;
  1206. }
  1207. return p_string;
  1208. }
  1209. String TextServerExtension::string_to_title(const String &p_string, const String &p_language) const {
  1210. String ret;
  1211. if (GDVIRTUAL_CALL(_string_to_title, p_string, p_language, ret)) {
  1212. return ret;
  1213. }
  1214. return p_string;
  1215. }
  1216. String TextServerExtension::string_to_lower(const String &p_string, const String &p_language) const {
  1217. String ret;
  1218. if (GDVIRTUAL_CALL(_string_to_lower, p_string, p_language, ret)) {
  1219. return ret;
  1220. }
  1221. return p_string;
  1222. }
  1223. TypedArray<Vector3i> TextServerExtension::parse_structured_text(StructuredTextParser p_parser_type, const Array &p_args, const String &p_text) const {
  1224. TypedArray<Vector3i> ret;
  1225. if (GDVIRTUAL_CALL(_parse_structured_text, p_parser_type, p_args, p_text, ret)) {
  1226. return ret;
  1227. }
  1228. return TextServer::parse_structured_text(p_parser_type, p_args, p_text);
  1229. }
  1230. PackedInt32Array TextServerExtension::string_get_word_breaks(const String &p_string, const String &p_language, int64_t p_chars_per_line) const {
  1231. PackedInt32Array ret;
  1232. GDVIRTUAL_CALL(_string_get_word_breaks, p_string, p_language, p_chars_per_line, ret);
  1233. return ret;
  1234. }
  1235. PackedInt32Array TextServerExtension::string_get_character_breaks(const String &p_string, const String &p_language) const {
  1236. PackedInt32Array ret;
  1237. if (GDVIRTUAL_CALL(_string_get_character_breaks, p_string, p_language, ret)) {
  1238. return ret;
  1239. }
  1240. return TextServer::string_get_character_breaks(p_string, p_language);
  1241. }
  1242. int64_t TextServerExtension::is_confusable(const String &p_string, const PackedStringArray &p_dict) const {
  1243. int64_t ret;
  1244. if (GDVIRTUAL_CALL(_is_confusable, p_string, p_dict, ret)) {
  1245. return ret;
  1246. }
  1247. return TextServer::is_confusable(p_string, p_dict);
  1248. }
  1249. bool TextServerExtension::spoof_check(const String &p_string) const {
  1250. bool ret;
  1251. if (GDVIRTUAL_CALL(_spoof_check, p_string, ret)) {
  1252. return ret;
  1253. }
  1254. return TextServer::spoof_check(p_string);
  1255. }
  1256. void TextServerExtension::cleanup() {
  1257. GDVIRTUAL_CALL(_cleanup);
  1258. }
  1259. TextServerExtension::TextServerExtension() {
  1260. //NOP
  1261. }
  1262. TextServerExtension::~TextServerExtension() {
  1263. //NOP
  1264. }