text_server_extension.cpp 54 KB

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