text_server_extension.cpp 61 KB

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