text_server_extension.cpp 62 KB

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