text_server_extension.cpp 58 KB

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