diff options
Diffstat (limited to 'servers/text/text_server_extension.cpp')
-rw-r--r-- | servers/text/text_server_extension.cpp | 205 |
1 files changed, 119 insertions, 86 deletions
diff --git a/servers/text/text_server_extension.cpp b/servers/text/text_server_extension.cpp index d5080e586d..eb9f1c1484 100644 --- a/servers/text/text_server_extension.cpp +++ b/servers/text/text_server_extension.cpp @@ -80,6 +80,9 @@ void TextServerExtension::_bind_methods() { GDVIRTUAL_BIND(_font_set_antialiasing, "font_rid", "antialiasing"); GDVIRTUAL_BIND(_font_get_antialiasing, "font_rid"); + GDVIRTUAL_BIND(_font_set_disable_embedded_bitmaps, "font_rid", "disable_embedded_bitmaps"); + GDVIRTUAL_BIND(_font_get_disable_embedded_bitmaps, "font_rid"); + GDVIRTUAL_BIND(_font_set_generate_mipmaps, "font_rid", "generate_mipmaps"); GDVIRTUAL_BIND(_font_get_generate_mipmaps, "font_rid"); @@ -293,6 +296,8 @@ void TextServerExtension::_bind_methods() { GDVIRTUAL_BIND(_shaped_text_get_objects, "shaped"); GDVIRTUAL_BIND(_shaped_text_get_object_rect, "shaped", "key"); + GDVIRTUAL_BIND(_shaped_text_get_object_range, "shaped", "key"); + GDVIRTUAL_BIND(_shaped_text_get_object_glyph, "shaped", "key"); GDVIRTUAL_BIND(_shaped_text_get_size, "shaped"); GDVIRTUAL_BIND(_shaped_text_get_ascent, "shaped"); @@ -321,8 +326,8 @@ void TextServerExtension::_bind_methods() { GDVIRTUAL_BIND(_shaped_text_prev_character_pos, "shaped", "pos"); GDVIRTUAL_BIND(_shaped_text_closest_character_pos, "shaped", "pos"); - GDVIRTUAL_BIND(_format_number, "string", "language"); - GDVIRTUAL_BIND(_parse_number, "string", "language"); + GDVIRTUAL_BIND(_format_number, "number", "language"); + GDVIRTUAL_BIND(_parse_number, "number", "language"); GDVIRTUAL_BIND(_percent_sign, "language"); GDVIRTUAL_BIND(_strip_diacritics, "string"); @@ -344,29 +349,29 @@ void TextServerExtension::_bind_methods() { bool TextServerExtension::has_feature(Feature p_feature) const { bool ret = false; - GDVIRTUAL_CALL(_has_feature, p_feature, ret); + GDVIRTUAL_REQUIRED_CALL(_has_feature, p_feature, ret); return ret; } String TextServerExtension::get_name() const { String ret = "Unknown"; - GDVIRTUAL_CALL(_get_name, ret); + GDVIRTUAL_REQUIRED_CALL(_get_name, ret); return ret; } int64_t TextServerExtension::get_features() const { int64_t ret = 0; - GDVIRTUAL_CALL(_get_features, ret); + GDVIRTUAL_REQUIRED_CALL(_get_features, ret); return ret; } void TextServerExtension::free_rid(const RID &p_rid) { - GDVIRTUAL_CALL(_free_rid, p_rid); + GDVIRTUAL_REQUIRED_CALL(_free_rid, p_rid); } bool TextServerExtension::has(const RID &p_rid) { bool ret = false; - GDVIRTUAL_CALL(_has, p_rid, ret); + GDVIRTUAL_REQUIRED_CALL(_has, p_rid, ret); return ret; } @@ -402,14 +407,18 @@ bool TextServerExtension::is_locale_right_to_left(const String &p_locale) const int64_t TextServerExtension::name_to_tag(const String &p_name) const { int64_t ret = 0; - GDVIRTUAL_CALL(_name_to_tag, p_name, ret); - return ret; + if (GDVIRTUAL_CALL(_name_to_tag, p_name, ret)) { + return ret; + } + return TextServer::name_to_tag(p_name); } String TextServerExtension::tag_to_name(int64_t p_tag) const { String ret; - GDVIRTUAL_CALL(_tag_to_name, p_tag, ret); - return ret; + if (GDVIRTUAL_CALL(_tag_to_name, p_tag, ret)) { + return ret; + } + return TextServer::tag_to_name(p_tag); } /*************************************************************************/ @@ -418,7 +427,7 @@ String TextServerExtension::tag_to_name(int64_t p_tag) const { RID TextServerExtension::create_font() { RID ret; - GDVIRTUAL_CALL(_create_font, ret); + GDVIRTUAL_REQUIRED_CALL(_create_font, ret); return ret; } @@ -447,7 +456,7 @@ int64_t TextServerExtension::font_get_face_index(const RID &p_font_rid) const { } int64_t TextServerExtension::font_get_face_count(const RID &p_font_rid) const { - int64_t ret = 0; + int64_t ret = 1; GDVIRTUAL_CALL(_font_get_face_count, p_font_rid, ret); return ret; } @@ -518,6 +527,16 @@ TextServer::FontAntialiasing TextServerExtension::font_get_antialiasing(const RI return ret; } +void TextServerExtension::font_set_disable_embedded_bitmaps(const RID &p_font_rid, bool p_disable_embedded_bitmaps) { + GDVIRTUAL_CALL(_font_set_disable_embedded_bitmaps, p_font_rid, p_disable_embedded_bitmaps); +} + +bool TextServerExtension::font_get_disable_embedded_bitmaps(const RID &p_font_rid) const { + bool ret = false; + GDVIRTUAL_CALL(_font_get_disable_embedded_bitmaps, p_font_rid, ret); + return ret; +} + void TextServerExtension::font_set_generate_mipmaps(const RID &p_font_rid, bool p_generate_mipmaps) { GDVIRTUAL_CALL(_font_set_generate_mipmaps, p_font_rid, p_generate_mipmaps); } @@ -559,22 +578,22 @@ int64_t TextServerExtension::font_get_msdf_size(const RID &p_font_rid) const { } void TextServerExtension::font_set_fixed_size(const RID &p_font_rid, int64_t p_fixed_size) { - GDVIRTUAL_CALL(_font_set_fixed_size, p_font_rid, p_fixed_size); + GDVIRTUAL_REQUIRED_CALL(_font_set_fixed_size, p_font_rid, p_fixed_size); } int64_t TextServerExtension::font_get_fixed_size(const RID &p_font_rid) const { int64_t ret = 0; - GDVIRTUAL_CALL(_font_get_fixed_size, p_font_rid, ret); + GDVIRTUAL_REQUIRED_CALL(_font_get_fixed_size, p_font_rid, ret); return ret; } void TextServerExtension::font_set_fixed_size_scale_mode(const RID &p_font_rid, TextServer::FixedSizeScaleMode p_fixed_size_scale_mode) { - GDVIRTUAL_CALL(_font_set_fixed_size_scale_mode, p_font_rid, p_fixed_size_scale_mode); + GDVIRTUAL_REQUIRED_CALL(_font_set_fixed_size_scale_mode, p_font_rid, p_fixed_size_scale_mode); } TextServer::FixedSizeScaleMode TextServerExtension::font_get_fixed_size_scale_mode(const RID &p_font_rid) const { FixedSizeScaleMode ret = FIXED_SIZE_SCALE_DISABLE; - GDVIRTUAL_CALL(_font_get_fixed_size_scale_mode, p_font_rid, ret); + GDVIRTUAL_REQUIRED_CALL(_font_get_fixed_size_scale_mode, p_font_rid, ret); return ret; } @@ -680,89 +699,89 @@ double TextServerExtension::font_get_oversampling(const RID &p_font_rid) const { TypedArray<Vector2i> TextServerExtension::font_get_size_cache_list(const RID &p_font_rid) const { TypedArray<Vector2i> ret; - GDVIRTUAL_CALL(_font_get_size_cache_list, p_font_rid, ret); + GDVIRTUAL_REQUIRED_CALL(_font_get_size_cache_list, p_font_rid, ret); return ret; } void TextServerExtension::font_clear_size_cache(const RID &p_font_rid) { - GDVIRTUAL_CALL(_font_clear_size_cache, p_font_rid); + GDVIRTUAL_REQUIRED_CALL(_font_clear_size_cache, p_font_rid); } void TextServerExtension::font_remove_size_cache(const RID &p_font_rid, const Vector2i &p_size) { - GDVIRTUAL_CALL(_font_remove_size_cache, p_font_rid, p_size); + GDVIRTUAL_REQUIRED_CALL(_font_remove_size_cache, p_font_rid, p_size); } void TextServerExtension::font_set_ascent(const RID &p_font_rid, int64_t p_size, double p_ascent) { - GDVIRTUAL_CALL(_font_set_ascent, p_font_rid, p_size, p_ascent); + GDVIRTUAL_REQUIRED_CALL(_font_set_ascent, p_font_rid, p_size, p_ascent); } double TextServerExtension::font_get_ascent(const RID &p_font_rid, int64_t p_size) const { double ret = 0; - GDVIRTUAL_CALL(_font_get_ascent, p_font_rid, p_size, ret); + GDVIRTUAL_REQUIRED_CALL(_font_get_ascent, p_font_rid, p_size, ret); return ret; } void TextServerExtension::font_set_descent(const RID &p_font_rid, int64_t p_size, double p_descent) { - GDVIRTUAL_CALL(_font_set_descent, p_font_rid, p_size, p_descent); + GDVIRTUAL_REQUIRED_CALL(_font_set_descent, p_font_rid, p_size, p_descent); } double TextServerExtension::font_get_descent(const RID &p_font_rid, int64_t p_size) const { double ret = 0; - GDVIRTUAL_CALL(_font_get_descent, p_font_rid, p_size, ret); + GDVIRTUAL_REQUIRED_CALL(_font_get_descent, p_font_rid, p_size, ret); return ret; } void TextServerExtension::font_set_underline_position(const RID &p_font_rid, int64_t p_size, double p_underline_position) { - GDVIRTUAL_CALL(_font_set_underline_position, p_font_rid, p_size, p_underline_position); + GDVIRTUAL_REQUIRED_CALL(_font_set_underline_position, p_font_rid, p_size, p_underline_position); } double TextServerExtension::font_get_underline_position(const RID &p_font_rid, int64_t p_size) const { double ret = 0; - GDVIRTUAL_CALL(_font_get_underline_position, p_font_rid, p_size, ret); + GDVIRTUAL_REQUIRED_CALL(_font_get_underline_position, p_font_rid, p_size, ret); return ret; } void TextServerExtension::font_set_underline_thickness(const RID &p_font_rid, int64_t p_size, double p_underline_thickness) { - GDVIRTUAL_CALL(_font_set_underline_thickness, p_font_rid, p_size, p_underline_thickness); + GDVIRTUAL_REQUIRED_CALL(_font_set_underline_thickness, p_font_rid, p_size, p_underline_thickness); } double TextServerExtension::font_get_underline_thickness(const RID &p_font_rid, int64_t p_size) const { double ret = 0; - GDVIRTUAL_CALL(_font_get_underline_thickness, p_font_rid, p_size, ret); + GDVIRTUAL_REQUIRED_CALL(_font_get_underline_thickness, p_font_rid, p_size, ret); return ret; } void TextServerExtension::font_set_scale(const RID &p_font_rid, int64_t p_size, double p_scale) { - GDVIRTUAL_CALL(_font_set_scale, p_font_rid, p_size, p_scale); + GDVIRTUAL_REQUIRED_CALL(_font_set_scale, p_font_rid, p_size, p_scale); } double TextServerExtension::font_get_scale(const RID &p_font_rid, int64_t p_size) const { double ret = 0; - GDVIRTUAL_CALL(_font_get_scale, p_font_rid, p_size, ret); + GDVIRTUAL_REQUIRED_CALL(_font_get_scale, p_font_rid, p_size, ret); return ret; } int64_t TextServerExtension::font_get_texture_count(const RID &p_font_rid, const Vector2i &p_size) const { int64_t ret = 0; - GDVIRTUAL_CALL(_font_get_texture_count, p_font_rid, p_size, ret); + GDVIRTUAL_REQUIRED_CALL(_font_get_texture_count, p_font_rid, p_size, ret); return ret; } void TextServerExtension::font_clear_textures(const RID &p_font_rid, const Vector2i &p_size) { - GDVIRTUAL_CALL(_font_clear_textures, p_font_rid, p_size); + GDVIRTUAL_REQUIRED_CALL(_font_clear_textures, p_font_rid, p_size); } void TextServerExtension::font_remove_texture(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) { - GDVIRTUAL_CALL(_font_remove_texture, p_font_rid, p_size, p_texture_index); + GDVIRTUAL_REQUIRED_CALL(_font_remove_texture, p_font_rid, p_size, p_texture_index); } 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) { - GDVIRTUAL_CALL(_font_set_texture_image, p_font_rid, p_size, p_texture_index, p_image); + GDVIRTUAL_REQUIRED_CALL(_font_set_texture_image, p_font_rid, p_size, p_texture_index, p_image); } Ref<Image> TextServerExtension::font_get_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const { Ref<Image> ret; - GDVIRTUAL_CALL(_font_get_texture_image, p_font_rid, p_size, p_texture_index, ret); + GDVIRTUAL_REQUIRED_CALL(_font_get_texture_image, p_font_rid, p_size, p_texture_index, ret); return ret; } @@ -778,77 +797,77 @@ PackedInt32Array TextServerExtension::font_get_texture_offsets(const RID &p_font PackedInt32Array TextServerExtension::font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const { PackedInt32Array ret; - GDVIRTUAL_CALL(_font_get_glyph_list, p_font_rid, p_size, ret); + GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_list, p_font_rid, p_size, ret); return ret; } void TextServerExtension::font_clear_glyphs(const RID &p_font_rid, const Vector2i &p_size) { - GDVIRTUAL_CALL(_font_clear_glyphs, p_font_rid, p_size); + GDVIRTUAL_REQUIRED_CALL(_font_clear_glyphs, p_font_rid, p_size); } void TextServerExtension::font_remove_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) { - GDVIRTUAL_CALL(_font_remove_glyph, p_font_rid, p_size, p_glyph); + GDVIRTUAL_REQUIRED_CALL(_font_remove_glyph, p_font_rid, p_size, p_glyph); } Vector2 TextServerExtension::font_get_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph) const { Vector2 ret; - GDVIRTUAL_CALL(_font_get_glyph_advance, p_font_rid, p_size, p_glyph, ret); + GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_advance, p_font_rid, p_size, p_glyph, ret); return ret; } void TextServerExtension::font_set_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph, const Vector2 &p_advance) { - GDVIRTUAL_CALL(_font_set_glyph_advance, p_font_rid, p_size, p_glyph, p_advance); + GDVIRTUAL_REQUIRED_CALL(_font_set_glyph_advance, p_font_rid, p_size, p_glyph, p_advance); } Vector2 TextServerExtension::font_get_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { Vector2 ret; - GDVIRTUAL_CALL(_font_get_glyph_offset, p_font_rid, p_size, p_glyph, ret); + GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_offset, p_font_rid, p_size, p_glyph, ret); return ret; } void TextServerExtension::font_set_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_offset) { - GDVIRTUAL_CALL(_font_set_glyph_offset, p_font_rid, p_size, p_glyph, p_offset); + GDVIRTUAL_REQUIRED_CALL(_font_set_glyph_offset, p_font_rid, p_size, p_glyph, p_offset); } Vector2 TextServerExtension::font_get_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { Vector2 ret; - GDVIRTUAL_CALL(_font_get_glyph_size, p_font_rid, p_size, p_glyph, ret); + GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_size, p_font_rid, p_size, p_glyph, ret); return ret; } void TextServerExtension::font_set_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_gl_size) { - GDVIRTUAL_CALL(_font_set_glyph_size, p_font_rid, p_size, p_glyph, p_gl_size); + GDVIRTUAL_REQUIRED_CALL(_font_set_glyph_size, p_font_rid, p_size, p_glyph, p_gl_size); } Rect2 TextServerExtension::font_get_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { Rect2 ret; - GDVIRTUAL_CALL(_font_get_glyph_uv_rect, p_font_rid, p_size, p_glyph, ret); + GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_uv_rect, p_font_rid, p_size, p_glyph, ret); return ret; } 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) { - GDVIRTUAL_CALL(_font_set_glyph_uv_rect, p_font_rid, p_size, p_glyph, p_uv_rect); + GDVIRTUAL_REQUIRED_CALL(_font_set_glyph_uv_rect, p_font_rid, p_size, p_glyph, p_uv_rect); } int64_t TextServerExtension::font_get_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { int64_t ret = 0; - GDVIRTUAL_CALL(_font_get_glyph_texture_idx, p_font_rid, p_size, p_glyph, ret); + GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_texture_idx, p_font_rid, p_size, p_glyph, ret); return ret; } 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) { - GDVIRTUAL_CALL(_font_set_glyph_texture_idx, p_font_rid, p_size, p_glyph, p_texture_idx); + GDVIRTUAL_REQUIRED_CALL(_font_set_glyph_texture_idx, p_font_rid, p_size, p_glyph, p_texture_idx); } RID TextServerExtension::font_get_glyph_texture_rid(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { RID ret; - GDVIRTUAL_CALL(_font_get_glyph_texture_rid, p_font_rid, p_size, p_glyph, ret); + GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_texture_rid, p_font_rid, p_size, p_glyph, ret); return ret; } Size2 TextServerExtension::font_get_glyph_texture_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { Size2 ret; - GDVIRTUAL_CALL(_font_get_glyph_texture_size, p_font_rid, p_size, p_glyph, ret); + GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_texture_size, p_font_rid, p_size, p_glyph, ret); return ret; } @@ -884,25 +903,25 @@ Vector2 TextServerExtension::font_get_kerning(const RID &p_font_rid, int64_t p_s 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 { int64_t ret = 0; - GDVIRTUAL_CALL(_font_get_glyph_index, p_font_rid, p_size, p_char, p_variation_selector, ret); + GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_index, p_font_rid, p_size, p_char, p_variation_selector, ret); return ret; } int64_t TextServerExtension::font_get_char_from_glyph_index(const RID &p_font_rid, int64_t p_size, int64_t p_glyph_index) const { int64_t ret = 0; - GDVIRTUAL_CALL(_font_get_char_from_glyph_index, p_font_rid, p_size, p_glyph_index, ret); + GDVIRTUAL_REQUIRED_CALL(_font_get_char_from_glyph_index, p_font_rid, p_size, p_glyph_index, ret); return ret; } bool TextServerExtension::font_has_char(const RID &p_font_rid, int64_t p_char) const { bool ret = false; - GDVIRTUAL_CALL(_font_has_char, p_font_rid, p_char, ret); + GDVIRTUAL_REQUIRED_CALL(_font_has_char, p_font_rid, p_char, ret); return ret; } String TextServerExtension::font_get_supported_chars(const RID &p_font_rid) const { String ret; - GDVIRTUAL_CALL(_font_get_supported_chars, p_font_rid, ret); + GDVIRTUAL_REQUIRED_CALL(_font_get_supported_chars, p_font_rid, ret); return ret; } @@ -915,11 +934,11 @@ void TextServerExtension::font_render_glyph(const RID &p_font_rid, const Vector2 } 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 { - GDVIRTUAL_CALL(_font_draw_glyph, p_font_rid, p_canvas, p_size, p_pos, p_index, p_color); + GDVIRTUAL_REQUIRED_CALL(_font_draw_glyph, p_font_rid, p_canvas, p_size, p_pos, p_index, p_color); } 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 { - GDVIRTUAL_CALL(_font_draw_glyph_outline, p_font_rid, p_canvas, p_size, p_outline_size, p_pos, p_index, p_color); + GDVIRTUAL_REQUIRED_CALL(_font_draw_glyph_outline, p_font_rid, p_canvas, p_size, p_outline_size, p_pos, p_index, p_color); } bool TextServerExtension::font_is_language_supported(const RID &p_font_rid, const String &p_language) const { @@ -1026,12 +1045,12 @@ void TextServerExtension::draw_hex_code_box(const RID &p_canvas, int64_t p_size, RID TextServerExtension::create_shaped_text(TextServer::Direction p_direction, TextServer::Orientation p_orientation) { RID ret; - GDVIRTUAL_CALL(_create_shaped_text, p_direction, p_orientation, ret); + GDVIRTUAL_REQUIRED_CALL(_create_shaped_text, p_direction, p_orientation, ret); return ret; } void TextServerExtension::shaped_text_clear(const RID &p_shaped) { - GDVIRTUAL_CALL(_shaped_text_clear, p_shaped); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_clear, p_shaped); } void TextServerExtension::shaped_text_set_direction(const RID &p_shaped, TextServer::Direction p_direction) { @@ -1116,47 +1135,47 @@ int64_t TextServerExtension::shaped_text_get_spacing(const RID &p_shaped, TextSe 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) { bool ret = false; - GDVIRTUAL_CALL(_shaped_text_add_string, p_shaped, p_text, p_fonts, p_size, p_opentype_features, p_language, p_meta, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_add_string, p_shaped, p_text, p_fonts, p_size, p_opentype_features, p_language, p_meta, ret); return ret; } 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) { bool ret = false; - GDVIRTUAL_CALL(_shaped_text_add_object, p_shaped, p_key, p_size, p_inline_align, p_length, p_baseline, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_add_object, p_shaped, p_key, p_size, p_inline_align, p_length, p_baseline, ret); return ret; } 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) { bool ret = false; - GDVIRTUAL_CALL(_shaped_text_resize_object, p_shaped, p_key, p_size, p_inline_align, p_baseline, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_resize_object, p_shaped, p_key, p_size, p_inline_align, p_baseline, ret); return ret; } int64_t TextServerExtension::shaped_get_span_count(const RID &p_shaped) const { int64_t ret = 0; - GDVIRTUAL_CALL(_shaped_get_span_count, p_shaped, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_get_span_count, p_shaped, ret); return ret; } Variant TextServerExtension::shaped_get_span_meta(const RID &p_shaped, int64_t p_index) const { Variant ret = false; - GDVIRTUAL_CALL(_shaped_get_span_meta, p_shaped, p_index, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_get_span_meta, p_shaped, p_index, ret); return ret; } 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) { - GDVIRTUAL_CALL(_shaped_set_span_update_font, p_shaped, p_index, p_fonts, p_size, p_opentype_features); + GDVIRTUAL_REQUIRED_CALL(_shaped_set_span_update_font, p_shaped, p_index, p_fonts, p_size, p_opentype_features); } RID TextServerExtension::shaped_text_substr(const RID &p_shaped, int64_t p_start, int64_t p_length) const { RID ret; - GDVIRTUAL_CALL(_shaped_text_substr, p_shaped, p_start, p_length, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_substr, p_shaped, p_start, p_length, ret); return ret; } RID TextServerExtension::shaped_text_get_parent(const RID &p_shaped) const { RID ret; - GDVIRTUAL_CALL(_shaped_text_get_parent, p_shaped, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_parent, p_shaped, ret); return ret; } @@ -1174,7 +1193,7 @@ double TextServerExtension::shaped_text_tab_align(const RID &p_shaped, const Pac bool TextServerExtension::shaped_text_shape(const RID &p_shaped) { bool ret = false; - GDVIRTUAL_CALL(_shaped_text_shape, p_shaped, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_shape, p_shaped, ret); return ret; } @@ -1192,31 +1211,31 @@ bool TextServerExtension::shaped_text_update_justification_ops(const RID &p_shap bool TextServerExtension::shaped_text_is_ready(const RID &p_shaped) const { bool ret = false; - GDVIRTUAL_CALL(_shaped_text_is_ready, p_shaped, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_is_ready, p_shaped, ret); return ret; } const Glyph *TextServerExtension::shaped_text_get_glyphs(const RID &p_shaped) const { GDExtensionConstPtr<const Glyph> ret; - GDVIRTUAL_CALL(_shaped_text_get_glyphs, p_shaped, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_glyphs, p_shaped, ret); return ret; } const Glyph *TextServerExtension::shaped_text_sort_logical(const RID &p_shaped) { GDExtensionConstPtr<const Glyph> ret; - GDVIRTUAL_CALL(_shaped_text_sort_logical, p_shaped, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_sort_logical, p_shaped, ret); return ret; } int64_t TextServerExtension::shaped_text_get_glyph_count(const RID &p_shaped) const { int64_t ret = 0; - GDVIRTUAL_CALL(_shaped_text_get_glyph_count, p_shaped, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_glyph_count, p_shaped, ret); return ret; } Vector2i TextServerExtension::shaped_text_get_range(const RID &p_shaped) const { Vector2i ret; - GDVIRTUAL_CALL(_shaped_text_get_range, p_shaped, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_range, p_shaped, ret); return ret; } @@ -1246,25 +1265,25 @@ PackedInt32Array TextServerExtension::shaped_text_get_word_breaks(const RID &p_s int64_t TextServerExtension::shaped_text_get_trim_pos(const RID &p_shaped) const { int64_t ret = -1; - GDVIRTUAL_CALL(_shaped_text_get_trim_pos, p_shaped, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_trim_pos, p_shaped, ret); return ret; } int64_t TextServerExtension::shaped_text_get_ellipsis_pos(const RID &p_shaped) const { int64_t ret = -1; - GDVIRTUAL_CALL(_shaped_text_get_ellipsis_pos, p_shaped, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_ellipsis_pos, p_shaped, ret); return ret; } const Glyph *TextServerExtension::shaped_text_get_ellipsis_glyphs(const RID &p_shaped) const { GDExtensionConstPtr<const Glyph> ret; - GDVIRTUAL_CALL(_shaped_text_get_ellipsis_glyphs, p_shaped, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_ellipsis_glyphs, p_shaped, ret); return ret; } int64_t TextServerExtension::shaped_text_get_ellipsis_glyph_count(const RID &p_shaped) const { int64_t ret = -1; - GDVIRTUAL_CALL(_shaped_text_get_ellipsis_glyph_count, p_shaped, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_ellipsis_glyph_count, p_shaped, ret); return ret; } @@ -1274,49 +1293,61 @@ void TextServerExtension::shaped_text_overrun_trim_to_width(const RID &p_shaped_ Array TextServerExtension::shaped_text_get_objects(const RID &p_shaped) const { Array ret; - GDVIRTUAL_CALL(_shaped_text_get_objects, p_shaped, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_objects, p_shaped, ret); return ret; } Rect2 TextServerExtension::shaped_text_get_object_rect(const RID &p_shaped, const Variant &p_key) const { Rect2 ret; - GDVIRTUAL_CALL(_shaped_text_get_object_rect, p_shaped, p_key, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_object_rect, p_shaped, p_key, ret); + return ret; +} + +Vector2i TextServerExtension::shaped_text_get_object_range(const RID &p_shaped, const Variant &p_key) const { + Vector2i ret; + GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_object_range, p_shaped, p_key, ret); + return ret; +} + +int64_t TextServerExtension::shaped_text_get_object_glyph(const RID &p_shaped, const Variant &p_key) const { + int64_t ret = -1; + GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_object_glyph, p_shaped, p_key, ret); return ret; } Size2 TextServerExtension::shaped_text_get_size(const RID &p_shaped) const { Size2 ret; - GDVIRTUAL_CALL(_shaped_text_get_size, p_shaped, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_size, p_shaped, ret); return ret; } double TextServerExtension::shaped_text_get_ascent(const RID &p_shaped) const { double ret = 0; - GDVIRTUAL_CALL(_shaped_text_get_ascent, p_shaped, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_ascent, p_shaped, ret); return ret; } double TextServerExtension::shaped_text_get_descent(const RID &p_shaped) const { double ret = 0; - GDVIRTUAL_CALL(_shaped_text_get_descent, p_shaped, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_descent, p_shaped, ret); return ret; } double TextServerExtension::shaped_text_get_width(const RID &p_shaped) const { double ret = 0; - GDVIRTUAL_CALL(_shaped_text_get_width, p_shaped, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_width, p_shaped, ret); return ret; } double TextServerExtension::shaped_text_get_underline_position(const RID &p_shaped) const { double ret = 0; - GDVIRTUAL_CALL(_shaped_text_get_underline_position, p_shaped, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_underline_position, p_shaped, ret); return ret; } double TextServerExtension::shaped_text_get_underline_thickness(const RID &p_shaped) const { double ret = 0; - GDVIRTUAL_CALL(_shaped_text_get_underline_thickness, p_shaped, ret); + GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_underline_thickness, p_shaped, ret); return ret; } @@ -1486,8 +1517,10 @@ String TextServerExtension::string_to_lower(const String &p_string, const String TypedArray<Vector3i> TextServerExtension::parse_structured_text(StructuredTextParser p_parser_type, const Array &p_args, const String &p_text) const { TypedArray<Vector3i> ret; - GDVIRTUAL_CALL(_parse_structured_text, p_parser_type, p_args, p_text, ret); - return ret; + if (GDVIRTUAL_CALL(_parse_structured_text, p_parser_type, p_args, p_text, ret)) { + return ret; + } + return TextServer::parse_structured_text(p_parser_type, p_args, p_text); } PackedInt32Array TextServerExtension::string_get_word_breaks(const String &p_string, const String &p_language, int64_t p_chars_per_line) const { |