text_server_extension.cpp 62 KB

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