text_server_extension.cpp 57 KB

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