diff options
27 files changed, 2292 insertions, 1823 deletions
diff --git a/core/extension/make_wrappers.py b/core/extension/make_wrappers.py index 862d313fba..1e4634ad2c 100644 --- a/core/extension/make_wrappers.py +++ b/core/extension/make_wrappers.py @@ -1,4 +1,60 @@ -proto = """ +proto_mod = """ +#define MODBIND$VER($RETTYPE m_name$ARG) \\ +virtual $RETVAL _##m_name($FUNCARGS) $CONST; \\ +_FORCE_INLINE_ virtual $RETVAL m_name($FUNCARGS) $CONST override { \\ + $RETX _##m_name($CALLARGS);\\ +} +""" + + +def generate_mod_version(argcount, const=False, returns=False): + s = proto_mod + sproto = str(argcount) + method_info = "" + if returns: + sproto += "R" + s = s.replace("$RETTYPE", "m_ret, ") + s = s.replace("$RETVAL", "m_ret") + s = s.replace("$RETX", "return") + + else: + s = s.replace("$RETTYPE", "") + s = s.replace("$RETVAL", "void") + s = s.replace("$RETX", "") + + if const: + sproto += "C" + s = s.replace("$CONST", "const") + else: + s = s.replace("$CONST", "") + + s = s.replace("$VER", sproto) + argtext = "" + funcargs = "" + callargs = "" + + for i in range(argcount): + if i > 0: + funcargs += ", " + callargs += ", " + + argtext += ", m_type" + str(i + 1) + funcargs += "m_type" + str(i + 1) + " arg" + str(i + 1) + callargs += "arg" + str(i + 1) + + if argcount: + s = s.replace("$ARG", argtext) + s = s.replace("$FUNCARGS", funcargs) + s = s.replace("$CALLARGS", callargs) + else: + s = s.replace("$ARG", "") + s = s.replace("$FUNCARGS", funcargs) + s = s.replace("$CALLARGS", callargs) + + return s + + +proto_ex = """ #define EXBIND$VER($RETTYPE m_name$ARG) \\ GDVIRTUAL$VER($RETTYPE_##m_name$ARG)\\ virtual $RETVAL m_name($FUNCARGS) $CONST override { \\ @@ -9,8 +65,8 @@ virtual $RETVAL m_name($FUNCARGS) $CONST override { \\ """ -def generate_version(argcount, const=False, returns=False): - s = proto +def generate_ex_version(argcount, const=False, returns=False): + s = proto_ex sproto = str(argcount) method_info = "" if returns: @@ -63,25 +119,28 @@ def generate_version(argcount, const=False, returns=False): def run(target, source, env): - max_versions = 12 txt = """ #ifndef GDEXTENSION_WRAPPERS_GEN_H #define GDEXTENSION_WRAPPERS_GEN_H - - """ for i in range(max_versions + 1): + txt += "\n/* Extension Wrapper " + str(i) + " Arguments */\n" + txt += generate_ex_version(i, False, False) + txt += generate_ex_version(i, False, True) + txt += generate_ex_version(i, True, False) + txt += generate_ex_version(i, True, True) - txt += "/* " + str(i) + " Arguments */\n\n" - txt += generate_version(i, False, False) - txt += generate_version(i, False, True) - txt += generate_version(i, True, False) - txt += generate_version(i, True, True) + for i in range(max_versions + 1): + txt += "\n/* Module Wrapper " + str(i) + " Arguments */\n" + txt += generate_mod_version(i, False, False) + txt += generate_mod_version(i, False, True) + txt += generate_mod_version(i, True, False) + txt += generate_mod_version(i, True, True) - txt += "#endif" + txt += "\n#endif\n" with open(target[0], "w") as f: f.write(txt) diff --git a/core/variant/variant_utility.cpp b/core/variant/variant_utility.cpp index 5bad27c607..670b66d53e 100644 --- a/core/variant/variant_utility.cpp +++ b/core/variant/variant_utility.cpp @@ -128,8 +128,8 @@ struct VariantUtilityFunctions { return Math::floor(x); } - static inline int floori(double x) { - return int(Math::floor(x)); + static inline int64_t floori(double x) { + return int64_t(Math::floor(x)); } static inline Variant ceil(Variant x, Callable::CallError &r_error) { @@ -161,8 +161,8 @@ struct VariantUtilityFunctions { return Math::ceil(x); } - static inline int ceili(double x) { - return int(Math::ceil(x)); + static inline int64_t ceili(double x) { + return int64_t(Math::ceil(x)); } static inline Variant round(Variant x, Callable::CallError &r_error) { @@ -194,8 +194,8 @@ struct VariantUtilityFunctions { return Math::round(x); } - static inline int roundi(double x) { - return int(Math::round(x)); + static inline int64_t roundi(double x) { + return int64_t(Math::round(x)); } static inline Variant abs(const Variant &x, Callable::CallError &r_error) { diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml index 2e67c61e54..2512c563c5 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -1565,6 +1565,8 @@ <constant name="FONT_LCD_SUBPIXEL_LAYOUT_VBGR" value="4" enum="FontLCDSubpixelLayout"> Vertical BGR sub-pixel layout. </constant> + <constant name="FONT_LCD_SUBPIXEL_LAYOUT_MAX" value="5" enum="FontLCDSubpixelLayout"> + </constant> <constant name="DIRECTION_AUTO" value="0" enum="Direction"> Text direction is determined based on contents and current locale. </constant> diff --git a/doc/classes/TextServerExtension.xml b/doc/classes/TextServerExtension.xml index 4886bf0757..37d2698dd4 100644 --- a/doc/classes/TextServerExtension.xml +++ b/doc/classes/TextServerExtension.xml @@ -9,21 +9,19 @@ <tutorials> </tutorials> <methods> - <method name="create_font" qualifiers="virtual"> + <method name="_create_font" qualifiers="virtual"> <return type="RID" /> <description> - Creates new, empty font cache entry resource. To free the resulting resourec, use [method free_rid] method. </description> </method> - <method name="create_shaped_text" qualifiers="virtual"> + <method name="_create_shaped_text" qualifiers="virtual"> <return type="RID" /> <param index="0" name="direction" type="int" enum="TextServer.Direction" /> <param index="1" name="orientation" type="int" enum="TextServer.Orientation" /> <description> - Creates new buffer for complex text layout, with the given [param direction] and [param orientation]. To free the resulting buffer, use [method free_rid] method. </description> </method> - <method name="draw_hex_code_box" qualifiers="virtual const"> + <method name="_draw_hex_code_box" qualifiers="virtual const"> <return type="void" /> <param index="0" name="canvas" type="RID" /> <param index="1" name="size" type="int" /> @@ -31,42 +29,36 @@ <param index="3" name="index" type="int" /> <param index="4" name="color" type="Color" /> <description> - Draws box displaying character hexadecimal code. Used for replacing missing characters. - [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="font_clear_glyphs" qualifiers="virtual"> + <method name="_font_clear_glyphs" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <description> - Removes all rendered glyphs information from the cache entry. </description> </method> - <method name="font_clear_kerning_map" qualifiers="virtual"> + <method name="_font_clear_kerning_map" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="int" /> <description> - Removes all kerning overrides. </description> </method> - <method name="font_clear_size_cache" qualifiers="virtual"> + <method name="_font_clear_size_cache" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <description> - Removes all font sizes from the cache entry. </description> </method> - <method name="font_clear_textures" qualifiers="virtual"> + <method name="_font_clear_textures" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <description> - Removes all textures from font cache entry. </description> </method> - <method name="font_draw_glyph" qualifiers="virtual const"> + <method name="_font_draw_glyph" qualifiers="virtual const"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="canvas" type="RID" /> @@ -75,10 +67,9 @@ <param index="4" name="index" type="int" /> <param index="5" name="color" type="Color" /> <description> - Draws single glyph into a canvas item at the position, using [param font_rid] at the size [param size]. </description> </method> - <method name="font_draw_glyph_outline" qualifiers="virtual const"> + <method name="_font_draw_glyph_outline" qualifiers="virtual const"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="canvas" type="RID" /> @@ -88,897 +79,779 @@ <param index="5" name="index" type="int" /> <param index="6" name="color" type="Color" /> <description> - Draws single glyph outline of size [param outline_size] into a canvas item at the position, using [param font_rid] at the size [param size]. </description> </method> - <method name="font_get_antialiasing" qualifiers="virtual const"> + <method name="_font_get_antialiasing" qualifiers="virtual const"> <return type="int" enum="TextServer.FontAntialiasing" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns font anti-aliasing mode. </description> </method> - <method name="font_get_ascent" qualifiers="virtual const"> + <method name="_font_get_ascent" qualifiers="virtual const"> <return type="float" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="int" /> <description> - Returns the font ascent (number of pixels above the baseline). </description> </method> - <method name="font_get_descent" qualifiers="virtual const"> + <method name="_font_get_descent" qualifiers="virtual const"> <return type="float" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="int" /> <description> - Returns the font descent (number of pixels below the baseline). </description> </method> - <method name="font_get_embolden" qualifiers="virtual const"> + <method name="_font_get_embolden" qualifiers="virtual const"> <return type="float" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns font embolden strength. </description> </method> - <method name="font_get_face_count" qualifiers="virtual const"> + <method name="_font_get_face_count" qualifiers="virtual const"> <return type="int" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns number of faces in the TrueType / OpenType collection. </description> </method> - <method name="font_get_face_index" qualifiers="virtual const"> + <method name="_font_get_face_index" qualifiers="virtual const"> <return type="int" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns an active face index in the TrueType / OpenType collection. </description> </method> - <method name="font_get_fixed_size" qualifiers="virtual const"> + <method name="_font_get_fixed_size" qualifiers="virtual const"> <return type="int" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns bitmap font fixed size. </description> </method> - <method name="font_get_generate_mipmaps" qualifiers="virtual const"> + <method name="_font_get_generate_mipmaps" qualifiers="virtual const"> <return type="bool" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns [code]true[/code] if font texture mipmap generation is enabled. </description> </method> - <method name="font_get_global_oversampling" qualifiers="virtual const"> + <method name="_font_get_global_oversampling" qualifiers="virtual const"> <return type="float" /> <description> - Returns the font oversampling factor, shared by all fonts in the TextServer. </description> </method> - <method name="font_get_glyph_advance" qualifiers="virtual const"> + <method name="_font_get_glyph_advance" qualifiers="virtual const"> <return type="Vector2" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="int" /> <param index="2" name="glyph" type="int" /> <description> - Returns glyph advance (offset of the next glyph). </description> </method> - <method name="font_get_glyph_contours" qualifiers="virtual const"> + <method name="_font_get_glyph_contours" qualifiers="virtual const"> <return type="Dictionary" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="int" /> <param index="2" name="index" type="int" /> <description> - Returns outline contours of the glyph as a [code]Dictionary[/code] with the following contents: - [code]points[/code] - [PackedVector3Array], containing outline points. [code]x[/code] and [code]y[/code] are point coordinates. [code]z[/code] is the type of the point, using the [enum TextServer.ContourPointTag] values. - [code]contours[/code] - [PackedInt32Array], containing indices the end points of each contour. - [code]orientation[/code] - [bool], contour orientation. If [code]true[/code], clockwise contours must be filled. </description> </method> - <method name="font_get_glyph_index" qualifiers="virtual const"> + <method name="_font_get_glyph_index" qualifiers="virtual const"> <return type="int" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="int" /> <param index="2" name="char" type="int" /> <param index="3" name="variation_selector" type="int" /> <description> - Returns the glyph index of a [param char], optionally modified by the [param variation_selector]. </description> </method> - <method name="font_get_glyph_list" qualifiers="virtual const"> + <method name="_font_get_glyph_list" qualifiers="virtual const"> <return type="PackedInt32Array" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <description> - Returns list of rendered glyphs in the cache entry. </description> </method> - <method name="font_get_glyph_offset" qualifiers="virtual const"> + <method name="_font_get_glyph_offset" qualifiers="virtual const"> <return type="Vector2" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <param index="2" name="glyph" type="int" /> <description> - Returns glyph offset from the baseline. </description> </method> - <method name="font_get_glyph_size" qualifiers="virtual const"> + <method name="_font_get_glyph_size" qualifiers="virtual const"> <return type="Vector2" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <param index="2" name="glyph" type="int" /> <description> - Returns size of the glyph. </description> </method> - <method name="font_get_glyph_texture_idx" qualifiers="virtual const"> + <method name="_font_get_glyph_texture_idx" qualifiers="virtual const"> <return type="int" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <param index="2" name="glyph" type="int" /> <description> - Returns index of the cache texture containing the glyph. </description> </method> - <method name="font_get_glyph_texture_rid" qualifiers="virtual const"> + <method name="_font_get_glyph_texture_rid" qualifiers="virtual const"> <return type="RID" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <param index="2" name="glyph" type="int" /> <description> - Returns resource id of the cache texture containing the glyph. </description> </method> - <method name="font_get_glyph_texture_size" qualifiers="virtual const"> + <method name="_font_get_glyph_texture_size" qualifiers="virtual const"> <return type="Vector2" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <param index="2" name="glyph" type="int" /> <description> - Returns size of the cache texture containing the glyph. </description> </method> - <method name="font_get_glyph_uv_rect" qualifiers="virtual const"> + <method name="_font_get_glyph_uv_rect" qualifiers="virtual const"> <return type="Rect2" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <param index="2" name="glyph" type="int" /> <description> - Returns rectangle in the cache texture containing the glyph. </description> </method> - <method name="font_get_hinting" qualifiers="virtual const"> + <method name="_font_get_hinting" qualifiers="virtual const"> <return type="int" enum="TextServer.Hinting" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns the font hinting mode. Used by dynamic fonts only. </description> </method> - <method name="font_get_kerning" qualifiers="virtual const"> + <method name="_font_get_kerning" qualifiers="virtual const"> <return type="Vector2" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="int" /> <param index="2" name="glyph_pair" type="Vector2i" /> <description> - Returns kerning for the pair of glyphs. </description> </method> - <method name="font_get_kerning_list" qualifiers="virtual const"> + <method name="_font_get_kerning_list" qualifiers="virtual const"> <return type="Vector2i[]" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="int" /> <description> - Returns list of the kerning overrides. </description> </method> - <method name="font_get_language_support_override" qualifiers="virtual"> + <method name="_font_get_language_support_override" qualifiers="virtual"> <return type="bool" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="language" type="String" /> <description> - Returns [code]true[/code] if support override is enabled for the [param language]. </description> </method> - <method name="font_get_language_support_overrides" qualifiers="virtual"> + <method name="_font_get_language_support_overrides" qualifiers="virtual"> <return type="PackedStringArray" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns list of language support overrides. </description> </method> - <method name="font_get_msdf_pixel_range" qualifiers="virtual const"> + <method name="_font_get_msdf_pixel_range" qualifiers="virtual const"> <return type="int" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns the width of the range around the shape between the minimum and maximum representable signed distance. </description> </method> - <method name="font_get_msdf_size" qualifiers="virtual const"> + <method name="_font_get_msdf_size" qualifiers="virtual const"> <return type="int" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns source font size used to generate MSDF textures. </description> </method> - <method name="font_get_name" qualifiers="virtual const"> + <method name="_font_get_name" qualifiers="virtual const"> <return type="String" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns font family name. </description> </method> - <method name="font_get_opentype_feature_overrides" qualifiers="virtual const"> + <method name="_font_get_opentype_feature_overrides" qualifiers="virtual const"> <return type="Dictionary" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns font OpenType feature set override. </description> </method> - <method name="font_get_oversampling" qualifiers="virtual const"> + <method name="_font_get_oversampling" qualifiers="virtual const"> <return type="float" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns font oversampling factor, if set to [code]0.0[/code] global oversampling factor is used instead. Used by dynamic fonts only. </description> </method> - <method name="font_get_scale" qualifiers="virtual const"> + <method name="_font_get_scale" qualifiers="virtual const"> <return type="float" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="int" /> <description> - Returns scaling factor of the color bitmap font. </description> </method> - <method name="font_get_script_support_override" qualifiers="virtual"> + <method name="_font_get_script_support_override" qualifiers="virtual"> <return type="bool" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="script" type="String" /> <description> - Returns [code]true[/code] if support override is enabled for the [param script]. </description> </method> - <method name="font_get_script_support_overrides" qualifiers="virtual"> + <method name="_font_get_script_support_overrides" qualifiers="virtual"> <return type="PackedStringArray" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns list of script support overrides. </description> </method> - <method name="font_get_size_cache_list" qualifiers="virtual const"> + <method name="_font_get_size_cache_list" qualifiers="virtual const"> <return type="Vector2i[]" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size. </description> </method> - <method name="font_get_style" qualifiers="virtual const"> + <method name="_font_get_style" qualifiers="virtual const"> <return type="int" enum="TextServer.FontStyle" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns font style flags, see [enum TextServer.FontStyle]. </description> </method> - <method name="font_get_style_name" qualifiers="virtual const"> + <method name="_font_get_style_name" qualifiers="virtual const"> <return type="String" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns font style name. </description> </method> - <method name="font_get_subpixel_positioning" qualifiers="virtual const"> + <method name="_font_get_subpixel_positioning" qualifiers="virtual const"> <return type="int" enum="TextServer.SubpixelPositioning" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns font sub-pixel glyph positioning mode. </description> </method> - <method name="font_get_supported_chars" qualifiers="virtual const"> + <method name="_font_get_supported_chars" qualifiers="virtual const"> <return type="String" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns a string containing all the characters available in the font. </description> </method> - <method name="font_get_texture_count" qualifiers="virtual const"> + <method name="_font_get_texture_count" qualifiers="virtual const"> <return type="int" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <description> - Returns number of textures used by font cache entry. </description> </method> - <method name="font_get_texture_image" qualifiers="virtual const"> + <method name="_font_get_texture_image" qualifiers="virtual const"> <return type="Image" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <param index="2" name="texture_index" type="int" /> <description> - Returns font cache texture image data. </description> </method> - <method name="font_get_texture_offsets" qualifiers="virtual const"> + <method name="_font_get_texture_offsets" qualifiers="virtual const"> <return type="PackedInt32Array" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <param index="2" name="texture_index" type="int" /> <description> - Returns array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty. </description> </method> - <method name="font_get_transform" qualifiers="virtual const"> + <method name="_font_get_transform" qualifiers="virtual const"> <return type="Transform2D" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns 2D transform applied to the font outlines. </description> </method> - <method name="font_get_underline_position" qualifiers="virtual const"> + <method name="_font_get_underline_position" qualifiers="virtual const"> <return type="float" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="int" /> <description> - Returns pixel offset of the underline below the baseline. </description> </method> - <method name="font_get_underline_thickness" qualifiers="virtual const"> + <method name="_font_get_underline_thickness" qualifiers="virtual const"> <return type="float" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="int" /> <description> - Returns thickness of the underline in pixels. </description> </method> - <method name="font_get_variation_coordinates" qualifiers="virtual const"> + <method name="_font_get_variation_coordinates" qualifiers="virtual const"> <return type="Dictionary" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns variation coordinates for the specified font cache entry. See [method font_supported_variation_list] for more info. </description> </method> - <method name="font_has_char" qualifiers="virtual const"> + <method name="_font_has_char" qualifiers="virtual const"> <return type="bool" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="char" type="int" /> <description> - Returns [code]true[/code] if a Unicode [param char] is available in the font. </description> </method> - <method name="font_is_force_autohinter" qualifiers="virtual const"> + <method name="_font_is_force_autohinter" qualifiers="virtual const"> <return type="bool" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns [code]true[/code] if auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only. </description> </method> - <method name="font_is_language_supported" qualifiers="virtual const"> + <method name="_font_is_language_supported" qualifiers="virtual const"> <return type="bool" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="language" type="String" /> <description> - Returns [code]true[/code], if font supports given language ([url=https://en.wikipedia.org/wiki/ISO_639-1]ISO 639[/url] code). </description> </method> - <method name="font_is_multichannel_signed_distance_field" qualifiers="virtual const"> + <method name="_font_is_multichannel_signed_distance_field" qualifiers="virtual const"> <return type="bool" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns [code]true[/code] if glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data. </description> </method> - <method name="font_is_script_supported" qualifiers="virtual const"> + <method name="_font_is_script_supported" qualifiers="virtual const"> <return type="bool" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="script" type="String" /> <description> - Returns [code]true[/code], if font supports given script (ISO 15924 code). </description> </method> - <method name="font_remove_glyph" qualifiers="virtual"> + <method name="_font_remove_glyph" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <param index="2" name="glyph" type="int" /> <description> - Removes specified rendered glyph information from the cache entry. </description> </method> - <method name="font_remove_kerning" qualifiers="virtual"> + <method name="_font_remove_kerning" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="int" /> <param index="2" name="glyph_pair" type="Vector2i" /> <description> - Removes kerning override for the pair of glyphs. </description> </method> - <method name="font_remove_language_support_override" qualifiers="virtual"> + <method name="_font_remove_language_support_override" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="language" type="String" /> <description> - Remove language support override. </description> </method> - <method name="font_remove_script_support_override" qualifiers="virtual"> + <method name="_font_remove_script_support_override" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="script" type="String" /> <description> - Removes script support override. </description> </method> - <method name="font_remove_size_cache" qualifiers="virtual"> + <method name="_font_remove_size_cache" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <description> - Removes specified font size from the cache entry. </description> </method> - <method name="font_remove_texture" qualifiers="virtual"> + <method name="_font_remove_texture" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <param index="2" name="texture_index" type="int" /> <description> - Removes specified texture from the cache entry. </description> </method> - <method name="font_render_glyph" qualifiers="virtual"> + <method name="_font_render_glyph" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <param index="2" name="index" type="int" /> <description> - Renders specified glyph to the font cache texture. </description> </method> - <method name="font_render_range" qualifiers="virtual"> + <method name="_font_render_range" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <param index="2" name="start" type="int" /> <param index="3" name="end" type="int" /> <description> - Renders the range of characters to the font cache texture. </description> </method> - <method name="font_set_antialiasing" qualifiers="virtual"> + <method name="_font_set_antialiasing" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="antialiasing" type="int" enum="TextServer.FontAntialiasing" /> <description> - Sets font anti-aliasing mode. </description> </method> - <method name="font_set_ascent" qualifiers="virtual"> + <method name="_font_set_ascent" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="int" /> <param index="2" name="ascent" type="float" /> <description> - Sets the font ascent (number of pixels above the baseline). </description> </method> - <method name="font_set_data" qualifiers="virtual"> + <method name="_font_set_data" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="data" type="PackedByteArray" /> <description> - Sets font source data, e.g contents of the dynamic font source file. </description> </method> - <method name="font_set_data_ptr" qualifiers="virtual"> + <method name="_font_set_data_ptr" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="data_ptr" type="const uint8_t*" /> <param index="2" name="data_size" type="int" /> <description> - Sets font source data, e.g contents of the dynamic font source file. [param data_ptr] memory buffer must remain accessible during font lifetime. </description> </method> - <method name="font_set_descent" qualifiers="virtual"> + <method name="_font_set_descent" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="int" /> <param index="2" name="descent" type="float" /> <description> - Sets the font descent (number of pixels below the baseline). </description> </method> - <method name="font_set_embolden" qualifiers="virtual"> + <method name="_font_set_embolden" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="strength" type="float" /> <description> - Sets font embolden strength. If [param strength] is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. </description> </method> - <method name="font_set_face_index" qualifiers="virtual"> + <method name="_font_set_face_index" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="face_index" type="int" /> <description> - Sets an active face index in the TrueType / OpenType collection. </description> </method> - <method name="font_set_fixed_size" qualifiers="virtual"> + <method name="_font_set_fixed_size" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="fixed_size" type="int" /> <description> - Sets bitmap font fixed size. If set to value greater than zero, same cache entry will be used for all font sizes. </description> </method> - <method name="font_set_force_autohinter" qualifiers="virtual"> + <method name="_font_set_force_autohinter" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="force_autohinter" type="bool" /> <description> - If set to [code]true[/code] auto-hinting is preferred over font built-in hinting. </description> </method> - <method name="font_set_generate_mipmaps" qualifiers="virtual"> + <method name="_font_set_generate_mipmaps" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="generate_mipmaps" type="bool" /> <description> - If set to [code]true[/code] font texture mipmap generation is enabled. </description> </method> - <method name="font_set_global_oversampling" qualifiers="virtual"> + <method name="_font_set_global_oversampling" qualifiers="virtual"> <return type="void" /> <param index="0" name="oversampling" type="float" /> <description> - Sets oversampling factor, shared by all font in the TextServer. - [b]Note:[/b] This value can be automatically changed by display server. </description> </method> - <method name="font_set_glyph_advance" qualifiers="virtual"> + <method name="_font_set_glyph_advance" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="int" /> <param index="2" name="glyph" type="int" /> <param index="3" name="advance" type="Vector2" /> <description> - Sets glyph advance (offset of the next glyph). </description> </method> - <method name="font_set_glyph_offset" qualifiers="virtual"> + <method name="_font_set_glyph_offset" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <param index="2" name="glyph" type="int" /> <param index="3" name="offset" type="Vector2" /> <description> - Sets glyph offset from the baseline. </description> </method> - <method name="font_set_glyph_size" qualifiers="virtual"> + <method name="_font_set_glyph_size" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <param index="2" name="glyph" type="int" /> <param index="3" name="gl_size" type="Vector2" /> <description> - Sets size of the glyph. </description> </method> - <method name="font_set_glyph_texture_idx" qualifiers="virtual"> + <method name="_font_set_glyph_texture_idx" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <param index="2" name="glyph" type="int" /> <param index="3" name="texture_idx" type="int" /> <description> - Sets index of the cache texture containing the glyph. </description> </method> - <method name="font_set_glyph_uv_rect" qualifiers="virtual"> + <method name="_font_set_glyph_uv_rect" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <param index="2" name="glyph" type="int" /> <param index="3" name="uv_rect" type="Rect2" /> <description> - Sets rectangle in the cache texture containing the glyph. </description> </method> - <method name="font_set_hinting" qualifiers="virtual"> + <method name="_font_set_hinting" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="hinting" type="int" enum="TextServer.Hinting" /> <description> - Sets font hinting mode. Used by dynamic fonts only. </description> </method> - <method name="font_set_kerning" qualifiers="virtual"> + <method name="_font_set_kerning" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="int" /> <param index="2" name="glyph_pair" type="Vector2i" /> <param index="3" name="kerning" type="Vector2" /> <description> - Sets kerning for the pair of glyphs. </description> </method> - <method name="font_set_language_support_override" qualifiers="virtual"> + <method name="_font_set_language_support_override" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="language" type="String" /> <param index="2" name="supported" type="bool" /> <description> - Adds override for [method font_is_language_supported]. </description> </method> - <method name="font_set_msdf_pixel_range" qualifiers="virtual"> + <method name="_font_set_msdf_pixel_range" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="msdf_pixel_range" type="int" /> <description> - Sets the width of the range around the shape between the minimum and maximum representable signed distance. </description> </method> - <method name="font_set_msdf_size" qualifiers="virtual"> + <method name="_font_set_msdf_size" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="msdf_size" type="int" /> <description> - Sets source font size used to generate MSDF textures. </description> </method> - <method name="font_set_multichannel_signed_distance_field" qualifiers="virtual"> + <method name="_font_set_multichannel_signed_distance_field" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="msdf" type="bool" /> <description> - If set to [code]true[/code], glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data. MSDF rendering allows displaying the font at any scaling factor without blurriness, and without incurring a CPU cost when the font size changes (since the font no longer needs to be rasterized on the CPU). As a downside, font hinting is not available with MSDF. The lack of font hinting may result in less crisp and less readable fonts at small sizes. - [b]Note:[/b] MSDF font rendering does not render glyphs with overlapping shapes correctly. Overlapping shapes are not valid per the OpenType standard, but are still commonly found in many font files, especially those converted by Google Fonts. To avoid issues with overlapping glyphs, consider downloading the font file directly from the type foundry instead of relying on Google Fonts. </description> </method> - <method name="font_set_name" qualifiers="virtual"> + <method name="_font_set_name" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="name" type="String" /> <description> - Sets the font family name. </description> </method> - <method name="font_set_opentype_feature_overrides" qualifiers="virtual"> + <method name="_font_set_opentype_feature_overrides" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="overrides" type="Dictionary" /> <description> - Sets font OpenType feature set override. </description> </method> - <method name="font_set_oversampling" qualifiers="virtual"> + <method name="_font_set_oversampling" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="oversampling" type="float" /> <description> - Sets font oversampling factor, if set to [code]0.0[/code] global oversampling factor is used instead. Used by dynamic fonts only. </description> </method> - <method name="font_set_scale" qualifiers="virtual"> + <method name="_font_set_scale" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="int" /> <param index="2" name="scale" type="float" /> <description> - Sets scaling factor of the color bitmap font. </description> </method> - <method name="font_set_script_support_override" qualifiers="virtual"> + <method name="_font_set_script_support_override" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="script" type="String" /> <param index="2" name="supported" type="bool" /> <description> - Adds override for [method font_is_script_supported]. </description> </method> - <method name="font_set_style" qualifiers="virtual"> + <method name="_font_set_style" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="style" type="int" enum="TextServer.FontStyle" /> <description> - Sets the font style flags, see [enum TextServer.FontStyle]. </description> </method> - <method name="font_set_style_name" qualifiers="virtual"> + <method name="_font_set_style_name" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="name_style" type="String" /> <description> - Sets the font style name. </description> </method> - <method name="font_set_subpixel_positioning" qualifiers="virtual"> + <method name="_font_set_subpixel_positioning" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="subpixel_positioning" type="int" enum="TextServer.SubpixelPositioning" /> <description> - Sets font sub-pixel glyph positioning mode. </description> </method> - <method name="font_set_texture_image" qualifiers="virtual"> + <method name="_font_set_texture_image" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <param index="2" name="texture_index" type="int" /> <param index="3" name="image" type="Image" /> <description> - Sets font cache texture image data. </description> </method> - <method name="font_set_texture_offsets" qualifiers="virtual"> + <method name="_font_set_texture_offsets" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="Vector2i" /> <param index="2" name="texture_index" type="int" /> <param index="3" name="offset" type="PackedInt32Array" /> <description> - Sets array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty. </description> </method> - <method name="font_set_transform" qualifiers="virtual"> + <method name="_font_set_transform" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="transform" type="Transform2D" /> <description> - Sets 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs. - For example, to simulate italic typeface by slanting, apply the following transform [code]Transform2D(1.0, slant, 0.0, 1.0, 0.0, 0.0)[/code]. </description> </method> - <method name="font_set_underline_position" qualifiers="virtual"> + <method name="_font_set_underline_position" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="int" /> <param index="2" name="underline_position" type="float" /> <description> - Sets pixel offset of the underline below the baseline. </description> </method> - <method name="font_set_underline_thickness" qualifiers="virtual"> + <method name="_font_set_underline_thickness" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="size" type="int" /> <param index="2" name="underline_thickness" type="float" /> <description> - Sets thickness of the underline in pixels. </description> </method> - <method name="font_set_variation_coordinates" qualifiers="virtual"> + <method name="_font_set_variation_coordinates" qualifiers="virtual"> <return type="void" /> <param index="0" name="font_rid" type="RID" /> <param index="1" name="variation_coordinates" type="Dictionary" /> <description> - Sets variation coordinates for the specified font cache entry. See [method font_supported_variation_list] for more info. </description> </method> - <method name="font_supported_feature_list" qualifiers="virtual const"> + <method name="_font_supported_feature_list" qualifiers="virtual const"> <return type="Dictionary" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns the dictionary of the supported OpenType features. </description> </method> - <method name="font_supported_variation_list" qualifiers="virtual const"> + <method name="_font_supported_variation_list" qualifiers="virtual const"> <return type="Dictionary" /> <param index="0" name="font_rid" type="RID" /> <description> - Returns the dictionary of the supported OpenType variation coordinates. </description> </method> - <method name="format_number" qualifiers="virtual const"> + <method name="_format_number" qualifiers="virtual const"> <return type="String" /> <param index="0" name="string" type="String" /> <param index="1" name="language" type="String" /> <description> - Converts a number from the Western Arabic (0..9) to the numeral systems used in [param language]. </description> </method> - <method name="free_rid" qualifiers="virtual"> + <method name="_free_rid" qualifiers="virtual"> <return type="void" /> <param index="0" name="rid" type="RID" /> <description> - Frees an object created by this [TextServer]. </description> </method> - <method name="get_features" qualifiers="virtual const"> + <method name="_get_features" qualifiers="virtual const"> <return type="int" /> <description> - Returns text server features, see [enum TextServer.Feature]. </description> </method> - <method name="get_hex_code_box_size" qualifiers="virtual const"> + <method name="_get_hex_code_box_size" qualifiers="virtual const"> <return type="Vector2" /> <param index="0" name="size" type="int" /> <param index="1" name="index" type="int" /> <description> - Returns size of the replacement character (box with character hexadecimal code that is drawn in place of invalid characters). - [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="get_name" qualifiers="virtual const"> + <method name="_get_name" qualifiers="virtual const"> <return type="String" /> <description> - Returns the name of the server interface. </description> </method> - <method name="get_support_data_filename" qualifiers="virtual const"> + <method name="_get_support_data_filename" qualifiers="virtual const"> <return type="String" /> <description> - Returns default TextServer database (e.g. ICU break iterators and dictionaries) filename. </description> </method> - <method name="get_support_data_info" qualifiers="virtual const"> + <method name="_get_support_data_info" qualifiers="virtual const"> <return type="String" /> <description> - Returns TextServer database (e.g. ICU break iterators and dictionaries) description. </description> </method> - <method name="has" qualifiers="virtual"> + <method name="_has" qualifiers="virtual"> <return type="bool" /> <param index="0" name="rid" type="RID" /> <description> - Returns [code]true[/code] if [param rid] is valid resource owned by this text server. </description> </method> - <method name="has_feature" qualifiers="virtual const"> + <method name="_has_feature" qualifiers="virtual const"> <return type="bool" /> <param index="0" name="feature" type="int" enum="TextServer.Feature" /> <description> - Returns [code]true[/code] if the server supports a feature. </description> </method> - <method name="is_confusable" qualifiers="virtual const"> + <method name="_is_confusable" qualifiers="virtual const"> <return type="int" /> <param index="0" name="string" type="String" /> <param index="1" name="dict" type="PackedStringArray" /> <description> - Returns index of the first string in [param dict] which is visually confusable with the [param string], or [code]-1[/code] if none is found. </description> </method> - <method name="is_locale_right_to_left" qualifiers="virtual const"> + <method name="_is_locale_right_to_left" qualifiers="virtual const"> <return type="bool" /> <param index="0" name="locale" type="String" /> <description> - Returns [code]true[/code] if locale is right-to-left. </description> </method> - <method name="is_valid_identifier" qualifiers="virtual const"> + <method name="_is_valid_identifier" qualifiers="virtual const"> <return type="bool" /> <param index="0" name="string" type="String" /> <description> - Returns [code]true[/code] is [param string] is a valid identifier. </description> </method> - <method name="load_support_data" qualifiers="virtual"> + <method name="_load_support_data" qualifiers="virtual"> <return type="bool" /> <param index="0" name="filename" type="String" /> <description> - Loads optional TextServer database (e.g. ICU break iterators and dictionaries). </description> </method> - <method name="name_to_tag" qualifiers="virtual const"> + <method name="_name_to_tag" qualifiers="virtual const"> <return type="int" /> <param index="0" name="name" type="String" /> <description> - Converts readable feature, variation, script or language name to OpenType tag. </description> </method> - <method name="parse_number" qualifiers="virtual const"> + <method name="_parse_number" qualifiers="virtual const"> <return type="String" /> <param index="0" name="string" type="String" /> <param index="1" name="language" type="String" /> <description> - Converts a number from the numeral systems used in [param language] to Western Arabic (0..9). </description> </method> - <method name="parse_structured_text" qualifiers="virtual const"> + <method name="_parse_structured_text" qualifiers="virtual const"> <return type="Vector2i[]" /> <param index="0" name="parser_type" type="int" enum="TextServer.StructuredTextParser" /> <param index="1" name="args" type="Array" /> @@ -986,37 +859,32 @@ <description> </description> </method> - <method name="percent_sign" qualifiers="virtual const"> + <method name="_percent_sign" qualifiers="virtual const"> <return type="String" /> <param index="0" name="language" type="String" /> <description> - Returns percent sign used in the [param language]. </description> </method> - <method name="save_support_data" qualifiers="virtual const"> + <method name="_save_support_data" qualifiers="virtual const"> <return type="bool" /> <param index="0" name="filename" type="String" /> <description> - Saves optional TextServer database (e.g. ICU break iterators and dictionaries) to the file. - [b]Note:[/b] This function is used by during project export, to include TextServer database. </description> </method> - <method name="shaped_get_span_count" qualifiers="virtual const"> + <method name="_shaped_get_span_count" qualifiers="virtual const"> <return type="int" /> <param index="0" name="shaped" type="RID" /> <description> - Returns number of text spans added using [method shaped_text_add_string] or [method shaped_text_add_object]. </description> </method> - <method name="shaped_get_span_meta" qualifiers="virtual const"> + <method name="_shaped_get_span_meta" qualifiers="virtual const"> <return type="Variant" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="index" type="int" /> <description> - Returns text span metadata. </description> </method> - <method name="shaped_set_span_update_font" qualifiers="virtual"> + <method name="_shaped_set_span_update_font" qualifiers="virtual"> <return type="void" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="index" type="int" /> @@ -1024,10 +892,9 @@ <param index="3" name="size" type="int" /> <param index="4" name="opentype_features" type="Dictionary" /> <description> - Changes text span font, font size and OpenType features, without changing the text. </description> </method> - <method name="shaped_text_add_object" qualifiers="virtual"> + <method name="_shaped_text_add_object" qualifiers="virtual"> <return type="bool" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="key" type="Variant" /> @@ -1035,10 +902,9 @@ <param index="3" name="inline_align" type="int" enum="InlineAlignment" /> <param index="4" name="length" type="int" /> <description> - Adds inline object to the text buffer, [param key] must be unique. In the text, object is represented as [param length] object replacement characters. </description> </method> - <method name="shaped_text_add_string" qualifiers="virtual"> + <method name="_shaped_text_add_string" qualifiers="virtual"> <return type="bool" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="text" type="String" /> @@ -1048,17 +914,15 @@ <param index="5" name="language" type="String" /> <param index="6" name="meta" type="Variant" /> <description> - Adds text span and font to draw it to the text buffer. </description> </method> - <method name="shaped_text_clear" qualifiers="virtual"> + <method name="_shaped_text_clear" qualifiers="virtual"> <return type="void" /> <param index="0" name="shaped" type="RID" /> <description> - Clears text buffer (removes text and inline objects). </description> </method> - <method name="shaped_text_draw" qualifiers="virtual const"> + <method name="_shaped_text_draw" qualifiers="virtual const"> <return type="void" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="canvas" type="RID" /> @@ -1067,11 +931,9 @@ <param index="4" name="clip_r" type="float" /> <param index="5" name="color" type="Color" /> <description> - Draw shaped text into a canvas item at a given position, with [param color]. [param pos] specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout). - [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="shaped_text_draw_outline" qualifiers="virtual const"> + <method name="_shaped_text_draw_outline" qualifiers="virtual const"> <return type="void" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="canvas" type="RID" /> @@ -1081,130 +943,109 @@ <param index="5" name="outline_size" type="int" /> <param index="6" name="color" type="Color" /> <description> - Draw the outline of the shaped text into a canvas item at a given position, with [param color]. [param pos] specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout). - [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="shaped_text_fit_to_width" qualifiers="virtual"> + <method name="_shaped_text_fit_to_width" qualifiers="virtual"> <return type="float" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="width" type="float" /> <param index="2" name="jst_flags" type="int" enum="TextServer.JustificationFlag" /> <description> - Adjusts text with to fit to specified width, returns new text width. </description> </method> - <method name="shaped_text_get_ascent" qualifiers="virtual const"> + <method name="_shaped_text_get_ascent" qualifiers="virtual const"> <return type="float" /> <param index="0" name="shaped" type="RID" /> <description> - Returns the text ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical). </description> </method> - <method name="shaped_text_get_carets" qualifiers="virtual const"> + <method name="_shaped_text_get_carets" qualifiers="virtual const"> <return type="void" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="position" type="int" /> <param index="2" name="caret" type="CaretInfo*" /> <description> - Returns shapes of the carets corresponding to the character offset [param position] in the text. Returned caret shape is 1 pixel wide rectangle. - [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="shaped_text_get_custom_punctuation" qualifiers="virtual const"> + <method name="_shaped_text_get_custom_punctuation" qualifiers="virtual const"> <return type="String" /> <param index="0" name="shaped" type="RID" /> <description> - Returns custom punctuation character list, used for word breaking. If set to empty string, server defaults are used. </description> </method> - <method name="shaped_text_get_descent" qualifiers="virtual const"> + <method name="_shaped_text_get_descent" qualifiers="virtual const"> <return type="float" /> <param index="0" name="shaped" type="RID" /> <description> - Returns the text descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical). </description> </method> - <method name="shaped_text_get_direction" qualifiers="virtual const"> + <method name="_shaped_text_get_direction" qualifiers="virtual const"> <return type="int" enum="TextServer.Direction" /> <param index="0" name="shaped" type="RID" /> <description> - Returns direction of the text. </description> </method> - <method name="shaped_text_get_dominant_direction_in_range" qualifiers="virtual const"> + <method name="_shaped_text_get_dominant_direction_in_range" qualifiers="virtual const"> <return type="int" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="start" type="int" /> <param index="2" name="end" type="int" /> <description> - Returns dominant direction of in the range of text. - [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="shaped_text_get_ellipsis_glyph_count" qualifiers="virtual const"> + <method name="_shaped_text_get_ellipsis_glyph_count" qualifiers="virtual const"> <return type="int" /> <param index="0" name="shaped" type="RID" /> <description> - Returns number of glyphs in the ellipsis. </description> </method> - <method name="shaped_text_get_ellipsis_glyphs" qualifiers="virtual const"> + <method name="_shaped_text_get_ellipsis_glyphs" qualifiers="virtual const"> <return type="const Glyph*" /> <param index="0" name="shaped" type="RID" /> <description> - Returns array of the glyphs in the ellipsis. </description> </method> - <method name="shaped_text_get_ellipsis_pos" qualifiers="virtual const"> + <method name="_shaped_text_get_ellipsis_pos" qualifiers="virtual const"> <return type="int" /> <param index="0" name="shaped" type="RID" /> <description> - Returns position of the ellipsis. </description> </method> - <method name="shaped_text_get_glyph_count" qualifiers="virtual const"> + <method name="_shaped_text_get_glyph_count" qualifiers="virtual const"> <return type="int" /> <param index="0" name="shaped" type="RID" /> <description> - Returns number of glyphs in the buffer. </description> </method> - <method name="shaped_text_get_glyphs" qualifiers="virtual const"> + <method name="_shaped_text_get_glyphs" qualifiers="virtual const"> <return type="const Glyph*" /> <param index="0" name="shaped" type="RID" /> <description> - Returns an array of glyphs in the visual order. </description> </method> - <method name="shaped_text_get_grapheme_bounds" qualifiers="virtual const"> + <method name="_shaped_text_get_grapheme_bounds" qualifiers="virtual const"> <return type="Vector2" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="pos" type="int" /> <description> - Returns composite character's bounds as offsets from the start of the line. - [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="shaped_text_get_inferred_direction" qualifiers="virtual const"> + <method name="_shaped_text_get_inferred_direction" qualifiers="virtual const"> <return type="int" enum="TextServer.Direction" /> <param index="0" name="shaped" type="RID" /> <description> - Returns direction of the text, inferred by the BiDi algorithm. </description> </method> - <method name="shaped_text_get_line_breaks" qualifiers="virtual const"> + <method name="_shaped_text_get_line_breaks" qualifiers="virtual const"> <return type="PackedInt32Array" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="width" type="float" /> <param index="2" name="start" type="int" /> <param index="3" name="break_flags" type="int" enum="TextServer.LineBreakFlag" /> <description> - Breaks text to the lines and returns character ranges for each line. - [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="shaped_text_get_line_breaks_adv" qualifiers="virtual const"> + <method name="_shaped_text_get_line_breaks_adv" qualifiers="virtual const"> <return type="PackedInt32Array" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="width" type="PackedFloat32Array" /> @@ -1212,334 +1053,280 @@ <param index="3" name="once" type="bool" /> <param index="4" name="break_flags" type="int" enum="TextServer.LineBreakFlag" /> <description> - Breaks text to the lines and columns. Returns character ranges for each segment. - [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="shaped_text_get_object_rect" qualifiers="virtual const"> + <method name="_shaped_text_get_object_rect" qualifiers="virtual const"> <return type="Rect2" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="key" type="Variant" /> <description> - Returns bounding rectangle of the inline object. </description> </method> - <method name="shaped_text_get_objects" qualifiers="virtual const"> + <method name="_shaped_text_get_objects" qualifiers="virtual const"> <return type="Array" /> <param index="0" name="shaped" type="RID" /> <description> - Returns array of inline objects. </description> </method> - <method name="shaped_text_get_orientation" qualifiers="virtual const"> + <method name="_shaped_text_get_orientation" qualifiers="virtual const"> <return type="int" enum="TextServer.Orientation" /> <param index="0" name="shaped" type="RID" /> <description> - eturns text orientation. </description> </method> - <method name="shaped_text_get_parent" qualifiers="virtual const"> + <method name="_shaped_text_get_parent" qualifiers="virtual const"> <return type="RID" /> <param index="0" name="shaped" type="RID" /> <description> - Returns the parent buffer from which the substring originates. </description> </method> - <method name="shaped_text_get_preserve_control" qualifiers="virtual const"> + <method name="_shaped_text_get_preserve_control" qualifiers="virtual const"> <return type="bool" /> <param index="0" name="shaped" type="RID" /> <description> - Returns [code]true[/code] if text buffer is configured to display control characters. </description> </method> - <method name="shaped_text_get_preserve_invalid" qualifiers="virtual const"> + <method name="_shaped_text_get_preserve_invalid" qualifiers="virtual const"> <return type="bool" /> <param index="0" name="shaped" type="RID" /> <description> - Returns [code]true[/code] if text buffer is configured to display hexadecimal codes in place of invalid characters. - [b]Note:[/b] If set to [code]false[/code], nothing is displayed in place of invalid characters. </description> </method> - <method name="shaped_text_get_range" qualifiers="virtual const"> + <method name="_shaped_text_get_range" qualifiers="virtual const"> <return type="Vector2i" /> <param index="0" name="shaped" type="RID" /> <description> - Returns substring buffer character range in the parent buffer. </description> </method> - <method name="shaped_text_get_selection" qualifiers="virtual const"> + <method name="_shaped_text_get_selection" qualifiers="virtual const"> <return type="PackedVector2Array" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="start" type="int" /> <param index="2" name="end" type="int" /> <description> - Returns selection rectangles for the specified character range. - [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="shaped_text_get_size" qualifiers="virtual const"> + <method name="_shaped_text_get_size" qualifiers="virtual const"> <return type="Vector2" /> <param index="0" name="shaped" type="RID" /> <description> - Returns size of the text. </description> </method> - <method name="shaped_text_get_spacing" qualifiers="virtual const"> + <method name="_shaped_text_get_spacing" qualifiers="virtual const"> <return type="int" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="spacing" type="int" enum="TextServer.SpacingType" /> <description> - Returns extra spacing added between glyphs or lines in pixels. </description> </method> - <method name="shaped_text_get_trim_pos" qualifiers="virtual const"> + <method name="_shaped_text_get_trim_pos" qualifiers="virtual const"> <return type="int" /> <param index="0" name="shaped" type="RID" /> <description> - Returns the position of the overrun trim. </description> </method> - <method name="shaped_text_get_underline_position" qualifiers="virtual const"> + <method name="_shaped_text_get_underline_position" qualifiers="virtual const"> <return type="float" /> <param index="0" name="shaped" type="RID" /> <description> - Returns pixel offset of the underline below the baseline. </description> </method> - <method name="shaped_text_get_underline_thickness" qualifiers="virtual const"> + <method name="_shaped_text_get_underline_thickness" qualifiers="virtual const"> <return type="float" /> <param index="0" name="shaped" type="RID" /> <description> - Returns thickness of the underline. </description> </method> - <method name="shaped_text_get_width" qualifiers="virtual const"> + <method name="_shaped_text_get_width" qualifiers="virtual const"> <return type="float" /> <param index="0" name="shaped" type="RID" /> <description> - Returns width (for horizontal layout) or height (for vertical) of the text. </description> </method> - <method name="shaped_text_get_word_breaks" qualifiers="virtual const"> + <method name="_shaped_text_get_word_breaks" qualifiers="virtual const"> <return type="PackedInt32Array" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="grapheme_flags" type="int" enum="TextServer.GraphemeFlag" /> <description> - Breaks text into words and returns array of character ranges. - [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="shaped_text_hit_test_grapheme" qualifiers="virtual const"> + <method name="_shaped_text_hit_test_grapheme" qualifiers="virtual const"> <return type="int" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="coord" type="float" /> <description> - Returns grapheme index at the specified pixel offset at the baseline, or [code]-1[/code] if none is found. - [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="shaped_text_hit_test_position" qualifiers="virtual const"> + <method name="_shaped_text_hit_test_position" qualifiers="virtual const"> <return type="int" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="coord" type="float" /> <description> - Returns caret character offset at the specified pixel offset at the baseline. This function always returns a valid position. - [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="shaped_text_is_ready" qualifiers="virtual const"> + <method name="_shaped_text_is_ready" qualifiers="virtual const"> <return type="bool" /> <param index="0" name="shaped" type="RID" /> <description> - Returns [code]true[/code] if buffer is successfully shaped. </description> </method> - <method name="shaped_text_next_grapheme_pos" qualifiers="virtual const"> + <method name="_shaped_text_next_grapheme_pos" qualifiers="virtual const"> <return type="int" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="pos" type="int" /> <description> - Returns composite character end position closest to the [param pos]. - [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="shaped_text_overrun_trim_to_width" qualifiers="virtual"> + <method name="_shaped_text_overrun_trim_to_width" qualifiers="virtual"> <return type="void" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="width" type="float" /> <param index="2" name="trim_flags" type="int" enum="TextServer.TextOverrunFlag" /> <description> - Trims text if it exceeds the given width. </description> </method> - <method name="shaped_text_prev_grapheme_pos" qualifiers="virtual const"> + <method name="_shaped_text_prev_grapheme_pos" qualifiers="virtual const"> <return type="int" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="pos" type="int" /> <description> - Returns composite character start position closest to the [param pos]. - [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="shaped_text_resize_object" qualifiers="virtual"> + <method name="_shaped_text_resize_object" qualifiers="virtual"> <return type="bool" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="key" type="Variant" /> <param index="2" name="size" type="Vector2" /> <param index="3" name="inline_align" type="int" enum="InlineAlignment" /> <description> - Sets new size and alignment of embedded object. </description> </method> - <method name="shaped_text_set_bidi_override" qualifiers="virtual"> + <method name="_shaped_text_set_bidi_override" qualifiers="virtual"> <return type="void" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="override" type="Array" /> <description> - Overrides BiDi for the structured text. - Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately. </description> </method> - <method name="shaped_text_set_custom_punctuation" qualifiers="virtual"> + <method name="_shaped_text_set_custom_punctuation" qualifiers="virtual"> <return type="void" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="punct" type="String" /> <description> - Sets custom punctuation character list, used for word breaking. If set to empty string, server defaults are used. </description> </method> - <method name="shaped_text_set_direction" qualifiers="virtual"> + <method name="_shaped_text_set_direction" qualifiers="virtual"> <return type="void" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="direction" type="int" enum="TextServer.Direction" /> <description> - Sets desired text [param direction]. If set to [code]TEXT_DIRECTION_AUTO[/code], direction will be detected based on the buffer contents and current locale. </description> </method> - <method name="shaped_text_set_orientation" qualifiers="virtual"> + <method name="_shaped_text_set_orientation" qualifiers="virtual"> <return type="void" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="orientation" type="int" enum="TextServer.Orientation" /> <description> - Sets desired text orientation. </description> </method> - <method name="shaped_text_set_preserve_control" qualifiers="virtual"> + <method name="_shaped_text_set_preserve_control" qualifiers="virtual"> <return type="void" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="enabled" type="bool" /> <description> - If set to [code]true[/code] text buffer will display control characters. </description> </method> - <method name="shaped_text_set_preserve_invalid" qualifiers="virtual"> + <method name="_shaped_text_set_preserve_invalid" qualifiers="virtual"> <return type="void" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="enabled" type="bool" /> <description> - If set to [code]true[/code] text buffer will display invalid characters as hexadecimal codes, otherwise nothing is displayed. </description> </method> - <method name="shaped_text_set_spacing" qualifiers="virtual"> + <method name="_shaped_text_set_spacing" qualifiers="virtual"> <return type="void" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="spacing" type="int" enum="TextServer.SpacingType" /> <param index="2" name="value" type="int" /> <description> - Sets extra spacing added between glyphs or lines in pixels. </description> </method> - <method name="shaped_text_shape" qualifiers="virtual"> + <method name="_shaped_text_shape" qualifiers="virtual"> <return type="bool" /> <param index="0" name="shaped" type="RID" /> <description> - Shapes buffer if it's not shaped. Returns [code]true[/code] if the string is shaped successfully. </description> </method> - <method name="shaped_text_sort_logical" qualifiers="virtual"> + <method name="_shaped_text_sort_logical" qualifiers="virtual"> <return type="const Glyph*" /> <param index="0" name="shaped" type="RID" /> <description> - Returns text glyphs in the logical order. </description> </method> - <method name="shaped_text_substr" qualifiers="virtual const"> + <method name="_shaped_text_substr" qualifiers="virtual const"> <return type="RID" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="start" type="int" /> <param index="2" name="length" type="int" /> <description> - Returns text buffer for the substring of the text in the [param shaped] text buffer (including inline objects). </description> </method> - <method name="shaped_text_tab_align" qualifiers="virtual"> + <method name="_shaped_text_tab_align" qualifiers="virtual"> <return type="float" /> <param index="0" name="shaped" type="RID" /> <param index="1" name="tab_stops" type="PackedFloat32Array" /> <description> - Aligns shaped text to the given tab-stops. </description> </method> - <method name="shaped_text_update_breaks" qualifiers="virtual"> + <method name="_shaped_text_update_breaks" qualifiers="virtual"> <return type="bool" /> <param index="0" name="shaped" type="RID" /> <description> - Updates line breaking positions in the text buffer. - [b]Note:[/b] This method is used by default line/word breaking methods, and its implementation might be omitted if custom line breaking in implemented. </description> </method> - <method name="shaped_text_update_justification_ops" qualifiers="virtual"> + <method name="_shaped_text_update_justification_ops" qualifiers="virtual"> <return type="bool" /> <param index="0" name="shaped" type="RID" /> <description> - Updates line justification positions (word breaks and elongations) in the text buffer. - [b]Note:[/b] This method is used by default line/word breaking methods, and its implementation might be omitted if custom line breaking in implemented. </description> </method> - <method name="spoof_check" qualifiers="virtual const"> + <method name="_spoof_check" qualifiers="virtual const"> <return type="bool" /> <param index="0" name="string" type="String" /> <description> - Returns [code]true[/code] if [param string] is likely to be an attempt at confusing the reader. </description> </method> - <method name="string_get_word_breaks" qualifiers="virtual const"> + <method name="_string_get_word_breaks" qualifiers="virtual const"> <return type="PackedInt32Array" /> <param index="0" name="string" type="String" /> <param index="1" name="language" type="String" /> <description> - Returns array of the word break character offsets. </description> </method> - <method name="string_to_lower" qualifiers="virtual const"> + <method name="_string_to_lower" qualifiers="virtual const"> <return type="String" /> <param index="0" name="string" type="String" /> <param index="1" name="language" type="String" /> <description> - Returns the string converted to lowercase. </description> </method> - <method name="string_to_upper" qualifiers="virtual const"> + <method name="_string_to_upper" qualifiers="virtual const"> <return type="String" /> <param index="0" name="string" type="String" /> <param index="1" name="language" type="String" /> <description> - Returns the string converted to uppercase. </description> </method> - <method name="strip_diacritics" qualifiers="virtual const"> + <method name="_strip_diacritics" qualifiers="virtual const"> <return type="String" /> <param index="0" name="string" type="String" /> <description> - Strips diacritics from the string. - [b]Note:[/b] If this method is not implemented in the plugin, the default implementation will be used. </description> </method> - <method name="tag_to_name" qualifiers="virtual const"> + <method name="_tag_to_name" qualifiers="virtual const"> <return type="String" /> <param index="0" name="tag" type="int" /> <description> - Converts OpenType tag to readable feature, variation, script or language name. </description> </method> </methods> diff --git a/doc/classes/XRInterface.xml b/doc/classes/XRInterface.xml index 6296b95e6c..3e48b8284a 100644 --- a/doc/classes/XRInterface.xml +++ b/doc/classes/XRInterface.xml @@ -69,6 +69,18 @@ Is [code]true[/code] if this interface has been initialised. </description> </method> + <method name="is_passthrough_enabled"> + <return type="bool" /> + <description> + Is [code]true[/code] if passthrough is enabled. + </description> + </method> + <method name="is_passthrough_supported"> + <return type="bool" /> + <description> + Is [code]true[/code] if this interface supports passthrough. + </description> + </method> <method name="set_play_area_mode"> <return type="bool" /> <param index="0" name="mode" type="int" enum="XRInterface.PlayAreaMode" /> @@ -76,6 +88,19 @@ Sets the active play area mode, will return [code]false[/code] if the mode can't be used with this interface. </description> </method> + <method name="start_passthrough"> + <return type="bool" /> + <description> + Starts passthrough, will return [code]false[/code] if passthrough couldn't be started. + [b]Note:[/b] The viewport used for XR must have a transparent background, otherwise passthrough may not properly render. + </description> + </method> + <method name="stop_passthrough"> + <return type="void" /> + <description> + Stops passthrough. + </description> + </method> <method name="supports_play_area_mode"> <return type="bool" /> <param index="0" name="mode" type="int" enum="XRInterface.PlayAreaMode" /> diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp index 11fd29c8f5..7dd294c7a1 100644 --- a/drivers/windows/dir_access_windows.cpp +++ b/drivers/windows/dir_access_windows.cpp @@ -160,7 +160,7 @@ Error DirAccessWindows::make_dir(String p_dir) { p_dir = current_dir.path_join(p_dir); } - p_dir = p_dir.replace("/", "\\"); + p_dir = p_dir.simplify_path().replace("/", "\\"); bool success; int err; diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp index 100db9bc82..394c32f20d 100644 --- a/modules/navigation/nav_map.cpp +++ b/modules/navigation/nav_map.cpp @@ -140,20 +140,17 @@ Vector<Vector3> NavMap::get_path(Vector3 p_origin, Vector3 p_destination, bool p // This is an implementation of the A* algorithm. int least_cost_id = 0; + int prev_least_cost_id = -1; bool found_route = false; const gd::Polygon *reachable_end = nullptr; float reachable_d = 1e30; bool is_reachable = true; - gd::NavigationPoly *prev_least_cost_poly = nullptr; - while (true) { // Takes the current least_cost_poly neighbors (iterating over its edges) and compute the traveled_distance. for (size_t i = 0; i < navigation_polys[least_cost_id].poly->edges.size(); i++) { - gd::NavigationPoly *least_cost_poly = &navigation_polys[least_cost_id]; - - const gd::Edge &edge = least_cost_poly->poly->edges[i]; + const gd::Edge &edge = navigation_polys[least_cost_id].poly->edges[i]; // Iterate over connections in this edge, then compute the new optimized travel distance assigned to this polygon. for (int connection_index = 0; connection_index < edge.connections.size(); connection_index++) { @@ -164,17 +161,18 @@ Vector<Vector3> NavMap::get_path(Vector3 p_origin, Vector3 p_destination, bool p continue; } + const gd::NavigationPoly &least_cost_poly = navigation_polys[least_cost_id]; float poly_enter_cost = 0.0; - float poly_travel_cost = least_cost_poly->poly->owner->get_travel_cost(); + float poly_travel_cost = least_cost_poly.poly->owner->get_travel_cost(); - if (prev_least_cost_poly != nullptr && (prev_least_cost_poly->poly->owner->get_self() != least_cost_poly->poly->owner->get_self())) { - poly_enter_cost = least_cost_poly->poly->owner->get_enter_cost(); + if (prev_least_cost_id != -1 && (navigation_polys[prev_least_cost_id].poly->owner->get_self() != least_cost_poly.poly->owner->get_self())) { + poly_enter_cost = least_cost_poly.poly->owner->get_enter_cost(); } - prev_least_cost_poly = least_cost_poly; + prev_least_cost_id = least_cost_id; Vector3 pathway[2] = { connection.pathway_start, connection.pathway_end }; - const Vector3 new_entry = Geometry3D::get_closest_point_to_segment(least_cost_poly->entry, pathway); - const float new_distance = (least_cost_poly->entry.distance_to(new_entry) * poly_travel_cost) + poly_enter_cost + least_cost_poly->traveled_distance; + const Vector3 new_entry = Geometry3D::get_closest_point_to_segment(least_cost_poly.entry, pathway); + const float new_distance = (least_cost_poly.entry.distance_to(new_entry) * poly_travel_cost) + poly_enter_cost + least_cost_poly.traveled_distance; int64_t already_visited_polygon_index = navigation_polys.find(gd::NavigationPoly(connection.polygon)); diff --git a/modules/openxr/SCsub b/modules/openxr/SCsub index 6b6a4f2ed5..c8e9b9a11e 100644 --- a/modules/openxr/SCsub +++ b/modules/openxr/SCsub @@ -94,6 +94,7 @@ if env["vulkan"]: env_openxr.add_source_files(module_obj, "extensions/openxr_palm_pose_extension.cpp") env_openxr.add_source_files(module_obj, "extensions/openxr_htc_vive_tracker_extension.cpp") env_openxr.add_source_files(module_obj, "extensions/openxr_hand_tracking_extension.cpp") +env_openxr.add_source_files(module_obj, "extensions/openxr_fb_passthrough_extension_wrapper.cpp") env.modules_sources += module_obj diff --git a/modules/openxr/extensions/openxr_composition_layer_provider.h b/modules/openxr/extensions/openxr_composition_layer_provider.h index 019dffa2a8..ba51389f7d 100644 --- a/modules/openxr/extensions/openxr_composition_layer_provider.h +++ b/modules/openxr/extensions/openxr_composition_layer_provider.h @@ -36,10 +36,9 @@ // Interface for OpenXR extensions that provide a composition layer. class OpenXRCompositionLayerProvider { public: - // TODO changed to normal method definition for now - // CI complains until we implement this, haven't ported it yet from plugin - // virtual XrCompositionLayerBaseHeader *get_composition_layer() = 0; - XrCompositionLayerBaseHeader *get_composition_layer() { return nullptr; }; + virtual XrCompositionLayerBaseHeader *get_composition_layer() = 0; + + virtual ~OpenXRCompositionLayerProvider() {} }; #endif // OPENXR_COMPOSITION_LAYER_PROVIDER_H diff --git a/modules/openxr/extensions/openxr_fb_passthrough_extension_wrapper.cpp b/modules/openxr/extensions/openxr_fb_passthrough_extension_wrapper.cpp new file mode 100644 index 0000000000..259b1236a3 --- /dev/null +++ b/modules/openxr/extensions/openxr_fb_passthrough_extension_wrapper.cpp @@ -0,0 +1,234 @@ +/*************************************************************************/ +/* openxr_fb_passthrough_extension_wrapper.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "openxr_fb_passthrough_extension_wrapper.h" + +#include "core/os/os.h" +#include "scene/main/viewport.h" +#include "scene/main/window.h" + +using namespace godot; + +OpenXRFbPassthroughExtensionWrapper *OpenXRFbPassthroughExtensionWrapper::singleton = nullptr; + +OpenXRFbPassthroughExtensionWrapper *OpenXRFbPassthroughExtensionWrapper::get_singleton() { + return singleton; +} + +OpenXRFbPassthroughExtensionWrapper::OpenXRFbPassthroughExtensionWrapper(OpenXRAPI *p_openxr_api) : + OpenXRExtensionWrapper(p_openxr_api) { + request_extensions[XR_FB_PASSTHROUGH_EXTENSION_NAME] = &fb_passthrough_ext; + request_extensions[XR_FB_TRIANGLE_MESH_EXTENSION_NAME] = &fb_triangle_mesh_ext; + singleton = this; +} + +OpenXRFbPassthroughExtensionWrapper::~OpenXRFbPassthroughExtensionWrapper() { + cleanup(); +} + +void OpenXRFbPassthroughExtensionWrapper::cleanup() { + fb_passthrough_ext = false; + fb_triangle_mesh_ext = false; +} + +Viewport *OpenXRFbPassthroughExtensionWrapper::get_main_viewport() { + MainLoop *main_loop = OS::get_singleton()->get_main_loop(); + if (!main_loop) { + print_error("Unable to retrieve main loop"); + return nullptr; + } + + auto *scene_tree = Object::cast_to<SceneTree>(main_loop); + if (!scene_tree) { + print_error("Unable to retrieve scene tree"); + return nullptr; + } + + Viewport *viewport = scene_tree->get_root()->get_viewport(); + return viewport; +} + +void OpenXRFbPassthroughExtensionWrapper::on_instance_created(const XrInstance instance) { + if (fb_passthrough_ext) { + bool result = initialize_fb_passthrough_extension(instance); + if (!result) { + print_error("Failed to initialize fb_passthrough extension"); + fb_passthrough_ext = false; + } + } + + if (fb_triangle_mesh_ext) { + bool result = initialize_fb_triangle_mesh_extension(instance); + if (!result) { + print_error("Failed to initialize fb_triangle_mesh extension"); + fb_triangle_mesh_ext = false; + } + } + + if (fb_passthrough_ext) { + openxr_api->register_composition_layer_provider(this); + } +} + +bool OpenXRFbPassthroughExtensionWrapper::is_passthrough_enabled() { + return fb_passthrough_ext && passthrough_handle != XR_NULL_HANDLE && passthrough_layer != XR_NULL_HANDLE; +} + +bool OpenXRFbPassthroughExtensionWrapper::is_composition_passthrough_layer_ready() { + return fb_passthrough_ext && passthrough_handle != XR_NULL_HANDLE && composition_passthrough_layer.layerHandle != XR_NULL_HANDLE; +} + +bool OpenXRFbPassthroughExtensionWrapper::start_passthrough() { + if (passthrough_handle == XR_NULL_HANDLE) { + return false; + } + + if (is_passthrough_enabled()) { + return true; + } + + // Start the passthrough feature + XrResult result = xrPassthroughStartFB(passthrough_handle); + if (!is_valid_passthrough_result(result, "Failed to start passthrough")) { + stop_passthrough(); + return false; + } + + // Create the passthrough layer + result = xrCreatePassthroughLayerFB(openxr_api->get_session(), &passthrough_layer_config, &passthrough_layer); + if (!is_valid_passthrough_result(result, "Failed to create the passthrough layer")) { + stop_passthrough(); + return false; + } + + // Check if the the viewport has transparent background + Viewport *viewport = get_main_viewport(); + if (viewport && !viewport->has_transparent_background()) { + print_error("Main viewport doesn't have transparent background! Passthrough may not properly render."); + } + + composition_passthrough_layer.layerHandle = passthrough_layer; + + return true; +} + +void OpenXRFbPassthroughExtensionWrapper::on_session_created(const XrSession session) { + if (fb_passthrough_ext) { + // Create the passthrough feature and start it. + XrResult result = xrCreatePassthroughFB(openxr_api->get_session(), &passthrough_create_info, &passthrough_handle); + if (!openxr_api->xr_result(result, "Failed to create passthrough")) { + passthrough_handle = XR_NULL_HANDLE; + return; + } + } +} + +XrCompositionLayerBaseHeader *OpenXRFbPassthroughExtensionWrapper::get_composition_layer() { + if (is_composition_passthrough_layer_ready()) { + return (XrCompositionLayerBaseHeader *)&composition_passthrough_layer; + } else { + return nullptr; + } +} + +void OpenXRFbPassthroughExtensionWrapper::stop_passthrough() { + if (!fb_passthrough_ext) { + return; + } + + composition_passthrough_layer.layerHandle = XR_NULL_HANDLE; + + XrResult result; + if (passthrough_layer != XR_NULL_HANDLE) { + // Destroy the layer + result = xrDestroyPassthroughLayerFB(passthrough_layer); + openxr_api->xr_result(result, "Unable to destroy passthrough layer"); + passthrough_layer = XR_NULL_HANDLE; + } + + if (passthrough_handle != XR_NULL_HANDLE) { + result = xrPassthroughPauseFB(passthrough_handle); + openxr_api->xr_result(result, "Unable to stop passthrough feature"); + } +} + +void OpenXRFbPassthroughExtensionWrapper::on_session_destroyed() { + if (fb_passthrough_ext) { + stop_passthrough(); + + XrResult result; + if (passthrough_handle != XR_NULL_HANDLE) { + result = xrDestroyPassthroughFB(passthrough_handle); + openxr_api->xr_result(result, "Unable to destroy passthrough feature"); + passthrough_handle = XR_NULL_HANDLE; + } + } +} + +void OpenXRFbPassthroughExtensionWrapper::on_instance_destroyed() { + if (fb_passthrough_ext) { + openxr_api->unregister_composition_layer_provider(this); + } + cleanup(); +} + +bool OpenXRFbPassthroughExtensionWrapper::initialize_fb_passthrough_extension(const XrInstance p_instance) { + ERR_FAIL_NULL_V(openxr_api, false); + + EXT_INIT_XR_FUNC_V(xrCreatePassthroughFB); + EXT_INIT_XR_FUNC_V(xrDestroyPassthroughFB); + EXT_INIT_XR_FUNC_V(xrPassthroughStartFB); + EXT_INIT_XR_FUNC_V(xrPassthroughPauseFB); + EXT_INIT_XR_FUNC_V(xrCreatePassthroughLayerFB); + EXT_INIT_XR_FUNC_V(xrDestroyPassthroughLayerFB); + EXT_INIT_XR_FUNC_V(xrPassthroughLayerPauseFB); + EXT_INIT_XR_FUNC_V(xrPassthroughLayerResumeFB); + EXT_INIT_XR_FUNC_V(xrPassthroughLayerSetStyleFB); + EXT_INIT_XR_FUNC_V(xrCreateGeometryInstanceFB); + EXT_INIT_XR_FUNC_V(xrDestroyGeometryInstanceFB); + EXT_INIT_XR_FUNC_V(xrGeometryInstanceSetTransformFB); + + return true; +} + +bool OpenXRFbPassthroughExtensionWrapper::initialize_fb_triangle_mesh_extension(const XrInstance p_instance) { + ERR_FAIL_NULL_V(openxr_api, false); + + EXT_INIT_XR_FUNC_V(xrCreateTriangleMeshFB); + EXT_INIT_XR_FUNC_V(xrDestroyTriangleMeshFB); + EXT_INIT_XR_FUNC_V(xrTriangleMeshGetVertexBufferFB); + EXT_INIT_XR_FUNC_V(xrTriangleMeshGetIndexBufferFB); + EXT_INIT_XR_FUNC_V(xrTriangleMeshBeginUpdateFB); + EXT_INIT_XR_FUNC_V(xrTriangleMeshEndUpdateFB); + EXT_INIT_XR_FUNC_V(xrTriangleMeshBeginVertexBufferUpdateFB); + EXT_INIT_XR_FUNC_V(xrTriangleMeshEndVertexBufferUpdateFB); + + return true; +} diff --git a/modules/openxr/extensions/openxr_fb_passthrough_extension_wrapper.h b/modules/openxr/extensions/openxr_fb_passthrough_extension_wrapper.h new file mode 100644 index 0000000000..1959f3fdc4 --- /dev/null +++ b/modules/openxr/extensions/openxr_fb_passthrough_extension_wrapper.h @@ -0,0 +1,254 @@ +/*************************************************************************/ +/* openxr_fb_passthrough_extension_wrapper.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef OPENXR_FB_PASSTHROUGH_EXTENSION_WRAPPER_H +#define OPENXR_FB_PASSTHROUGH_EXTENSION_WRAPPER_H + +#include "../openxr_api.h" +#include "../util.h" + +#include "openxr_composition_layer_provider.h" +#include "openxr_extension_wrapper.h" + +#include <map> + +class Viewport; + +// Wrapper for the set of Facebook XR passthrough extensions. +class OpenXRFbPassthroughExtensionWrapper : public OpenXRExtensionWrapper, public OpenXRCompositionLayerProvider { + friend class OpenXRAPI; + +public: + void on_instance_created(const XrInstance instance) override; + + void on_session_created(const XrSession session) override; + + void on_session_destroyed() override; + + void on_instance_destroyed() override; + + XrCompositionLayerBaseHeader *get_composition_layer() override; + + bool is_passthrough_supported() { + return fb_passthrough_ext; + } + + bool is_passthrough_enabled(); + + bool start_passthrough(); + + void stop_passthrough(); + + static OpenXRFbPassthroughExtensionWrapper *get_singleton(); + +protected: + OpenXRFbPassthroughExtensionWrapper(OpenXRAPI *p_openxr_api); + ~OpenXRFbPassthroughExtensionWrapper(); + +private: + // Create a passthrough feature + EXT_PROTO_XRRESULT_FUNC3(xrCreatePassthroughFB, + (XrSession), session, + (const XrPassthroughCreateInfoFB *), create_info, + (XrPassthroughFB *), feature_out) + + // Destroy a previously created passthrough feature + EXT_PROTO_XRRESULT_FUNC1(xrDestroyPassthroughFB, (XrPassthroughFB), feature) + + //*** Passthrough feature state management functions ********* + // Start the passthrough feature + EXT_PROTO_XRRESULT_FUNC1(xrPassthroughStartFB, (XrPassthroughFB), passthrough) + // Pause the passthrough feature + EXT_PROTO_XRRESULT_FUNC1(xrPassthroughPauseFB, (XrPassthroughFB), passthrough) + + EXT_PROTO_XRRESULT_FUNC3(xrCreatePassthroughLayerFB, (XrSession), session, + (const XrPassthroughLayerCreateInfoFB *), config, + (XrPassthroughLayerFB *), layer_out) + + EXT_PROTO_XRRESULT_FUNC1(xrDestroyPassthroughLayerFB, (XrPassthroughLayerFB), layer) + + EXT_PROTO_XRRESULT_FUNC1(xrPassthroughLayerPauseFB, (XrPassthroughLayerFB), layer) + EXT_PROTO_XRRESULT_FUNC1(xrPassthroughLayerResumeFB, (XrPassthroughLayerFB), layer) + + // Set the style of an existing passthrough layer. If the enabled feature set + // doesn’t change, this is a lightweight operation that can be called in every + // frame to animate the style. Changes that may incur a bigger cost: + // - Enabling/disabling the color mapping, or changing the type of mapping + // (monochromatic to RGBA or back). + // - Changing `textureOpacityFactor` from 0 to non-zero or vice versa + // - Changing `edgeColor[3]` from 0 to non-zero or vice versa + // NOTE: For XR_FB_passthrough, all color values are treated as linear. + EXT_PROTO_XRRESULT_FUNC2(xrPassthroughLayerSetStyleFB, + (XrPassthroughLayerFB), layer, + (const XrPassthroughStyleFB *), style) + + // Create a geometry instance to be used as a projection surface for passthrough. + // A geometry instance assigns a triangle mesh as part of the specified layer's + // projection surface. + // The operation is only valid if the passthrough layer's purpose has been set to + // `XR_PASSTHROUGH_LAYER_PURPOSE_PROJECTED_FB`. Otherwise, the call this function will + // result in an error. In the specified layer, Passthrough will be visible where the view + // is covered by the user-specified geometries. + // + // A triangle mesh object can be instantiated multiple times - in the same or different layers' + // projection surface. Each instantiation has its own transformation, which + // can be updated using `xrGeometryInstanceSetTransformFB`. + EXT_PROTO_XRRESULT_FUNC3(xrCreateGeometryInstanceFB, + (XrSession), session, + (const XrGeometryInstanceCreateInfoFB *), create_info, + (XrGeometryInstanceFB *), out_geometry_instance) + + // Destroys a previously created geometry instance from passthrough rendering. + // This removes the geometry instance from passthrough rendering. + // The operation has no effect on other instances or the underlying mesh. + EXT_PROTO_XRRESULT_FUNC1(xrDestroyGeometryInstanceFB, (XrGeometryInstanceFB), instance) + + // Update the transformation of a passthrough geometry instance. + EXT_PROTO_XRRESULT_FUNC2(xrGeometryInstanceSetTransformFB, + (XrGeometryInstanceFB), instance, + (const XrGeometryInstanceTransformFB *), transformation) + + // Create a triangle mesh geometry object. + // Depending on the behavior flags, the mesh could be created immutable (data is assigned + // at creation and cannot be changed) or mutable (the mesh is created empty and can be updated + // by calling begin/end update functions). + EXT_PROTO_XRRESULT_FUNC3(xrCreateTriangleMeshFB, + (XrSession), session, + (const XrTriangleMeshCreateInfoFB *), create_info, + (XrTriangleMeshFB *), out_triangle_mesh) + + // Destroy an `XrTriangleMeshFB` object along with its data. The mesh buffers must not be + // accessed anymore after their parent mesh object has been destroyed. + EXT_PROTO_XRRESULT_FUNC1(xrDestroyTriangleMeshFB, (XrTriangleMeshFB), mesh) + + // Retrieve a pointer to the vertex buffer. The vertex buffer is structured as an array of 3 floats + // per vertex representing x, y, and z: `[x0, y0, z0, x1, y1, z1, ...]`. The size of the buffer is + // `maxVertexCount * 3` floats. The application must call `xrTriangleMeshBeginUpdateFB` or + // `xrTriangleMeshBeginVertexBufferUpdateFB` before making modifications to the vertex + // buffer. The buffer location is guaranteed to remain constant over the lifecycle of the mesh + // object. + EXT_PROTO_XRRESULT_FUNC2(xrTriangleMeshGetVertexBufferFB, + (XrTriangleMeshFB), mesh, + (XrVector3f **), out_vertex_buffer) + + // Retrieve the index buffer that defines the topology of the triangle mesh. Each triplet of + // consecutive elements point to three vertices in the vertex buffer and thus form a triangle. The + // size of each element is `indexElementSize` bytes, and thus the size of the buffer is + // `maxTriangleCount * 3 * indexElementSize` bytes. The application must call + // `xrTriangleMeshBeginUpdateFB` before making modifications to the index buffer. The buffer + // location is guaranteed to remain constant over the lifecycle of the mesh object. + EXT_PROTO_XRRESULT_FUNC2(xrTriangleMeshGetIndexBufferFB, + (XrTriangleMeshFB), mesh, + (uint32_t **), out_index_buffer) + + // Begin updating the mesh buffer data. The application must call this function before it makes any + // modifications to the buffers retrieved by `xrTriangleMeshGetVertexBufferFB` and + // `xrTriangleMeshGetIndexBufferFB`. If only the vertex buffer needs to be updated, + // `xrTriangleMeshBeginVertexBufferUpdateFB` can be used instead. To commit the + // modifications, the application must call `xrTriangleMeshEndUpdateFB`. + EXT_PROTO_XRRESULT_FUNC1(xrTriangleMeshBeginUpdateFB, (XrTriangleMeshFB), mesh) + + // Signal the API that the application has finished updating the mesh buffers after a call to + // `xrTriangleMeshBeginUpdateFB`. `vertexCount` and `triangleCount` specify the actual + // number of primitives that make up the mesh after the update. They must be larger than zero but + // smaller or equal to the maximum counts defined at create time. Buffer data beyond these counts + // is ignored. + EXT_PROTO_XRRESULT_FUNC3(xrTriangleMeshEndUpdateFB, + (XrTriangleMeshFB), mesh, + (uint32_t), vertexCount, + (uint32_t), triangle_count) + + // Update the vertex positions of a triangle mesh. Can only be called once the mesh topology has + // been set using `xrTriangleMeshBeginUpdateFB`/`xrTriangleMeshEndUpdateFB`. The + // vertex count is defined by the last invocation to `xrTriangleMeshEndUpdateFB`. Once the + // modification is done, `xrTriangleMeshEndVertexBufferUpdateFB` must be called. + EXT_PROTO_XRRESULT_FUNC2(xrTriangleMeshBeginVertexBufferUpdateFB, + (XrTriangleMeshFB), mesh, + (uint32_t *), out_vertex_count) + + // Signal the API that the contents of the vertex buffer data has been updated + // after a call to `xrTriangleMeshBeginVertexBufferUpdateFB`. + EXT_PROTO_XRRESULT_FUNC1(xrTriangleMeshEndVertexBufferUpdateFB, (XrTriangleMeshFB), mesh) + + bool initialize_fb_passthrough_extension(const XrInstance instance); + + bool initialize_fb_triangle_mesh_extension(const XrInstance instance); + + void cleanup(); + + // TODO: Temporary workaround (https://github.com/GodotVR/godot_openxr/issues/138) + // Address a bug in the passthrough api where XR_ERROR_UNEXPECTED_STATE_PASSTHROUGH_FB is + // returned even when the operation is valid on Meta Quest devices. + // The issue should be addressed on that platform in OS release v37. + inline bool is_valid_passthrough_result(XrResult result, const char *format) { + return openxr_api->xr_result(result, format) || result == XR_ERROR_UNEXPECTED_STATE_PASSTHROUGH_FB; + } + + Viewport *get_main_viewport(); + + bool is_composition_passthrough_layer_ready(); + + static OpenXRFbPassthroughExtensionWrapper *singleton; + + bool fb_passthrough_ext = false; // required for any passthrough functionality + bool fb_triangle_mesh_ext = false; // only use for projected passthrough + + XrPassthroughCreateInfoFB passthrough_create_info = { + XR_TYPE_PASSTHROUGH_CREATE_INFO_FB, + nullptr, + 0, + }; + XrPassthroughFB passthrough_handle = XR_NULL_HANDLE; + + XrPassthroughLayerCreateInfoFB passthrough_layer_config = { + XR_TYPE_PASSTHROUGH_LAYER_CREATE_INFO_FB, + nullptr, + passthrough_handle, + XR_PASSTHROUGH_IS_RUNNING_AT_CREATION_BIT_FB, + XR_PASSTHROUGH_LAYER_PURPOSE_RECONSTRUCTION_FB, + }; + XrPassthroughStyleFB passthrough_layer_style = { + XR_TYPE_PASSTHROUGH_STYLE_FB, + nullptr, + 1, + { 0, 0, 0, 0 }, + }; + XrPassthroughLayerFB passthrough_layer = XR_NULL_HANDLE; + + XrCompositionLayerPassthroughFB composition_passthrough_layer = { + XR_TYPE_COMPOSITION_LAYER_PASSTHROUGH_FB, + nullptr, + XR_COMPOSITION_LAYER_BLEND_TEXTURE_SOURCE_ALPHA_BIT, + XR_NULL_HANDLE, + XR_NULL_HANDLE, + }; +}; + +#endif // OPENXR_FB_PASSTHROUGH_EXTENSION_WRAPPER_H diff --git a/modules/openxr/openxr_api.cpp b/modules/openxr/openxr_api.cpp index 827c8f715f..16879ac4e5 100644 --- a/modules/openxr/openxr_api.cpp +++ b/modules/openxr/openxr_api.cpp @@ -49,6 +49,7 @@ #include "extensions/openxr_vulkan_extension.h" #endif +#include "extensions/openxr_fb_passthrough_extension_wrapper.h" #include "extensions/openxr_hand_tracking_extension.h" #include "extensions/openxr_htc_vive_tracker_extension.h" #include "extensions/openxr_palm_pose_extension.h" @@ -1764,6 +1765,7 @@ OpenXRAPI::OpenXRAPI() { register_extension_wrapper(memnew(OpenXRPalmPoseExtension(this))); register_extension_wrapper(memnew(OpenXRHTCViveTrackerExtension(this))); register_extension_wrapper(memnew(OpenXRHandTrackingExtension(this))); + register_extension_wrapper(memnew(OpenXRFbPassthroughExtensionWrapper(this))); } OpenXRAPI::~OpenXRAPI() { @@ -1872,6 +1874,18 @@ void OpenXRAPI::parse_velocities(const XrSpaceVelocity &p_velocity, Vector3 &r_l } } +bool OpenXRAPI::xr_result(XrResult result, const char *format, Array args) const { + if (XR_SUCCEEDED(result)) + return true; + + char resultString[XR_MAX_RESULT_STRING_SIZE]; + xrResultToString(instance, result, resultString); + + print_error(String("OpenXR ") + String(format).format(args) + String(" [") + String(resultString) + String("]")); + + return false; +} + RID OpenXRAPI::get_tracker_rid(XrPath p_path) { List<RID> current; tracker_owner.get_owned_list(¤t); @@ -2563,3 +2577,11 @@ bool OpenXRAPI::trigger_haptic_pulse(RID p_action, RID p_tracker, float p_freque return true; } + +void OpenXRAPI::register_composition_layer_provider(OpenXRCompositionLayerProvider *provider) { + composition_layer_providers.append(provider); +} + +void OpenXRAPI::unregister_composition_layer_provider(OpenXRCompositionLayerProvider *provider) { + composition_layer_providers.erase(provider); +} diff --git a/modules/openxr/openxr_api.h b/modules/openxr/openxr_api.h index f15617b604..316886239e 100644 --- a/modules/openxr/openxr_api.h +++ b/modules/openxr/openxr_api.h @@ -36,6 +36,7 @@ #include "core/math/transform_3d.h" #include "core/math/vector2.h" #include "core/os/memory.h" +#include "core/string/print_string.h" #include "core/string/ustring.h" #include "core/templates/rb_map.h" #include "core/templates/rid_owner.h" @@ -287,6 +288,8 @@ public: XRPose::TrackingConfidence transform_from_location(const XrHandJointLocationEXT &p_location, Transform3D &r_transform); void parse_velocities(const XrSpaceVelocity &p_velocity, Vector3 &r_linear_velocity, Vector3 &r_angular_velocity); + bool xr_result(XrResult result, const char *format, Array args = Array()) const; + static bool openxr_is_enabled(bool p_check_run_in_editor = true); static OpenXRAPI *get_singleton(); @@ -349,6 +352,9 @@ public: XRPose::TrackingConfidence get_action_pose(RID p_action, RID p_tracker, Transform3D &r_transform, Vector3 &r_linear_velocity, Vector3 &r_angular_velocity); bool trigger_haptic_pulse(RID p_action, RID p_tracker, float p_frequency, float p_amplitude, XrDuration p_duration_ns); + void register_composition_layer_provider(OpenXRCompositionLayerProvider *provider); + void unregister_composition_layer_provider(OpenXRCompositionLayerProvider *provider); + OpenXRAPI(); ~OpenXRAPI(); }; diff --git a/modules/openxr/openxr_interface.cpp b/modules/openxr/openxr_interface.cpp index c5eda88db8..01e148e00f 100644 --- a/modules/openxr/openxr_interface.cpp +++ b/modules/openxr/openxr_interface.cpp @@ -746,6 +746,24 @@ void OpenXRInterface::end_frame() { } } +bool OpenXRInterface::is_passthrough_supported() { + return passthrough_wrapper != nullptr && passthrough_wrapper->is_passthrough_supported(); +} + +bool OpenXRInterface::is_passthrough_enabled() { + return passthrough_wrapper != nullptr && passthrough_wrapper->is_passthrough_enabled(); +} + +bool OpenXRInterface::start_passthrough() { + return passthrough_wrapper != nullptr && passthrough_wrapper->start_passthrough(); +} + +void OpenXRInterface::stop_passthrough() { + if (passthrough_wrapper) { + passthrough_wrapper->stop_passthrough(); + } +} + void OpenXRInterface::on_state_ready() { emit_signal(SNAME("session_begun")); } @@ -776,6 +794,8 @@ OpenXRInterface::OpenXRInterface() { _set_default_pos(head_transform, 1.0, 0); _set_default_pos(transform_for_view[0], 1.0, 1); _set_default_pos(transform_for_view[1], 1.0, 2); + + passthrough_wrapper = OpenXRFbPassthroughExtensionWrapper::get_singleton(); } OpenXRInterface::~OpenXRInterface() { diff --git a/modules/openxr/openxr_interface.h b/modules/openxr/openxr_interface.h index a99012fd1d..3765f18637 100644 --- a/modules/openxr/openxr_interface.h +++ b/modules/openxr/openxr_interface.h @@ -37,6 +37,8 @@ #include "action_map/openxr_action_map.h" #include "openxr_api.h" +#include "extensions/openxr_fb_passthrough_extension_wrapper.h" + // declare some default strings #define INTERACTION_PROFILE_NONE "/interaction_profiles/none" @@ -47,6 +49,7 @@ private: OpenXRAPI *openxr_api = nullptr; bool initialized = false; XRInterface::TrackingStatus tracking_state; + OpenXRFbPassthroughExtensionWrapper *passthrough_wrapper = nullptr; // At a minimum we need a tracker for our head Ref<XRPositionalTracker> head; @@ -129,6 +132,11 @@ public: virtual Vector<BlitToScreen> post_draw_viewport(RID p_render_target, const Rect2 &p_screen_rect) override; virtual void end_frame() override; + virtual bool is_passthrough_supported() override; + virtual bool is_passthrough_enabled() override; + virtual bool start_passthrough() override; + virtual void stop_passthrough() override; + void on_state_ready(); void on_state_visible(); void on_state_focused(); diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp index 25c35b1877..d0301eeae3 100644 --- a/modules/text_server_adv/text_server_adv.cpp +++ b/modules/text_server_adv/text_server_adv.cpp @@ -33,7 +33,7 @@ #ifdef GDEXTENSION // Headers for building as GDExtension plug-in. -#include <godot_cpp/classes/file.hpp> +#include <godot_cpp/classes/file_access.hpp> #include <godot_cpp/classes/project_settings.hpp> #include <godot_cpp/classes/rendering_server.hpp> #include <godot_cpp/classes/translation_server.hpp> @@ -327,7 +327,7 @@ _FORCE_INLINE_ bool is_connected_to_prev(char32_t p_chr, char32_t p_pchr) { /*************************************************************************/ -bool TextServerAdvanced::has_feature(Feature p_feature) const { +bool TextServerAdvanced::_has_feature(Feature p_feature) const { switch (p_feature) { case FEATURE_SIMPLE_LAYOUT: case FEATURE_BIDI_LAYOUT: @@ -354,7 +354,7 @@ bool TextServerAdvanced::has_feature(Feature p_feature) const { return false; } -String TextServerAdvanced::get_name() const { +String TextServerAdvanced::_get_name() const { #ifdef GDEXTENSION return "ICU / HarfBuzz / Graphite (GDExtension)"; #else @@ -362,7 +362,7 @@ String TextServerAdvanced::get_name() const { #endif } -int64_t TextServerAdvanced::get_features() const { +int64_t TextServerAdvanced::_get_features() const { int64_t interface_features = FEATURE_SIMPLE_LAYOUT | FEATURE_BIDI_LAYOUT | FEATURE_VERTICAL_LAYOUT | FEATURE_SHAPING | FEATURE_KASHIDA_JUSTIFICATION | FEATURE_BREAK_ITERATORS | FEATURE_FONT_BITMAP | FEATURE_FONT_VARIABLE | FEATURE_CONTEXT_SENSITIVE_CASE_CONVERSION | FEATURE_USE_SUPPORT_DATA; #ifdef MODULE_FREETYPE_ENABLED interface_features |= FEATURE_FONT_DYNAMIC; @@ -374,7 +374,7 @@ int64_t TextServerAdvanced::get_features() const { return interface_features; } -void TextServerAdvanced::free_rid(const RID &p_rid) { +void TextServerAdvanced::_free_rid(const RID &p_rid) { _THREAD_SAFE_METHOD_ if (font_owner.owns(p_rid)) { FontAdvanced *fd = font_owner.get_or_null(p_rid); @@ -387,12 +387,12 @@ void TextServerAdvanced::free_rid(const RID &p_rid) { } } -bool TextServerAdvanced::has(const RID &p_rid) { +bool TextServerAdvanced::_has(const RID &p_rid) { _THREAD_SAFE_METHOD_ return font_owner.owns(p_rid) || shaped_owner.owns(p_rid); } -bool TextServerAdvanced::load_support_data(const String &p_filename) { +bool TextServerAdvanced::_load_support_data(const String &p_filename) { _THREAD_SAFE_METHOD_ #ifdef ICU_STATIC_DATA @@ -410,7 +410,11 @@ bool TextServerAdvanced::load_support_data(const String &p_filename) { return false; } uint64_t len = f->get_length(); +#ifdef GDEXTENSION + PackedByteArray icu_data = f->get_buffer(len); +#else PackedByteArray icu_data = f->_get_buffer(len); +#endif UErrorCode err = U_ZERO_ERROR; udata_setCommonData(icu_data.ptr(), &err); @@ -429,7 +433,7 @@ bool TextServerAdvanced::load_support_data(const String &p_filename) { return true; } -String TextServerAdvanced::get_support_data_filename() const { +String TextServerAdvanced::_get_support_data_filename() const { #ifdef ICU_STATIC_DATA return _MKSTR(ICU_DATA_NAME); #else @@ -437,7 +441,7 @@ String TextServerAdvanced::get_support_data_filename() const { #endif } -String TextServerAdvanced::get_support_data_info() const { +String TextServerAdvanced::_get_support_data_info() const { #ifdef ICU_STATIC_DATA return String("ICU break iteration data (") + _MKSTR(ICU_DATA_NAME) + String(")."); #else @@ -445,7 +449,7 @@ String TextServerAdvanced::get_support_data_info() const { #endif } -bool TextServerAdvanced::save_support_data(const String &p_filename) const { +bool TextServerAdvanced::_save_support_data(const String &p_filename) const { _THREAD_SAFE_METHOD_ #ifdef ICU_STATIC_DATA @@ -459,7 +463,11 @@ bool TextServerAdvanced::save_support_data(const String &p_filename) const { PackedByteArray icu_data; icu_data.resize(U_ICUDATA_SIZE); memcpy(icu_data.ptrw(), U_ICUDATA_ENTRY_POINT, U_ICUDATA_SIZE); +#ifdef GDEXTENSION + f->store_buffer(icu_data); +#else f->_store_buffer(icu_data); +#endif return true; #else @@ -467,7 +475,7 @@ bool TextServerAdvanced::save_support_data(const String &p_filename) const { #endif } -bool TextServerAdvanced::is_locale_right_to_left(const String &p_locale) const { +bool TextServerAdvanced::_is_locale_right_to_left(const String &p_locale) const { String l = p_locale.get_slicec('_', 0); if ((l == "ar") || (l == "dv") || (l == "he") || (l == "fa") || (l == "ff") || (l == "ku") || (l == "ur")) { return true; @@ -739,7 +747,7 @@ void TextServerAdvanced::_insert_feature_sets() { _insert_feature("weight", HB_TAG('w', 'g', 'h', 't'), Variant::Type::INT, false); } -int64_t TextServerAdvanced::name_to_tag(const String &p_name) const { +int64_t TextServerAdvanced::_name_to_tag(const String &p_name) const { if (feature_sets.has(p_name)) { return feature_sets[p_name]; } @@ -762,7 +770,7 @@ bool TextServerAdvanced::_get_tag_hidden(int64_t p_tag) const { return false; } -String TextServerAdvanced::tag_to_name(int64_t p_tag) const { +String TextServerAdvanced::_tag_to_name(int64_t p_tag) const { if (feature_sets_inv.has(p_tag)) { return feature_sets_inv[p_tag].name; } @@ -1043,8 +1051,14 @@ _FORCE_INLINE_ TextServerAdvanced::FontGlyph TextServerAdvanced::rasterize_msdf( td.projection = &projection; td.distancePixelConversion = &distancePixelConversion; +#ifdef GDEXTENSION + for (int i = 0; i < h; i++) { + _generateMTSDF_threaded(i, &td); + } +#else WorkerThreadPool::GroupID group_task = WorkerThreadPool::get_singleton()->add_template_group_task(this, &TextServerAdvanced::_generateMTSDF_threaded, &td, h, -1, true, SNAME("FontServerRasterizeMSDF")); WorkerThreadPool::get_singleton()->wait_for_group_task_completion(group_task); +#endif msdfgen::msdfErrorCorrection(image, shape, projection, p_pixel_range, config); @@ -1415,7 +1429,7 @@ _FORCE_INLINE_ bool TextServerAdvanced::_ensure_cache_for_size(FontAdvanced *p_f fd->oversampling = 1.0; fd->size.x = p_font_data->msdf_source_size; } else if (p_font_data->oversampling <= 0.0) { - fd->oversampling = font_get_global_oversampling(); + fd->oversampling = _font_get_global_oversampling(); } else { fd->oversampling = p_font_data->oversampling; } @@ -1808,8 +1822,8 @@ _FORCE_INLINE_ bool TextServerAdvanced::_ensure_cache_for_size(FontAdvanced *p_f coords.write[i] = CLAMP(var.value * 65536.0, amaster->axis[i].minimum, amaster->axis[i].maximum); } - if (p_font_data->variation_coordinates.has(tag_to_name(var.tag))) { - var.value = p_font_data->variation_coordinates[tag_to_name(var.tag)]; + if (p_font_data->variation_coordinates.has(_tag_to_name(var.tag))) { + var.value = p_font_data->variation_coordinates[_tag_to_name(var.tag)]; coords.write[i] = CLAMP(var.value * 65536.0, amaster->axis[i].minimum, amaster->axis[i].maximum); } @@ -1854,7 +1868,7 @@ hb_font_t *TextServerAdvanced::_font_get_hb_handle(const RID &p_font_rid, int64_ return fd->cache[size]->hb_handle; } -RID TextServerAdvanced::create_font() { +RID TextServerAdvanced::_create_font() { _THREAD_SAFE_METHOD_ FontAdvanced *fd = memnew(FontAdvanced); @@ -1862,7 +1876,7 @@ RID TextServerAdvanced::create_font() { return font_owner.make_rid(fd); } -void TextServerAdvanced::font_set_data(const RID &p_font_rid, const PackedByteArray &p_data) { +void TextServerAdvanced::_font_set_data(const RID &p_font_rid, const PackedByteArray &p_data) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1873,7 +1887,7 @@ void TextServerAdvanced::font_set_data(const RID &p_font_rid, const PackedByteAr fd->data_size = fd->data.size(); } -void TextServerAdvanced::font_set_data_ptr(const RID &p_font_rid, const uint8_t *p_data_ptr, int64_t p_data_size) { +void TextServerAdvanced::_font_set_data_ptr(const RID &p_font_rid, const uint8_t *p_data_ptr, int64_t p_data_size) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1884,7 +1898,7 @@ void TextServerAdvanced::font_set_data_ptr(const RID &p_font_rid, const uint8_t fd->data_size = p_data_size; } -void TextServerAdvanced::font_set_face_index(const RID &p_font_rid, int64_t p_face_index) { +void TextServerAdvanced::_font_set_face_index(const RID &p_font_rid, int64_t p_face_index) { ERR_FAIL_COND(p_face_index < 0); ERR_FAIL_COND(p_face_index >= 0x7FFF); @@ -1898,7 +1912,7 @@ void TextServerAdvanced::font_set_face_index(const RID &p_font_rid, int64_t p_fa } } -int64_t TextServerAdvanced::font_get_face_index(const RID &p_font_rid) const { +int64_t TextServerAdvanced::_font_get_face_index(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); @@ -1906,7 +1920,7 @@ int64_t TextServerAdvanced::font_get_face_index(const RID &p_font_rid) const { return fd->face_index; } -int64_t TextServerAdvanced::font_get_face_count(const RID &p_font_rid) const { +int64_t TextServerAdvanced::_font_get_face_count(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); @@ -1947,7 +1961,7 @@ int64_t TextServerAdvanced::font_get_face_count(const RID &p_font_rid) const { return face_count; } -void TextServerAdvanced::font_set_style(const RID &p_font_rid, BitField<FontStyle> p_style) { +void TextServerAdvanced::_font_set_style(const RID &p_font_rid, BitField<FontStyle> p_style) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1957,7 +1971,7 @@ void TextServerAdvanced::font_set_style(const RID &p_font_rid, BitField<FontStyl fd->style_flags = p_style; } -BitField<TextServer::FontStyle> TextServerAdvanced::font_get_style(const RID &p_font_rid) const { +BitField<TextServer::FontStyle> TextServerAdvanced::_font_get_style(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); @@ -1967,7 +1981,7 @@ BitField<TextServer::FontStyle> TextServerAdvanced::font_get_style(const RID &p_ return fd->style_flags; } -void TextServerAdvanced::font_set_style_name(const RID &p_font_rid, const String &p_name) { +void TextServerAdvanced::_font_set_style_name(const RID &p_font_rid, const String &p_name) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1977,7 +1991,7 @@ void TextServerAdvanced::font_set_style_name(const RID &p_font_rid, const String fd->style_name = p_name; } -String TextServerAdvanced::font_get_style_name(const RID &p_font_rid) const { +String TextServerAdvanced::_font_get_style_name(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, String()); @@ -1987,7 +2001,7 @@ String TextServerAdvanced::font_get_style_name(const RID &p_font_rid) const { return fd->style_name; } -void TextServerAdvanced::font_set_name(const RID &p_font_rid, const String &p_name) { +void TextServerAdvanced::_font_set_name(const RID &p_font_rid, const String &p_name) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1997,7 +2011,7 @@ void TextServerAdvanced::font_set_name(const RID &p_font_rid, const String &p_na fd->font_name = p_name; } -String TextServerAdvanced::font_get_name(const RID &p_font_rid) const { +String TextServerAdvanced::_font_get_name(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, String()); @@ -2007,7 +2021,7 @@ String TextServerAdvanced::font_get_name(const RID &p_font_rid) const { return fd->font_name; } -void TextServerAdvanced::font_set_antialiasing(RID p_font_rid, TextServer::FontAntialiasing p_antialiasing) { +void TextServerAdvanced::_font_set_antialiasing(const RID &p_font_rid, TextServer::FontAntialiasing p_antialiasing) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2018,7 +2032,7 @@ void TextServerAdvanced::font_set_antialiasing(RID p_font_rid, TextServer::FontA } } -TextServer::FontAntialiasing TextServerAdvanced::font_get_antialiasing(RID p_font_rid) const { +TextServer::FontAntialiasing TextServerAdvanced::_font_get_antialiasing(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, TextServer::FONT_ANTIALIASING_NONE); @@ -2026,7 +2040,7 @@ TextServer::FontAntialiasing TextServerAdvanced::font_get_antialiasing(RID p_fon return fd->antialiasing; } -void TextServerAdvanced::font_set_generate_mipmaps(const RID &p_font_rid, bool p_generate_mipmaps) { +void TextServerAdvanced::_font_set_generate_mipmaps(const RID &p_font_rid, bool p_generate_mipmaps) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2042,7 +2056,7 @@ void TextServerAdvanced::font_set_generate_mipmaps(const RID &p_font_rid, bool p } } -bool TextServerAdvanced::font_get_generate_mipmaps(const RID &p_font_rid) const { +bool TextServerAdvanced::_font_get_generate_mipmaps(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); @@ -2050,7 +2064,7 @@ bool TextServerAdvanced::font_get_generate_mipmaps(const RID &p_font_rid) const return fd->mipmaps; } -void TextServerAdvanced::font_set_multichannel_signed_distance_field(const RID &p_font_rid, bool p_msdf) { +void TextServerAdvanced::_font_set_multichannel_signed_distance_field(const RID &p_font_rid, bool p_msdf) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2061,7 +2075,7 @@ void TextServerAdvanced::font_set_multichannel_signed_distance_field(const RID & } } -bool TextServerAdvanced::font_is_multichannel_signed_distance_field(const RID &p_font_rid) const { +bool TextServerAdvanced::_font_is_multichannel_signed_distance_field(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); @@ -2069,7 +2083,7 @@ bool TextServerAdvanced::font_is_multichannel_signed_distance_field(const RID &p return fd->msdf; } -void TextServerAdvanced::font_set_msdf_pixel_range(const RID &p_font_rid, int64_t p_msdf_pixel_range) { +void TextServerAdvanced::_font_set_msdf_pixel_range(const RID &p_font_rid, int64_t p_msdf_pixel_range) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2080,7 +2094,7 @@ void TextServerAdvanced::font_set_msdf_pixel_range(const RID &p_font_rid, int64_ } } -int64_t TextServerAdvanced::font_get_msdf_pixel_range(const RID &p_font_rid) const { +int64_t TextServerAdvanced::_font_get_msdf_pixel_range(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); @@ -2088,7 +2102,7 @@ int64_t TextServerAdvanced::font_get_msdf_pixel_range(const RID &p_font_rid) con return fd->msdf_range; } -void TextServerAdvanced::font_set_msdf_size(const RID &p_font_rid, int64_t p_msdf_size) { +void TextServerAdvanced::_font_set_msdf_size(const RID &p_font_rid, int64_t p_msdf_size) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2099,7 +2113,7 @@ void TextServerAdvanced::font_set_msdf_size(const RID &p_font_rid, int64_t p_msd } } -int64_t TextServerAdvanced::font_get_msdf_size(const RID &p_font_rid) const { +int64_t TextServerAdvanced::_font_get_msdf_size(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); @@ -2107,7 +2121,7 @@ int64_t TextServerAdvanced::font_get_msdf_size(const RID &p_font_rid) const { return fd->msdf_source_size; } -void TextServerAdvanced::font_set_fixed_size(const RID &p_font_rid, int64_t p_fixed_size) { +void TextServerAdvanced::_font_set_fixed_size(const RID &p_font_rid, int64_t p_fixed_size) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2115,7 +2129,7 @@ void TextServerAdvanced::font_set_fixed_size(const RID &p_font_rid, int64_t p_fi fd->fixed_size = p_fixed_size; } -int64_t TextServerAdvanced::font_get_fixed_size(const RID &p_font_rid) const { +int64_t TextServerAdvanced::_font_get_fixed_size(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); @@ -2123,7 +2137,7 @@ int64_t TextServerAdvanced::font_get_fixed_size(const RID &p_font_rid) const { return fd->fixed_size; } -void TextServerAdvanced::font_set_force_autohinter(const RID &p_font_rid, bool p_force_autohinter) { +void TextServerAdvanced::_font_set_force_autohinter(const RID &p_font_rid, bool p_force_autohinter) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2134,7 +2148,7 @@ void TextServerAdvanced::font_set_force_autohinter(const RID &p_font_rid, bool p } } -bool TextServerAdvanced::font_is_force_autohinter(const RID &p_font_rid) const { +bool TextServerAdvanced::_font_is_force_autohinter(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); @@ -2142,7 +2156,7 @@ bool TextServerAdvanced::font_is_force_autohinter(const RID &p_font_rid) const { return fd->force_autohinter; } -void TextServerAdvanced::font_set_hinting(const RID &p_font_rid, TextServer::Hinting p_hinting) { +void TextServerAdvanced::_font_set_hinting(const RID &p_font_rid, TextServer::Hinting p_hinting) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2153,7 +2167,7 @@ void TextServerAdvanced::font_set_hinting(const RID &p_font_rid, TextServer::Hin } } -TextServer::Hinting TextServerAdvanced::font_get_hinting(const RID &p_font_rid) const { +TextServer::Hinting TextServerAdvanced::_font_get_hinting(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, HINTING_NONE); @@ -2161,7 +2175,7 @@ TextServer::Hinting TextServerAdvanced::font_get_hinting(const RID &p_font_rid) return fd->hinting; } -void TextServerAdvanced::font_set_subpixel_positioning(const RID &p_font_rid, TextServer::SubpixelPositioning p_subpixel) { +void TextServerAdvanced::_font_set_subpixel_positioning(const RID &p_font_rid, TextServer::SubpixelPositioning p_subpixel) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2169,7 +2183,7 @@ void TextServerAdvanced::font_set_subpixel_positioning(const RID &p_font_rid, Te fd->subpixel_positioning = p_subpixel; } -TextServer::SubpixelPositioning TextServerAdvanced::font_get_subpixel_positioning(const RID &p_font_rid) const { +TextServer::SubpixelPositioning TextServerAdvanced::_font_get_subpixel_positioning(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, SUBPIXEL_POSITIONING_DISABLED); @@ -2177,7 +2191,7 @@ TextServer::SubpixelPositioning TextServerAdvanced::font_get_subpixel_positionin return fd->subpixel_positioning; } -void TextServerAdvanced::font_set_embolden(const RID &p_font_rid, double p_strength) { +void TextServerAdvanced::_font_set_embolden(const RID &p_font_rid, double p_strength) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2188,7 +2202,7 @@ void TextServerAdvanced::font_set_embolden(const RID &p_font_rid, double p_stren } } -double TextServerAdvanced::font_get_embolden(const RID &p_font_rid) const { +double TextServerAdvanced::_font_get_embolden(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); @@ -2196,7 +2210,7 @@ double TextServerAdvanced::font_get_embolden(const RID &p_font_rid) const { return fd->embolden; } -void TextServerAdvanced::font_set_transform(const RID &p_font_rid, const Transform2D &p_transform) { +void TextServerAdvanced::_font_set_transform(const RID &p_font_rid, const Transform2D &p_transform) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2207,7 +2221,7 @@ void TextServerAdvanced::font_set_transform(const RID &p_font_rid, const Transfo } } -Transform2D TextServerAdvanced::font_get_transform(const RID &p_font_rid) const { +Transform2D TextServerAdvanced::_font_get_transform(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Transform2D()); @@ -2215,7 +2229,7 @@ Transform2D TextServerAdvanced::font_get_transform(const RID &p_font_rid) const return fd->transform; } -void TextServerAdvanced::font_set_variation_coordinates(const RID &p_font_rid, const Dictionary &p_variation_coordinates) { +void TextServerAdvanced::_font_set_variation_coordinates(const RID &p_font_rid, const Dictionary &p_variation_coordinates) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2226,7 +2240,7 @@ void TextServerAdvanced::font_set_variation_coordinates(const RID &p_font_rid, c } } -Dictionary TextServerAdvanced::font_get_variation_coordinates(const RID &p_font_rid) const { +Dictionary TextServerAdvanced::_font_get_variation_coordinates(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); @@ -2234,7 +2248,7 @@ Dictionary TextServerAdvanced::font_get_variation_coordinates(const RID &p_font_ return fd->variation_coordinates; } -void TextServerAdvanced::font_set_oversampling(const RID &p_font_rid, double p_oversampling) { +void TextServerAdvanced::_font_set_oversampling(const RID &p_font_rid, double p_oversampling) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2245,7 +2259,7 @@ void TextServerAdvanced::font_set_oversampling(const RID &p_font_rid, double p_o } } -double TextServerAdvanced::font_get_oversampling(const RID &p_font_rid) const { +double TextServerAdvanced::_font_get_oversampling(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); @@ -2253,7 +2267,7 @@ double TextServerAdvanced::font_get_oversampling(const RID &p_font_rid) const { return fd->oversampling; } -TypedArray<Vector2i> TextServerAdvanced::font_get_size_cache_list(const RID &p_font_rid) const { +TypedArray<Vector2i> TextServerAdvanced::_font_get_size_cache_list(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, TypedArray<Vector2i>()); @@ -2265,7 +2279,7 @@ TypedArray<Vector2i> TextServerAdvanced::font_get_size_cache_list(const RID &p_f return ret; } -void TextServerAdvanced::font_clear_size_cache(const RID &p_font_rid) { +void TextServerAdvanced::_font_clear_size_cache(const RID &p_font_rid) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2276,7 +2290,7 @@ void TextServerAdvanced::font_clear_size_cache(const RID &p_font_rid) { fd->cache.clear(); } -void TextServerAdvanced::font_remove_size_cache(const RID &p_font_rid, const Vector2i &p_size) { +void TextServerAdvanced::_font_remove_size_cache(const RID &p_font_rid, const Vector2i &p_size) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2287,7 +2301,7 @@ void TextServerAdvanced::font_remove_size_cache(const RID &p_font_rid, const Vec } } -void TextServerAdvanced::font_set_ascent(const RID &p_font_rid, int64_t p_size, double p_ascent) { +void TextServerAdvanced::_font_set_ascent(const RID &p_font_rid, int64_t p_size, double p_ascent) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2298,7 +2312,7 @@ void TextServerAdvanced::font_set_ascent(const RID &p_font_rid, int64_t p_size, fd->cache[size]->ascent = p_ascent; } -double TextServerAdvanced::font_get_ascent(const RID &p_font_rid, int64_t p_size) const { +double TextServerAdvanced::_font_get_ascent(const RID &p_font_rid, int64_t p_size) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); @@ -2314,7 +2328,7 @@ double TextServerAdvanced::font_get_ascent(const RID &p_font_rid, int64_t p_size } } -void TextServerAdvanced::font_set_descent(const RID &p_font_rid, int64_t p_size, double p_descent) { +void TextServerAdvanced::_font_set_descent(const RID &p_font_rid, int64_t p_size, double p_descent) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2324,7 +2338,7 @@ void TextServerAdvanced::font_set_descent(const RID &p_font_rid, int64_t p_size, fd->cache[size]->descent = p_descent; } -double TextServerAdvanced::font_get_descent(const RID &p_font_rid, int64_t p_size) const { +double TextServerAdvanced::_font_get_descent(const RID &p_font_rid, int64_t p_size) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); @@ -2340,7 +2354,7 @@ double TextServerAdvanced::font_get_descent(const RID &p_font_rid, int64_t p_siz } } -void TextServerAdvanced::font_set_underline_position(const RID &p_font_rid, int64_t p_size, double p_underline_position) { +void TextServerAdvanced::_font_set_underline_position(const RID &p_font_rid, int64_t p_size, double p_underline_position) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2351,7 +2365,7 @@ void TextServerAdvanced::font_set_underline_position(const RID &p_font_rid, int6 fd->cache[size]->underline_position = p_underline_position; } -double TextServerAdvanced::font_get_underline_position(const RID &p_font_rid, int64_t p_size) const { +double TextServerAdvanced::_font_get_underline_position(const RID &p_font_rid, int64_t p_size) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); @@ -2367,7 +2381,7 @@ double TextServerAdvanced::font_get_underline_position(const RID &p_font_rid, in } } -void TextServerAdvanced::font_set_underline_thickness(const RID &p_font_rid, int64_t p_size, double p_underline_thickness) { +void TextServerAdvanced::_font_set_underline_thickness(const RID &p_font_rid, int64_t p_size, double p_underline_thickness) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2378,7 +2392,7 @@ void TextServerAdvanced::font_set_underline_thickness(const RID &p_font_rid, int fd->cache[size]->underline_thickness = p_underline_thickness; } -double TextServerAdvanced::font_get_underline_thickness(const RID &p_font_rid, int64_t p_size) const { +double TextServerAdvanced::_font_get_underline_thickness(const RID &p_font_rid, int64_t p_size) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); @@ -2394,7 +2408,7 @@ double TextServerAdvanced::font_get_underline_thickness(const RID &p_font_rid, i } } -void TextServerAdvanced::font_set_scale(const RID &p_font_rid, int64_t p_size, double p_scale) { +void TextServerAdvanced::_font_set_scale(const RID &p_font_rid, int64_t p_size, double p_scale) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2410,7 +2424,7 @@ void TextServerAdvanced::font_set_scale(const RID &p_font_rid, int64_t p_size, d fd->cache[size]->scale = p_scale; } -double TextServerAdvanced::font_get_scale(const RID &p_font_rid, int64_t p_size) const { +double TextServerAdvanced::_font_get_scale(const RID &p_font_rid, int64_t p_size) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); @@ -2426,7 +2440,7 @@ double TextServerAdvanced::font_get_scale(const RID &p_font_rid, int64_t p_size) } } -int64_t TextServerAdvanced::font_get_texture_count(const RID &p_font_rid, const Vector2i &p_size) const { +int64_t TextServerAdvanced::_font_get_texture_count(const RID &p_font_rid, const Vector2i &p_size) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); @@ -2438,7 +2452,7 @@ int64_t TextServerAdvanced::font_get_texture_count(const RID &p_font_rid, const return fd->cache[size]->textures.size(); } -void TextServerAdvanced::font_clear_textures(const RID &p_font_rid, const Vector2i &p_size) { +void TextServerAdvanced::_font_clear_textures(const RID &p_font_rid, const Vector2i &p_size) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2448,7 +2462,7 @@ void TextServerAdvanced::font_clear_textures(const RID &p_font_rid, const Vector fd->cache[size]->textures.clear(); } -void TextServerAdvanced::font_remove_texture(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) { +void TextServerAdvanced::_font_remove_texture(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2460,7 +2474,7 @@ void TextServerAdvanced::font_remove_texture(const RID &p_font_rid, const Vector fd->cache[size]->textures.remove_at(p_texture_index); } -void TextServerAdvanced::font_set_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const Ref<Image> &p_image) { +void TextServerAdvanced::_font_set_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const Ref<Image> &p_image) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); ERR_FAIL_COND(p_image.is_null()); @@ -2491,7 +2505,7 @@ void TextServerAdvanced::font_set_texture_image(const RID &p_font_rid, const Vec tex.dirty = false; } -Ref<Image> TextServerAdvanced::font_get_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const { +Ref<Image> TextServerAdvanced::_font_get_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Ref<Image>()); @@ -2508,7 +2522,7 @@ Ref<Image> TextServerAdvanced::font_get_texture_image(const RID &p_font_rid, con return img; } -void TextServerAdvanced::font_set_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const PackedInt32Array &p_offset) { +void TextServerAdvanced::_font_set_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const PackedInt32Array &p_offset) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2524,7 +2538,7 @@ void TextServerAdvanced::font_set_texture_offsets(const RID &p_font_rid, const V tex.offsets = p_offset; } -PackedInt32Array TextServerAdvanced::font_get_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const { +PackedInt32Array TextServerAdvanced::_font_get_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, PackedInt32Array()); @@ -2537,7 +2551,7 @@ PackedInt32Array TextServerAdvanced::font_get_texture_offsets(const RID &p_font_ return tex.offsets; } -PackedInt32Array TextServerAdvanced::font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const { +PackedInt32Array TextServerAdvanced::_font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, PackedInt32Array()); @@ -2553,7 +2567,7 @@ PackedInt32Array TextServerAdvanced::font_get_glyph_list(const RID &p_font_rid, return ret; } -void TextServerAdvanced::font_clear_glyphs(const RID &p_font_rid, const Vector2i &p_size) { +void TextServerAdvanced::_font_clear_glyphs(const RID &p_font_rid, const Vector2i &p_size) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2564,7 +2578,7 @@ void TextServerAdvanced::font_clear_glyphs(const RID &p_font_rid, const Vector2i fd->cache[size]->glyph_map.clear(); } -void TextServerAdvanced::font_remove_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) { +void TextServerAdvanced::_font_remove_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2589,7 +2603,7 @@ double TextServerAdvanced::_get_extra_advance(RID p_font_rid, int p_font_size) c } } -Vector2 TextServerAdvanced::font_get_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph) const { +Vector2 TextServerAdvanced::_font_get_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); @@ -2600,7 +2614,7 @@ Vector2 TextServerAdvanced::font_get_glyph_advance(const RID &p_font_rid, int64_ int mod = 0; if (fd->antialiasing == FONT_ANTIALIASING_LCD) { - TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)GLOBAL_GET("gui/theme/lcd_subpixel_layout"); + TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)ProjectSettings::get_singleton()->get("gui/theme/lcd_subpixel_layout"); if (layout != FONT_LCD_SUBPIXEL_LAYOUT_NONE) { mod = (layout << 24); } @@ -2626,7 +2640,7 @@ Vector2 TextServerAdvanced::font_get_glyph_advance(const RID &p_font_rid, int64_ } } -void TextServerAdvanced::font_set_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph, const Vector2 &p_advance) { +void TextServerAdvanced::_font_set_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph, const Vector2 &p_advance) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2641,7 +2655,7 @@ void TextServerAdvanced::font_set_glyph_advance(const RID &p_font_rid, int64_t p gl[p_glyph].found = true; } -Vector2 TextServerAdvanced::font_get_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { +Vector2 TextServerAdvanced::_font_get_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); @@ -2652,7 +2666,7 @@ Vector2 TextServerAdvanced::font_get_glyph_offset(const RID &p_font_rid, const V int mod = 0; if (fd->antialiasing == FONT_ANTIALIASING_LCD) { - TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)GLOBAL_GET("gui/theme/lcd_subpixel_layout"); + TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)ProjectSettings::get_singleton()->get("gui/theme/lcd_subpixel_layout"); if (layout != FONT_LCD_SUBPIXEL_LAYOUT_NONE) { mod = (layout << 24); } @@ -2671,7 +2685,7 @@ Vector2 TextServerAdvanced::font_get_glyph_offset(const RID &p_font_rid, const V } } -void TextServerAdvanced::font_set_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_offset) { +void TextServerAdvanced::_font_set_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_offset) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2686,7 +2700,7 @@ void TextServerAdvanced::font_set_glyph_offset(const RID &p_font_rid, const Vect gl[p_glyph].found = true; } -Vector2 TextServerAdvanced::font_get_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { +Vector2 TextServerAdvanced::_font_get_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); @@ -2697,7 +2711,7 @@ Vector2 TextServerAdvanced::font_get_glyph_size(const RID &p_font_rid, const Vec int mod = 0; if (fd->antialiasing == FONT_ANTIALIASING_LCD) { - TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)GLOBAL_GET("gui/theme/lcd_subpixel_layout"); + TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)ProjectSettings::get_singleton()->get("gui/theme/lcd_subpixel_layout"); if (layout != FONT_LCD_SUBPIXEL_LAYOUT_NONE) { mod = (layout << 24); } @@ -2716,7 +2730,7 @@ Vector2 TextServerAdvanced::font_get_glyph_size(const RID &p_font_rid, const Vec } } -void TextServerAdvanced::font_set_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_gl_size) { +void TextServerAdvanced::_font_set_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_gl_size) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2731,7 +2745,7 @@ void TextServerAdvanced::font_set_glyph_size(const RID &p_font_rid, const Vector gl[p_glyph].found = true; } -Rect2 TextServerAdvanced::font_get_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { +Rect2 TextServerAdvanced::_font_get_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Rect2()); @@ -2742,7 +2756,7 @@ Rect2 TextServerAdvanced::font_get_glyph_uv_rect(const RID &p_font_rid, const Ve int mod = 0; if (fd->antialiasing == FONT_ANTIALIASING_LCD) { - TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)GLOBAL_GET("gui/theme/lcd_subpixel_layout"); + TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)ProjectSettings::get_singleton()->get("gui/theme/lcd_subpixel_layout"); if (layout != FONT_LCD_SUBPIXEL_LAYOUT_NONE) { mod = (layout << 24); } @@ -2756,7 +2770,7 @@ Rect2 TextServerAdvanced::font_get_glyph_uv_rect(const RID &p_font_rid, const Ve return gl[p_glyph | mod].uv_rect; } -void TextServerAdvanced::font_set_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Rect2 &p_uv_rect) { +void TextServerAdvanced::_font_set_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Rect2 &p_uv_rect) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2771,7 +2785,7 @@ void TextServerAdvanced::font_set_glyph_uv_rect(const RID &p_font_rid, const Vec gl[p_glyph].found = true; } -int64_t TextServerAdvanced::font_get_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { +int64_t TextServerAdvanced::_font_get_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, -1); @@ -2782,7 +2796,7 @@ int64_t TextServerAdvanced::font_get_glyph_texture_idx(const RID &p_font_rid, co int mod = 0; if (fd->antialiasing == FONT_ANTIALIASING_LCD) { - TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)GLOBAL_GET("gui/theme/lcd_subpixel_layout"); + TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)ProjectSettings::get_singleton()->get("gui/theme/lcd_subpixel_layout"); if (layout != FONT_LCD_SUBPIXEL_LAYOUT_NONE) { mod = (layout << 24); } @@ -2796,7 +2810,7 @@ int64_t TextServerAdvanced::font_get_glyph_texture_idx(const RID &p_font_rid, co return gl[p_glyph | mod].texture_idx; } -void TextServerAdvanced::font_set_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, int64_t p_texture_idx) { +void TextServerAdvanced::_font_set_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, int64_t p_texture_idx) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2811,7 +2825,7 @@ void TextServerAdvanced::font_set_glyph_texture_idx(const RID &p_font_rid, const gl[p_glyph].found = true; } -RID TextServerAdvanced::font_get_glyph_texture_rid(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { +RID TextServerAdvanced::_font_get_glyph_texture_rid(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, RID()); @@ -2822,7 +2836,7 @@ RID TextServerAdvanced::font_get_glyph_texture_rid(const RID &p_font_rid, const int mod = 0; if (fd->antialiasing == FONT_ANTIALIASING_LCD) { - TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)GLOBAL_GET("gui/theme/lcd_subpixel_layout"); + TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)ProjectSettings::get_singleton()->get("gui/theme/lcd_subpixel_layout"); if (layout != FONT_LCD_SUBPIXEL_LAYOUT_NONE) { mod = (layout << 24); } @@ -2859,7 +2873,7 @@ RID TextServerAdvanced::font_get_glyph_texture_rid(const RID &p_font_rid, const return RID(); } -Size2 TextServerAdvanced::font_get_glyph_texture_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { +Size2 TextServerAdvanced::_font_get_glyph_texture_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Size2()); @@ -2870,7 +2884,7 @@ Size2 TextServerAdvanced::font_get_glyph_texture_size(const RID &p_font_rid, con int mod = 0; if (fd->antialiasing == FONT_ANTIALIASING_LCD) { - TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)GLOBAL_GET("gui/theme/lcd_subpixel_layout"); + TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)ProjectSettings::get_singleton()->get("gui/theme/lcd_subpixel_layout"); if (layout != FONT_LCD_SUBPIXEL_LAYOUT_NONE) { mod = (layout << 24); } @@ -2907,7 +2921,7 @@ Size2 TextServerAdvanced::font_get_glyph_texture_size(const RID &p_font_rid, con return Size2(); } -Dictionary TextServerAdvanced::font_get_glyph_contours(const RID &p_font_rid, int64_t p_size, int64_t p_index) const { +Dictionary TextServerAdvanced::_font_get_glyph_contours(const RID &p_font_rid, int64_t p_size, int64_t p_index) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); @@ -2957,7 +2971,7 @@ Dictionary TextServerAdvanced::font_get_glyph_contours(const RID &p_font_rid, in #endif } -TypedArray<Vector2i> TextServerAdvanced::font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const { +TypedArray<Vector2i> TextServerAdvanced::_font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, TypedArray<Vector2i>()); @@ -2973,7 +2987,7 @@ TypedArray<Vector2i> TextServerAdvanced::font_get_kerning_list(const RID &p_font return ret; } -void TextServerAdvanced::font_clear_kerning_map(const RID &p_font_rid, int64_t p_size) { +void TextServerAdvanced::_font_clear_kerning_map(const RID &p_font_rid, int64_t p_size) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2984,7 +2998,7 @@ void TextServerAdvanced::font_clear_kerning_map(const RID &p_font_rid, int64_t p fd->cache[size]->kerning_map.clear(); } -void TextServerAdvanced::font_remove_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) { +void TextServerAdvanced::_font_remove_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2995,7 +3009,7 @@ void TextServerAdvanced::font_remove_kerning(const RID &p_font_rid, int64_t p_si fd->cache[size]->kerning_map.erase(p_glyph_pair); } -void TextServerAdvanced::font_set_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair, const Vector2 &p_kerning) { +void TextServerAdvanced::_font_set_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair, const Vector2 &p_kerning) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -3006,7 +3020,7 @@ void TextServerAdvanced::font_set_kerning(const RID &p_font_rid, int64_t p_size, fd->cache[size]->kerning_map[p_glyph_pair] = p_kerning; } -Vector2 TextServerAdvanced::font_get_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) const { +Vector2 TextServerAdvanced::_font_get_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); @@ -3039,7 +3053,7 @@ Vector2 TextServerAdvanced::font_get_kerning(const RID &p_font_rid, int64_t p_si return Vector2(); } -int64_t TextServerAdvanced::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 TextServerAdvanced::_font_get_glyph_index(const RID &p_font_rid, int64_t p_size, int64_t p_char, int64_t p_variation_selector) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); ERR_FAIL_COND_V_MSG((p_char >= 0xd800 && p_char <= 0xdfff) || (p_char > 0x10ffff), 0, "Unicode parsing error: Invalid unicode codepoint " + String::num_int64(p_char, 16) + "."); @@ -3064,7 +3078,7 @@ int64_t TextServerAdvanced::font_get_glyph_index(const RID &p_font_rid, int64_t #endif } -bool TextServerAdvanced::font_has_char(const RID &p_font_rid, int64_t p_char) const { +bool TextServerAdvanced::_font_has_char(const RID &p_font_rid, int64_t p_char) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V_MSG((p_char >= 0xd800 && p_char <= 0xdfff) || (p_char > 0x10ffff), false, "Unicode parsing error: Invalid unicode codepoint " + String::num_int64(p_char, 16) + "."); if (!fd) { @@ -3085,7 +3099,7 @@ bool TextServerAdvanced::font_has_char(const RID &p_font_rid, int64_t p_char) co return (at_size) ? at_size->glyph_map.has((int32_t)p_char) : false; } -String TextServerAdvanced::font_get_supported_chars(const RID &p_font_rid) const { +String TextServerAdvanced::_font_get_supported_chars(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, String()); @@ -3118,7 +3132,7 @@ String TextServerAdvanced::font_get_supported_chars(const RID &p_font_rid) const return chars; } -void TextServerAdvanced::font_render_range(const RID &p_font_rid, const Vector2i &p_size, int64_t p_start, int64_t p_end) { +void TextServerAdvanced::_font_render_range(const RID &p_font_rid, const Vector2i &p_size, int64_t p_start, int64_t p_end) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); ERR_FAIL_COND_MSG((p_start >= 0xd800 && p_start <= 0xdfff) || (p_start > 0x10ffff), "Unicode parsing error: Invalid unicode codepoint " + String::num_int64(p_start, 16) + "."); @@ -3153,7 +3167,7 @@ void TextServerAdvanced::font_render_range(const RID &p_font_rid, const Vector2i } } -void TextServerAdvanced::font_render_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_index) { +void TextServerAdvanced::_font_render_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_index) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -3184,7 +3198,7 @@ void TextServerAdvanced::font_render_glyph(const RID &p_font_rid, const Vector2i #endif } -void TextServerAdvanced::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 { +void TextServerAdvanced::_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 { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -3199,7 +3213,7 @@ void TextServerAdvanced::font_draw_glyph(const RID &p_font_rid, const RID &p_can if (!fd->msdf && fd->cache[size]->face) { // LCD layout, bits 24, 25, 26 if (fd->antialiasing == FONT_ANTIALIASING_LCD) { - TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)GLOBAL_GET("gui/theme/lcd_subpixel_layout"); + TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)ProjectSettings::get_singleton()->get("gui/theme/lcd_subpixel_layout"); if (layout != FONT_LCD_SUBPIXEL_LAYOUT_NONE) { lcd_aa = true; index = index | (layout << 24); @@ -3276,7 +3290,7 @@ void TextServerAdvanced::font_draw_glyph(const RID &p_font_rid, const RID &p_can } } -void TextServerAdvanced::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 { +void TextServerAdvanced::_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 { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -3291,7 +3305,7 @@ void TextServerAdvanced::font_draw_glyph_outline(const RID &p_font_rid, const RI if (!fd->msdf && fd->cache[size]->face) { // LCD layout, bits 24, 25, 26 if (fd->antialiasing == FONT_ANTIALIASING_LCD) { - TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)GLOBAL_GET("gui/theme/lcd_subpixel_layout"); + TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)ProjectSettings::get_singleton()->get("gui/theme/lcd_subpixel_layout"); if (layout != FONT_LCD_SUBPIXEL_LAYOUT_NONE) { lcd_aa = true; index = index | (layout << 24); @@ -3368,7 +3382,7 @@ void TextServerAdvanced::font_draw_glyph_outline(const RID &p_font_rid, const RI } } -bool TextServerAdvanced::font_is_language_supported(const RID &p_font_rid, const String &p_language) const { +bool TextServerAdvanced::_font_is_language_supported(const RID &p_font_rid, const String &p_language) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); @@ -3380,7 +3394,7 @@ bool TextServerAdvanced::font_is_language_supported(const RID &p_font_rid, const } } -void TextServerAdvanced::font_set_language_support_override(const RID &p_font_rid, const String &p_language, bool p_supported) { +void TextServerAdvanced::_font_set_language_support_override(const RID &p_font_rid, const String &p_language, bool p_supported) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -3388,7 +3402,7 @@ void TextServerAdvanced::font_set_language_support_override(const RID &p_font_ri fd->language_support_overrides[p_language] = p_supported; } -bool TextServerAdvanced::font_get_language_support_override(const RID &p_font_rid, const String &p_language) { +bool TextServerAdvanced::_font_get_language_support_override(const RID &p_font_rid, const String &p_language) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); @@ -3396,7 +3410,7 @@ bool TextServerAdvanced::font_get_language_support_override(const RID &p_font_ri return fd->language_support_overrides[p_language]; } -void TextServerAdvanced::font_remove_language_support_override(const RID &p_font_rid, const String &p_language) { +void TextServerAdvanced::_font_remove_language_support_override(const RID &p_font_rid, const String &p_language) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -3404,7 +3418,7 @@ void TextServerAdvanced::font_remove_language_support_override(const RID &p_font fd->language_support_overrides.erase(p_language); } -PackedStringArray TextServerAdvanced::font_get_language_support_overrides(const RID &p_font_rid) { +PackedStringArray TextServerAdvanced::_font_get_language_support_overrides(const RID &p_font_rid) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, PackedStringArray()); @@ -3416,7 +3430,7 @@ PackedStringArray TextServerAdvanced::font_get_language_support_overrides(const return out; } -bool TextServerAdvanced::font_is_script_supported(const RID &p_font_rid, const String &p_script) const { +bool TextServerAdvanced::_font_is_script_supported(const RID &p_font_rid, const String &p_script) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); @@ -3430,7 +3444,7 @@ bool TextServerAdvanced::font_is_script_supported(const RID &p_font_rid, const S } } -void TextServerAdvanced::font_set_script_support_override(const RID &p_font_rid, const String &p_script, bool p_supported) { +void TextServerAdvanced::_font_set_script_support_override(const RID &p_font_rid, const String &p_script, bool p_supported) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -3438,7 +3452,7 @@ void TextServerAdvanced::font_set_script_support_override(const RID &p_font_rid, fd->script_support_overrides[p_script] = p_supported; } -bool TextServerAdvanced::font_get_script_support_override(const RID &p_font_rid, const String &p_script) { +bool TextServerAdvanced::_font_get_script_support_override(const RID &p_font_rid, const String &p_script) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); @@ -3446,7 +3460,7 @@ bool TextServerAdvanced::font_get_script_support_override(const RID &p_font_rid, return fd->script_support_overrides[p_script]; } -void TextServerAdvanced::font_remove_script_support_override(const RID &p_font_rid, const String &p_script) { +void TextServerAdvanced::_font_remove_script_support_override(const RID &p_font_rid, const String &p_script) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -3454,7 +3468,7 @@ void TextServerAdvanced::font_remove_script_support_override(const RID &p_font_r fd->script_support_overrides.erase(p_script); } -PackedStringArray TextServerAdvanced::font_get_script_support_overrides(const RID &p_font_rid) { +PackedStringArray TextServerAdvanced::_font_get_script_support_overrides(const RID &p_font_rid) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, PackedStringArray()); @@ -3466,7 +3480,7 @@ PackedStringArray TextServerAdvanced::font_get_script_support_overrides(const RI return out; } -void TextServerAdvanced::font_set_opentype_feature_overrides(const RID &p_font_rid, const Dictionary &p_overrides) { +void TextServerAdvanced::_font_set_opentype_feature_overrides(const RID &p_font_rid, const Dictionary &p_overrides) { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -3476,7 +3490,7 @@ void TextServerAdvanced::font_set_opentype_feature_overrides(const RID &p_font_r fd->feature_overrides = p_overrides; } -Dictionary TextServerAdvanced::font_get_opentype_feature_overrides(const RID &p_font_rid) const { +Dictionary TextServerAdvanced::_font_get_opentype_feature_overrides(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); @@ -3484,7 +3498,7 @@ Dictionary TextServerAdvanced::font_get_opentype_feature_overrides(const RID &p_ return fd->feature_overrides; } -Dictionary TextServerAdvanced::font_supported_feature_list(const RID &p_font_rid) const { +Dictionary TextServerAdvanced::_font_supported_feature_list(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); @@ -3494,7 +3508,7 @@ Dictionary TextServerAdvanced::font_supported_feature_list(const RID &p_font_rid return fd->supported_features; } -Dictionary TextServerAdvanced::font_supported_variation_list(const RID &p_font_rid) const { +Dictionary TextServerAdvanced::_font_supported_variation_list(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); @@ -3504,11 +3518,11 @@ Dictionary TextServerAdvanced::font_supported_variation_list(const RID &p_font_r return fd->supported_varaitions; } -double TextServerAdvanced::font_get_global_oversampling() const { +double TextServerAdvanced::_font_get_global_oversampling() const { return oversampling; } -void TextServerAdvanced::font_set_global_oversampling(double p_oversampling) { +void TextServerAdvanced::_font_set_global_oversampling(double p_oversampling) { _THREAD_SAFE_METHOD_ if (oversampling != p_oversampling) { oversampling = p_oversampling; @@ -3516,8 +3530,8 @@ void TextServerAdvanced::font_set_global_oversampling(double p_oversampling) { font_owner.get_owned_list(&fonts); bool font_cleared = false; for (const RID &E : fonts) { - if (!font_is_multichannel_signed_distance_field(E) && font_get_oversampling(E) <= 0) { - font_clear_size_cache(E); + if (!_font_is_multichannel_signed_distance_field(E) && _font_get_oversampling(E) <= 0) { + _font_clear_size_cache(E); font_cleared = true; } } @@ -3626,7 +3640,7 @@ void TextServerAdvanced::full_copy(ShapedTextDataAdvanced *p_shaped) { p_shaped->parent = RID(); } -RID TextServerAdvanced::create_shaped_text(TextServer::Direction p_direction, TextServer::Orientation p_orientation) { +RID TextServerAdvanced::_create_shaped_text(TextServer::Direction p_direction, TextServer::Orientation p_orientation) { _THREAD_SAFE_METHOD_ ShapedTextDataAdvanced *sd = memnew(ShapedTextDataAdvanced); @@ -3636,7 +3650,7 @@ RID TextServerAdvanced::create_shaped_text(TextServer::Direction p_direction, Te return shaped_owner.make_rid(sd); } -void TextServerAdvanced::shaped_text_clear(const RID &p_shaped) { +void TextServerAdvanced::_shaped_text_clear(const RID &p_shaped) { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); @@ -3651,7 +3665,7 @@ void TextServerAdvanced::shaped_text_clear(const RID &p_shaped) { invalidate(sd, true); } -void TextServerAdvanced::shaped_text_set_direction(const RID &p_shaped, TextServer::Direction p_direction) { +void TextServerAdvanced::_shaped_text_set_direction(const RID &p_shaped, TextServer::Direction p_direction) { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); @@ -3665,7 +3679,7 @@ void TextServerAdvanced::shaped_text_set_direction(const RID &p_shaped, TextServ } } -TextServer::Direction TextServerAdvanced::shaped_text_get_direction(const RID &p_shaped) const { +TextServer::Direction TextServerAdvanced::_shaped_text_get_direction(const RID &p_shaped) const { const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, TextServer::DIRECTION_LTR); @@ -3673,7 +3687,7 @@ TextServer::Direction TextServerAdvanced::shaped_text_get_direction(const RID &p return sd->direction; } -TextServer::Direction TextServerAdvanced::shaped_text_get_inferred_direction(const RID &p_shaped) const { +TextServer::Direction TextServerAdvanced::_shaped_text_get_inferred_direction(const RID &p_shaped) const { const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, TextServer::DIRECTION_LTR); @@ -3681,7 +3695,7 @@ TextServer::Direction TextServerAdvanced::shaped_text_get_inferred_direction(con return sd->para_direction; } -void TextServerAdvanced::shaped_text_set_custom_punctuation(const RID &p_shaped, const String &p_punct) { +void TextServerAdvanced::_shaped_text_set_custom_punctuation(const RID &p_shaped, const String &p_punct) { _THREAD_SAFE_METHOD_ ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); @@ -3695,14 +3709,14 @@ void TextServerAdvanced::shaped_text_set_custom_punctuation(const RID &p_shaped, } } -String TextServerAdvanced::shaped_text_get_custom_punctuation(const RID &p_shaped) const { +String TextServerAdvanced::_shaped_text_get_custom_punctuation(const RID &p_shaped) const { _THREAD_SAFE_METHOD_ const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, String()); return sd->custom_punct; } -void TextServerAdvanced::shaped_text_set_bidi_override(const RID &p_shaped, const Array &p_override) { +void TextServerAdvanced::_shaped_text_set_bidi_override(const RID &p_shaped, const Array &p_override) { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); @@ -3719,7 +3733,7 @@ void TextServerAdvanced::shaped_text_set_bidi_override(const RID &p_shaped, cons invalidate(sd, false); } -void TextServerAdvanced::shaped_text_set_orientation(const RID &p_shaped, TextServer::Orientation p_orientation) { +void TextServerAdvanced::_shaped_text_set_orientation(const RID &p_shaped, TextServer::Orientation p_orientation) { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); @@ -3733,7 +3747,7 @@ void TextServerAdvanced::shaped_text_set_orientation(const RID &p_shaped, TextSe } } -void TextServerAdvanced::shaped_text_set_preserve_invalid(const RID &p_shaped, bool p_enabled) { +void TextServerAdvanced::_shaped_text_set_preserve_invalid(const RID &p_shaped, bool p_enabled) { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); @@ -3745,7 +3759,7 @@ void TextServerAdvanced::shaped_text_set_preserve_invalid(const RID &p_shaped, b } } -bool TextServerAdvanced::shaped_text_get_preserve_invalid(const RID &p_shaped) const { +bool TextServerAdvanced::_shaped_text_get_preserve_invalid(const RID &p_shaped) const { const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); @@ -3753,7 +3767,7 @@ bool TextServerAdvanced::shaped_text_get_preserve_invalid(const RID &p_shaped) c return sd->preserve_invalid; } -void TextServerAdvanced::shaped_text_set_preserve_control(const RID &p_shaped, bool p_enabled) { +void TextServerAdvanced::_shaped_text_set_preserve_control(const RID &p_shaped, bool p_enabled) { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); @@ -3767,7 +3781,7 @@ void TextServerAdvanced::shaped_text_set_preserve_control(const RID &p_shaped, b } } -bool TextServerAdvanced::shaped_text_get_preserve_control(const RID &p_shaped) const { +bool TextServerAdvanced::_shaped_text_get_preserve_control(const RID &p_shaped) const { const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); @@ -3775,7 +3789,7 @@ bool TextServerAdvanced::shaped_text_get_preserve_control(const RID &p_shaped) c return sd->preserve_control; } -void TextServerAdvanced::shaped_text_set_spacing(const RID &p_shaped, SpacingType p_spacing, int64_t p_value) { +void TextServerAdvanced::_shaped_text_set_spacing(const RID &p_shaped, SpacingType p_spacing, int64_t p_value) { ERR_FAIL_INDEX((int)p_spacing, 4); ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); @@ -3790,7 +3804,7 @@ void TextServerAdvanced::shaped_text_set_spacing(const RID &p_shaped, SpacingTyp } } -int64_t TextServerAdvanced::shaped_text_get_spacing(const RID &p_shaped, SpacingType p_spacing) const { +int64_t TextServerAdvanced::_shaped_text_get_spacing(const RID &p_shaped, SpacingType p_spacing) const { ERR_FAIL_INDEX_V((int)p_spacing, 4, 0); const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); @@ -3800,7 +3814,7 @@ int64_t TextServerAdvanced::shaped_text_get_spacing(const RID &p_shaped, Spacing return sd->extra_spacing[p_spacing]; } -TextServer::Orientation TextServerAdvanced::shaped_text_get_orientation(const RID &p_shaped) const { +TextServer::Orientation TextServerAdvanced::_shaped_text_get_orientation(const RID &p_shaped) const { const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, TextServer::ORIENTATION_HORIZONTAL); @@ -3808,20 +3822,20 @@ TextServer::Orientation TextServerAdvanced::shaped_text_get_orientation(const RI return sd->orientation; } -int64_t TextServerAdvanced::shaped_get_span_count(const RID &p_shaped) const { +int64_t TextServerAdvanced::_shaped_get_span_count(const RID &p_shaped) const { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0); return sd->spans.size(); } -Variant TextServerAdvanced::shaped_get_span_meta(const RID &p_shaped, int64_t p_index) const { +Variant TextServerAdvanced::_shaped_get_span_meta(const RID &p_shaped, int64_t p_index) const { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, Variant()); ERR_FAIL_INDEX_V(p_index, sd->spans.size(), Variant()); return sd->spans[p_index].meta; } -void TextServerAdvanced::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) { +void TextServerAdvanced::_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) { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); ERR_FAIL_INDEX(p_index, sd->spans.size()); @@ -3834,7 +3848,7 @@ void TextServerAdvanced::shaped_set_span_update_font(const RID &p_shaped, int64_ invalidate(sd, false); } -bool TextServerAdvanced::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 TextServerAdvanced::_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) { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); ERR_FAIL_COND_V(p_size <= 0, false); @@ -3869,7 +3883,7 @@ bool TextServerAdvanced::shaped_text_add_string(const RID &p_shaped, const Strin return true; } -bool TextServerAdvanced::shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align, int64_t p_length) { +bool TextServerAdvanced::_shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align, int64_t p_length) { _THREAD_SAFE_METHOD_ ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); @@ -3899,7 +3913,7 @@ bool TextServerAdvanced::shaped_text_add_object(const RID &p_shaped, const Varia return true; } -bool TextServerAdvanced::shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align) { +bool TextServerAdvanced::_shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align) { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); @@ -3940,14 +3954,14 @@ bool TextServerAdvanced::shaped_text_resize_object(const RID &p_shaped, const Va } else { if (gl.font_rid.is_valid()) { if (sd->orientation == ORIENTATION_HORIZONTAL) { - sd->ascent = MAX(sd->ascent, MAX(font_get_ascent(gl.font_rid, gl.font_size), -gl.y_off)); - sd->descent = MAX(sd->descent, MAX(font_get_descent(gl.font_rid, gl.font_size), gl.y_off)); + sd->ascent = MAX(sd->ascent, MAX(_font_get_ascent(gl.font_rid, gl.font_size), -gl.y_off)); + sd->descent = MAX(sd->descent, MAX(_font_get_descent(gl.font_rid, gl.font_size), gl.y_off)); } else { - sd->ascent = MAX(sd->ascent, Math::round(font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5)); - sd->descent = MAX(sd->descent, Math::round(font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5)); + sd->ascent = MAX(sd->ascent, Math::round(_font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5)); + sd->descent = MAX(sd->descent, Math::round(_font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5)); } - sd->upos = MAX(sd->upos, font_get_underline_position(gl.font_rid, gl.font_size)); - sd->uthk = MAX(sd->uthk, font_get_underline_thickness(gl.font_rid, gl.font_size)); + sd->upos = MAX(sd->upos, _font_get_underline_position(gl.font_rid, gl.font_size)); + sd->uthk = MAX(sd->uthk, _font_get_underline_thickness(gl.font_rid, gl.font_size)); } else if (sd->preserve_invalid || (sd->preserve_control && is_control(gl.index))) { // Glyph not found, replace with hex code box. if (sd->orientation == ORIENTATION_HORIZONTAL) { @@ -4034,7 +4048,7 @@ void TextServerAdvanced::_realign(ShapedTextDataAdvanced *p_sd) const { p_sd->descent = full_descent; } -RID TextServerAdvanced::shaped_text_substr(const RID &p_shaped, int64_t p_start, int64_t p_length) const { +RID TextServerAdvanced::_shaped_text_substr(const RID &p_shaped, int64_t p_start, int64_t p_length) const { _THREAD_SAFE_METHOD_ const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); @@ -4042,10 +4056,10 @@ RID TextServerAdvanced::shaped_text_substr(const RID &p_shaped, int64_t p_start, MutexLock lock(sd->mutex); if (sd->parent != RID()) { - return shaped_text_substr(sd->parent, p_start, p_length); + return _shaped_text_substr(sd->parent, p_start, p_length); } if (!sd->valid) { - const_cast<TextServerAdvanced *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerAdvanced *>(this)->_shaped_text_shape(p_shaped); } ERR_FAIL_COND_V(p_start < 0 || p_length < 0, RID()); ERR_FAIL_COND_V(sd->start > p_start || sd->end < p_start, RID()); @@ -4149,11 +4163,11 @@ bool TextServerAdvanced::_shape_substr(ShapedTextDataAdvanced *p_new_sd, const S } else { if (gl.font_rid.is_valid()) { if (p_new_sd->orientation == ORIENTATION_HORIZONTAL) { - p_new_sd->ascent = MAX(p_new_sd->ascent, MAX(font_get_ascent(gl.font_rid, gl.font_size), -gl.y_off)); - p_new_sd->descent = MAX(p_new_sd->descent, MAX(font_get_descent(gl.font_rid, gl.font_size), gl.y_off)); + p_new_sd->ascent = MAX(p_new_sd->ascent, MAX(_font_get_ascent(gl.font_rid, gl.font_size), -gl.y_off)); + p_new_sd->descent = MAX(p_new_sd->descent, MAX(_font_get_descent(gl.font_rid, gl.font_size), gl.y_off)); } else { - p_new_sd->ascent = MAX(p_new_sd->ascent, Math::round(font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5)); - p_new_sd->descent = MAX(p_new_sd->descent, Math::round(font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5)); + p_new_sd->ascent = MAX(p_new_sd->ascent, Math::round(_font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5)); + p_new_sd->descent = MAX(p_new_sd->descent, Math::round(_font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5)); } } else if (p_new_sd->preserve_invalid || (p_new_sd->preserve_control && is_control(gl.index))) { // Glyph not found, replace with hex code box. @@ -4179,7 +4193,7 @@ bool TextServerAdvanced::_shape_substr(ShapedTextDataAdvanced *p_new_sd, const S return true; } -RID TextServerAdvanced::shaped_text_get_parent(const RID &p_shaped) const { +RID TextServerAdvanced::_shaped_text_get_parent(const RID &p_shaped) const { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, RID()); @@ -4187,16 +4201,16 @@ RID TextServerAdvanced::shaped_text_get_parent(const RID &p_shaped) const { return sd->parent; } -double TextServerAdvanced::shaped_text_fit_to_width(const RID &p_shaped, double p_width, BitField<TextServer::JustificationFlag> p_jst_flags) { +double TextServerAdvanced::_shaped_text_fit_to_width(const RID &p_shaped, double p_width, BitField<TextServer::JustificationFlag> p_jst_flags) { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.0); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerAdvanced *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerAdvanced *>(this)->_shaped_text_shape(p_shaped); } if (!sd->justification_ops_valid) { - const_cast<TextServerAdvanced *>(this)->shaped_text_update_justification_ops(p_shaped); + const_cast<TextServerAdvanced *>(this)->_shaped_text_update_justification_ops(p_shaped); } sd->fit_width_minimum_reached = false; @@ -4344,16 +4358,16 @@ double TextServerAdvanced::shaped_text_fit_to_width(const RID &p_shaped, double return Math::ceil(justification_width); } -double TextServerAdvanced::shaped_text_tab_align(const RID &p_shaped, const PackedFloat32Array &p_tab_stops) { +double TextServerAdvanced::_shaped_text_tab_align(const RID &p_shaped, const PackedFloat32Array &p_tab_stops) { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.0); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerAdvanced *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerAdvanced *>(this)->_shaped_text_shape(p_shaped); } if (!sd->line_breaks_valid) { - const_cast<TextServerAdvanced *>(this)->shaped_text_update_breaks(p_shaped); + const_cast<TextServerAdvanced *>(this)->_shaped_text_update_breaks(p_shaped); } for (int i = 0; i < p_tab_stops.size(); i++) { @@ -4400,13 +4414,13 @@ double TextServerAdvanced::shaped_text_tab_align(const RID &p_shaped, const Pack return 0.0; } -void TextServerAdvanced::shaped_text_overrun_trim_to_width(const RID &p_shaped_line, double p_width, BitField<TextServer::TextOverrunFlag> p_trim_flags) { +void TextServerAdvanced::_shaped_text_overrun_trim_to_width(const RID &p_shaped_line, double p_width, BitField<TextServer::TextOverrunFlag> p_trim_flags) { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped_line); ERR_FAIL_COND_MSG(!sd, "ShapedTextDataAdvanced invalid."); MutexLock lock(sd->mutex); if (!sd->valid) { - shaped_text_shape(p_shaped_line); + _shaped_text_shape(p_shaped_line); } sd->text_trimmed = false; @@ -4445,30 +4459,30 @@ void TextServerAdvanced::shaped_text_overrun_trim_to_width(const RID &p_shaped_l // Find usable fonts, if fonts from the last glyph do not have required chars. RID dot_gl_font_rid = sd_glyphs[sd_size - 1].font_rid; - if (!font_has_char(dot_gl_font_rid, '.')) { + if (!_font_has_char(dot_gl_font_rid, '.')) { const Array &fonts = spans[spans.size() - 1].fonts; for (int i = 0; i < fonts.size(); i++) { - if (font_has_char(fonts[i], '.')) { + if (_font_has_char(fonts[i], '.')) { dot_gl_font_rid = fonts[i]; break; } } } RID whitespace_gl_font_rid = sd_glyphs[sd_size - 1].font_rid; - if (!font_has_char(whitespace_gl_font_rid, '.')) { + if (!_font_has_char(whitespace_gl_font_rid, '.')) { const Array &fonts = spans[spans.size() - 1].fonts; for (int i = 0; i < fonts.size(); i++) { - if (font_has_char(fonts[i], ' ')) { + if (_font_has_char(fonts[i], ' ')) { whitespace_gl_font_rid = fonts[i]; break; } } } - int32_t dot_gl_idx = dot_gl_font_rid.is_valid() ? font_get_glyph_index(dot_gl_font_rid, last_gl_font_size, '.') : -10; - Vector2 dot_adv = dot_gl_font_rid.is_valid() ? font_get_glyph_advance(dot_gl_font_rid, last_gl_font_size, dot_gl_idx) : Vector2(); - int32_t whitespace_gl_idx = whitespace_gl_font_rid.is_valid() ? font_get_glyph_index(whitespace_gl_font_rid, last_gl_font_size, ' ') : -10; - Vector2 whitespace_adv = whitespace_gl_font_rid.is_valid() ? font_get_glyph_advance(whitespace_gl_font_rid, last_gl_font_size, whitespace_gl_idx) : Vector2(); + int32_t dot_gl_idx = dot_gl_font_rid.is_valid() ? _font_get_glyph_index(dot_gl_font_rid, last_gl_font_size, '.', 0) : -10; + Vector2 dot_adv = dot_gl_font_rid.is_valid() ? _font_get_glyph_advance(dot_gl_font_rid, last_gl_font_size, dot_gl_idx) : Vector2(); + int32_t whitespace_gl_idx = whitespace_gl_font_rid.is_valid() ? _font_get_glyph_index(whitespace_gl_font_rid, last_gl_font_size, ' ', 0) : -10; + Vector2 whitespace_adv = whitespace_gl_font_rid.is_valid() ? _font_get_glyph_advance(whitespace_gl_font_rid, last_gl_font_size, whitespace_gl_idx) : Vector2(); int ellipsis_width = 0; if (add_ellipsis && whitespace_gl_font_rid.is_valid()) { @@ -4567,7 +4581,7 @@ void TextServerAdvanced::shaped_text_overrun_trim_to_width(const RID &p_shaped_l } } -int64_t TextServerAdvanced::shaped_text_get_trim_pos(const RID &p_shaped) const { +int64_t TextServerAdvanced::_shaped_text_get_trim_pos(const RID &p_shaped) const { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V_MSG(!sd, -1, "ShapedTextDataAdvanced invalid."); @@ -4575,7 +4589,7 @@ int64_t TextServerAdvanced::shaped_text_get_trim_pos(const RID &p_shaped) const return sd->overrun_trim_data.trim_pos; } -int64_t TextServerAdvanced::shaped_text_get_ellipsis_pos(const RID &p_shaped) const { +int64_t TextServerAdvanced::_shaped_text_get_ellipsis_pos(const RID &p_shaped) const { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V_MSG(!sd, -1, "ShapedTextDataAdvanced invalid."); @@ -4583,7 +4597,7 @@ int64_t TextServerAdvanced::shaped_text_get_ellipsis_pos(const RID &p_shaped) co return sd->overrun_trim_data.ellipsis_pos; } -const Glyph *TextServerAdvanced::shaped_text_get_ellipsis_glyphs(const RID &p_shaped) const { +const Glyph *TextServerAdvanced::_shaped_text_get_ellipsis_glyphs(const RID &p_shaped) const { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V_MSG(!sd, nullptr, "ShapedTextDataAdvanced invalid."); @@ -4591,7 +4605,7 @@ const Glyph *TextServerAdvanced::shaped_text_get_ellipsis_glyphs(const RID &p_sh return sd->overrun_trim_data.ellipsis_glyph_buf.ptr(); } -int64_t TextServerAdvanced::shaped_text_get_ellipsis_glyph_count(const RID &p_shaped) const { +int64_t TextServerAdvanced::_shaped_text_get_ellipsis_glyph_count(const RID &p_shaped) const { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V_MSG(!sd, 0, "ShapedTextDataAdvanced invalid."); @@ -4599,13 +4613,13 @@ int64_t TextServerAdvanced::shaped_text_get_ellipsis_glyph_count(const RID &p_sh return sd->overrun_trim_data.ellipsis_glyph_buf.size(); } -bool TextServerAdvanced::shaped_text_update_breaks(const RID &p_shaped) { +bool TextServerAdvanced::_shaped_text_update_breaks(const RID &p_shaped) { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); MutexLock lock(sd->mutex); if (!sd->valid) { - shaped_text_shape(p_shaped); + _shaped_text_shape(p_shaped); } if (sd->line_breaks_valid) { @@ -4816,16 +4830,16 @@ _FORCE_INLINE_ int64_t _generate_kashida_justification_opportunies(const String return kashida_pos; } -bool TextServerAdvanced::shaped_text_update_justification_ops(const RID &p_shaped) { +bool TextServerAdvanced::_shaped_text_update_justification_ops(const RID &p_shaped) { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); MutexLock lock(sd->mutex); if (!sd->valid) { - shaped_text_shape(p_shaped); + _shaped_text_shape(p_shaped); } if (!sd->line_breaks_valid) { - shaped_text_update_breaks(p_shaped); + _shaped_text_update_breaks(p_shaped); } if (sd->justification_ops_valid) { @@ -4970,7 +4984,7 @@ bool TextServerAdvanced::shaped_text_update_justification_ops(const RID &p_shape Glyph TextServerAdvanced::_shape_single_glyph(ShapedTextDataAdvanced *p_sd, char32_t p_char, hb_script_t p_script, hb_direction_t p_direction, const RID &p_font, int64_t p_font_size) { hb_font_t *hb_font = _font_get_hb_handle(p_font, p_font_size); - bool subpos = (font_get_subpixel_positioning(p_font) == SUBPIXEL_POSITIONING_ONE_HALF) || (font_get_subpixel_positioning(p_font) == SUBPIXEL_POSITIONING_ONE_QUARTER) || (font_get_subpixel_positioning(p_font) == SUBPIXEL_POSITIONING_AUTO && p_font_size <= SUBPIXEL_POSITIONING_ONE_HALF_MAX_SIZE); + bool subpos = (_font_get_subpixel_positioning(p_font) == SUBPIXEL_POSITIONING_ONE_HALF) || (_font_get_subpixel_positioning(p_font) == SUBPIXEL_POSITIONING_ONE_QUARTER) || (_font_get_subpixel_positioning(p_font) == SUBPIXEL_POSITIONING_AUTO && p_font_size <= SUBPIXEL_POSITIONING_ONE_HALF_MAX_SIZE); ERR_FAIL_COND_V(hb_font == nullptr, Glyph()); hb_buffer_clear_contents(p_sd->hb_buffer); @@ -4996,7 +5010,7 @@ Glyph TextServerAdvanced::_shape_single_glyph(ShapedTextDataAdvanced *p_sd, char gl.font_size = p_font_size; if (glyph_count > 0) { - double scale = font_get_scale(p_font, p_font_size); + double scale = _font_get_scale(p_font, p_font_size); if (p_sd->orientation == ORIENTATION_HORIZONTAL) { if (subpos) { gl.advance = glyph_pos[0].x_advance / (64.0 / scale) + _get_extra_advance(p_font, p_font_size); @@ -5031,7 +5045,7 @@ _FORCE_INLINE_ void TextServerAdvanced::_add_featuers(const Dictionary &p_source if (value >= 0) { hb_feature_t feature; if (keys[i].get_type() == Variant::STRING) { - feature.tag = name_to_tag(keys[i]); + feature.tag = _name_to_tag(keys[i]); } else { feature.tag = keys[i]; } @@ -5082,12 +5096,12 @@ void TextServerAdvanced::_shape_run(ShapedTextDataAdvanced *p_sd, int64_t p_star Vector2i fss = _get_size(fd, fs); hb_font_t *hb_font = _font_get_hb_handle(f, fs); - double scale = font_get_scale(f, fs); + double scale = _font_get_scale(f, fs); double sp_sp = p_sd->extra_spacing[SPACING_SPACE]; double sp_gl = p_sd->extra_spacing[SPACING_GLYPH]; bool last_run = (p_sd->end == p_end); double ea = _get_extra_advance(f, fs); - bool subpos = (font_get_subpixel_positioning(f) == SUBPIXEL_POSITIONING_ONE_HALF) || (font_get_subpixel_positioning(f) == SUBPIXEL_POSITIONING_ONE_QUARTER) || (font_get_subpixel_positioning(f) == SUBPIXEL_POSITIONING_AUTO && fs <= SUBPIXEL_POSITIONING_ONE_HALF_MAX_SIZE); + bool subpos = (_font_get_subpixel_positioning(f) == SUBPIXEL_POSITIONING_ONE_HALF) || (_font_get_subpixel_positioning(f) == SUBPIXEL_POSITIONING_ONE_QUARTER) || (_font_get_subpixel_positioning(f) == SUBPIXEL_POSITIONING_AUTO && fs <= SUBPIXEL_POSITIONING_ONE_HALF_MAX_SIZE); ERR_FAIL_COND(hb_font == nullptr); hb_buffer_clear_contents(p_sd->hb_buffer); @@ -5115,7 +5129,7 @@ void TextServerAdvanced::_shape_run(ShapedTextDataAdvanced *p_sd, int64_t p_star hb_buffer_add_utf32(p_sd->hb_buffer, (const uint32_t *)p_sd->text.ptr(), p_sd->text.length(), p_start, p_end - p_start); Vector<hb_feature_t> ftrs; - _add_featuers(font_get_opentype_feature_overrides(f), ftrs); + _add_featuers(_font_get_opentype_feature_overrides(f), ftrs); _add_featuers(p_sd->spans[p_span].features, ftrs); hb_shape(hb_font, p_sd->hb_buffer, ftrs.is_empty() ? nullptr : &ftrs[0], ftrs.size()); @@ -5126,7 +5140,7 @@ void TextServerAdvanced::_shape_run(ShapedTextDataAdvanced *p_sd, int64_t p_star int mod = 0; if (fd->antialiasing == FONT_ANTIALIASING_LCD) { - TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)GLOBAL_GET("gui/theme/lcd_subpixel_layout"); + TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)ProjectSettings::get_singleton()->get("gui/theme/lcd_subpixel_layout"); if (layout != FONT_LCD_SUBPIXEL_LAYOUT_NONE) { mod = (layout << 24); } @@ -5246,7 +5260,7 @@ void TextServerAdvanced::_shape_run(ShapedTextDataAdvanced *p_sd, int64_t p_star p_sd->ascent = MAX(p_sd->ascent, -w[i + j].y_off); p_sd->descent = MAX(p_sd->descent, w[i + j].y_off); } else { - double gla = Math::round(font_get_glyph_advance(f, fs, w[i + j].index).x * 0.5); + double gla = Math::round(_font_get_glyph_advance(f, fs, w[i + j].index).x * 0.5); p_sd->ascent = MAX(p_sd->ascent, gla); p_sd->descent = MAX(p_sd->descent, gla); } @@ -5269,14 +5283,14 @@ void TextServerAdvanced::_shape_run(ShapedTextDataAdvanced *p_sd, int64_t p_star if (failed_subrun_start != p_end + 1) { _shape_run(p_sd, failed_subrun_start, failed_subrun_end, p_script, p_direction, p_fonts, p_span, p_fb_index + 1); } - p_sd->ascent = MAX(p_sd->ascent, font_get_ascent(f, fs)); - p_sd->descent = MAX(p_sd->descent, font_get_descent(f, fs)); - p_sd->upos = MAX(p_sd->upos, font_get_underline_position(f, fs)); - p_sd->uthk = MAX(p_sd->uthk, font_get_underline_thickness(f, fs)); + p_sd->ascent = MAX(p_sd->ascent, _font_get_ascent(f, fs)); + p_sd->descent = MAX(p_sd->descent, _font_get_descent(f, fs)); + p_sd->upos = MAX(p_sd->upos, _font_get_underline_position(f, fs)); + p_sd->uthk = MAX(p_sd->uthk, _font_get_underline_thickness(f, fs)); } } -bool TextServerAdvanced::shaped_text_shape(const RID &p_shaped) { +bool TextServerAdvanced::_shaped_text_shape(const RID &p_shaped) { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); @@ -5287,7 +5301,7 @@ bool TextServerAdvanced::shaped_text_shape(const RID &p_shaped) { invalidate(sd, false); if (sd->parent != RID()) { - shaped_text_shape(sd->parent); + _shaped_text_shape(sd->parent); ShapedTextDataAdvanced *parent_sd = shaped_owner.get_or_null(sd->parent); ERR_FAIL_COND_V(!parent_sd->valid, false); ERR_FAIL_COND_V(!_shape_substr(sd, parent_sd, sd->start, sd->end - sd->start), false); @@ -5427,8 +5441,8 @@ bool TextServerAdvanced::shaped_text_shape(const RID &p_shaped) { fonts.push_back(sd->spans[k].fonts[0]); } for (int l = 1; l < font_count; l++) { - if (font_is_script_supported(span.fonts[l], script)) { - if (font_is_language_supported(span.fonts[l], span.language)) { + if (_font_is_script_supported(span.fonts[l], script)) { + if (_font_is_language_supported(span.fonts[l], span.language)) { fonts.push_back(sd->spans[k].fonts[l]); } else { fonts_scr_only.push_back(sd->spans[k].fonts[l]); @@ -5452,7 +5466,7 @@ bool TextServerAdvanced::shaped_text_shape(const RID &p_shaped) { return sd->valid; } -bool TextServerAdvanced::shaped_text_is_ready(const RID &p_shaped) const { +bool TextServerAdvanced::_shaped_text_is_ready(const RID &p_shaped) const { const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); @@ -5460,35 +5474,35 @@ bool TextServerAdvanced::shaped_text_is_ready(const RID &p_shaped) const { return sd->valid; } -const Glyph *TextServerAdvanced::shaped_text_get_glyphs(const RID &p_shaped) const { +const Glyph *TextServerAdvanced::_shaped_text_get_glyphs(const RID &p_shaped) const { const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, nullptr); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerAdvanced *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerAdvanced *>(this)->_shaped_text_shape(p_shaped); } return sd->glyphs.ptr(); } -int64_t TextServerAdvanced::shaped_text_get_glyph_count(const RID &p_shaped) const { +int64_t TextServerAdvanced::_shaped_text_get_glyph_count(const RID &p_shaped) const { const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerAdvanced *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerAdvanced *>(this)->_shaped_text_shape(p_shaped); } return sd->glyphs.size(); } -const Glyph *TextServerAdvanced::shaped_text_sort_logical(const RID &p_shaped) { +const Glyph *TextServerAdvanced::_shaped_text_sort_logical(const RID &p_shaped) { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, nullptr); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerAdvanced *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerAdvanced *>(this)->_shaped_text_shape(p_shaped); } if (!sd->sort_valid) { @@ -5500,7 +5514,7 @@ const Glyph *TextServerAdvanced::shaped_text_sort_logical(const RID &p_shaped) { return sd->glyphs_logical.ptr(); } -Vector2i TextServerAdvanced::shaped_text_get_range(const RID &p_shaped) const { +Vector2i TextServerAdvanced::_shaped_text_get_range(const RID &p_shaped) const { const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, Vector2i()); @@ -5508,7 +5522,7 @@ Vector2i TextServerAdvanced::shaped_text_get_range(const RID &p_shaped) const { return Vector2(sd->start, sd->end); } -Array TextServerAdvanced::shaped_text_get_objects(const RID &p_shaped) const { +Array TextServerAdvanced::_shaped_text_get_objects(const RID &p_shaped) const { Array ret; const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, ret); @@ -5521,25 +5535,25 @@ Array TextServerAdvanced::shaped_text_get_objects(const RID &p_shaped) const { return ret; } -Rect2 TextServerAdvanced::shaped_text_get_object_rect(const RID &p_shaped, const Variant &p_key) const { +Rect2 TextServerAdvanced::_shaped_text_get_object_rect(const RID &p_shaped, const Variant &p_key) const { const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, Rect2()); MutexLock lock(sd->mutex); ERR_FAIL_COND_V(!sd->objects.has(p_key), Rect2()); if (!sd->valid) { - const_cast<TextServerAdvanced *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerAdvanced *>(this)->_shaped_text_shape(p_shaped); } return sd->objects[p_key].rect; } -Size2 TextServerAdvanced::shaped_text_get_size(const RID &p_shaped) const { +Size2 TextServerAdvanced::_shaped_text_get_size(const RID &p_shaped) const { const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, Size2()); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerAdvanced *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerAdvanced *>(this)->_shaped_text_shape(p_shaped); } if (sd->orientation == TextServer::ORIENTATION_HORIZONTAL) { return Size2((sd->text_trimmed ? sd->width_trimmed : sd->width), sd->ascent + sd->descent + sd->extra_spacing[SPACING_TOP] + sd->extra_spacing[SPACING_BOTTOM]).ceil(); @@ -5548,58 +5562,58 @@ Size2 TextServerAdvanced::shaped_text_get_size(const RID &p_shaped) const { } } -double TextServerAdvanced::shaped_text_get_ascent(const RID &p_shaped) const { +double TextServerAdvanced::_shaped_text_get_ascent(const RID &p_shaped) const { const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.0); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerAdvanced *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerAdvanced *>(this)->_shaped_text_shape(p_shaped); } return sd->ascent + sd->extra_spacing[SPACING_TOP]; } -double TextServerAdvanced::shaped_text_get_descent(const RID &p_shaped) const { +double TextServerAdvanced::_shaped_text_get_descent(const RID &p_shaped) const { const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.0); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerAdvanced *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerAdvanced *>(this)->_shaped_text_shape(p_shaped); } return sd->descent + sd->extra_spacing[SPACING_BOTTOM]; } -double TextServerAdvanced::shaped_text_get_width(const RID &p_shaped) const { +double TextServerAdvanced::_shaped_text_get_width(const RID &p_shaped) const { const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.0); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerAdvanced *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerAdvanced *>(this)->_shaped_text_shape(p_shaped); } return Math::ceil(sd->text_trimmed ? sd->width_trimmed : sd->width); } -double TextServerAdvanced::shaped_text_get_underline_position(const RID &p_shaped) const { +double TextServerAdvanced::_shaped_text_get_underline_position(const RID &p_shaped) const { const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.0); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerAdvanced *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerAdvanced *>(this)->_shaped_text_shape(p_shaped); } return sd->upos; } -double TextServerAdvanced::shaped_text_get_underline_thickness(const RID &p_shaped) const { +double TextServerAdvanced::_shaped_text_get_underline_thickness(const RID &p_shaped) const { const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.0); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerAdvanced *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerAdvanced *>(this)->_shaped_text_shape(p_shaped); } return sd->uthk; @@ -5780,7 +5794,7 @@ void TextServerAdvanced::_insert_num_systems_lang() { } } -String TextServerAdvanced::format_number(const String &p_string, const String &p_language) const { +String TextServerAdvanced::_format_number(const String &p_string, const String &p_language) const { const StringName lang = (p_language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : p_language; String res = p_string; @@ -5805,7 +5819,7 @@ String TextServerAdvanced::format_number(const String &p_string, const String &p return res; } -String TextServerAdvanced::parse_number(const String &p_string, const String &p_language) const { +String TextServerAdvanced::_parse_number(const String &p_string, const String &p_language) const { const StringName lang = (p_language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : p_language; String res = p_string; @@ -5833,7 +5847,7 @@ String TextServerAdvanced::parse_number(const String &p_string, const String &p_ return res; } -String TextServerAdvanced::percent_sign(const String &p_language) const { +String TextServerAdvanced::_percent_sign(const String &p_language) const { const StringName lang = (p_language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : p_language; for (int i = 0; i < num_systems.size(); i++) { @@ -5847,7 +5861,7 @@ String TextServerAdvanced::percent_sign(const String &p_language) const { return "%"; } -int64_t TextServerAdvanced::is_confusable(const String &p_string, const PackedStringArray &p_dict) const { +int64_t TextServerAdvanced::_is_confusable(const String &p_string, const PackedStringArray &p_dict) const { UErrorCode status = U_ZERO_ERROR; int64_t match_index = -1; @@ -5887,7 +5901,7 @@ int64_t TextServerAdvanced::is_confusable(const String &p_string, const PackedSt return match_index; } -bool TextServerAdvanced::spoof_check(const String &p_string) const { +bool TextServerAdvanced::_spoof_check(const String &p_string) const { UErrorCode status = U_ZERO_ERROR; Char16String utf16 = p_string.utf16(); @@ -5909,7 +5923,7 @@ bool TextServerAdvanced::spoof_check(const String &p_string) const { return (bitmask != 0); } -String TextServerAdvanced::strip_diacritics(const String &p_string) const { +String TextServerAdvanced::_strip_diacritics(const String &p_string) const { UErrorCode err = U_ZERO_ERROR; // Get NFKD normalizer singleton. @@ -5942,7 +5956,7 @@ String TextServerAdvanced::strip_diacritics(const String &p_string) const { return result; } -String TextServerAdvanced::string_to_upper(const String &p_string, const String &p_language) const { +String TextServerAdvanced::_string_to_upper(const String &p_string, const String &p_language) const { const String lang = (p_language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : p_language; // Convert to UTF-16. @@ -5961,7 +5975,7 @@ String TextServerAdvanced::string_to_upper(const String &p_string, const String return String::utf16(upper.ptr(), len); } -String TextServerAdvanced::string_to_lower(const String &p_string, const String &p_language) const { +String TextServerAdvanced::_string_to_lower(const String &p_string, const String &p_language) const { const String lang = (p_language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : p_language; // Convert to UTF-16. Char16String utf16 = p_string.utf16(); @@ -5979,7 +5993,7 @@ String TextServerAdvanced::string_to_lower(const String &p_string, const String return String::utf16(lower.ptr(), len); } -PackedInt32Array TextServerAdvanced::string_get_word_breaks(const String &p_string, const String &p_language) const { +PackedInt32Array TextServerAdvanced::_string_get_word_breaks(const String &p_string, const String &p_language) const { const String lang = (p_language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : p_language; // Convert to UTF-16. Char16String utf16 = p_string.utf16(); @@ -6027,7 +6041,7 @@ PackedInt32Array TextServerAdvanced::string_get_word_breaks(const String &p_stri return ret; } -bool TextServerAdvanced::is_valid_identifier(const String &p_string) const { +bool TextServerAdvanced::_is_valid_identifier(const String &p_string) const { enum UAX31SequenceStatus { SEQ_NOT_STARTED, SEQ_STARTED, @@ -6048,7 +6062,7 @@ bool TextServerAdvanced::is_valid_identifier(const String &p_string) const { if (U_FAILURE(err)) { return false; // Failed to load normalizer. } - bool isnurom = unorm2_isNormalized(norm_c, utf16.ptr(), utf16.length(), &err); + bool isnurom = unorm2_isNormalized(norm_c, utf16.get_data(), utf16.length(), &err); if (U_FAILURE(err) || !isnurom) { return false; // Do not conform to Normalization Form C. } diff --git a/modules/text_server_adv/text_server_adv.h b/modules/text_server_adv/text_server_adv.h index b9633a9b71..fb5075e835 100644 --- a/modules/text_server_adv/text_server_adv.h +++ b/modules/text_server_adv/text_server_adv.h @@ -42,6 +42,7 @@ #include <godot_cpp/godot.hpp> #include <godot_cpp/core/class_db.hpp> +#include <godot_cpp/core/ext_wrappers.gen.inc> #include <godot_cpp/core/mutex_lock.hpp> #include <godot_cpp/variant/array.hpp> @@ -79,11 +80,13 @@ using namespace godot; #else // Headers for building as built-in module. +#include "servers/text/text_server_extension.h" + +#include "core/extension/ext_wrappers.gen.inc" #include "core/object/worker_thread_pool.h" #include "core/templates/hash_map.h" #include "core/templates/rid_owner.h" #include "scene/resources/texture.h" -#include "servers/text/text_server_extension.h" #include "modules/modules_enabled.gen.h" // For freetype, msdfgen. @@ -462,258 +465,259 @@ protected: void invalidate(ShapedTextDataAdvanced *p_shaped, bool p_text = false); public: - virtual bool has_feature(Feature p_feature) const override; - virtual String get_name() const override; - virtual int64_t get_features() const override; + MODBIND1RC(bool, has_feature, Feature); + MODBIND0RC(String, get_name); + MODBIND0RC(int64_t, get_features); - virtual void free_rid(const RID &p_rid) override; - virtual bool has(const RID &p_rid) override; - virtual bool load_support_data(const String &p_filename) override; + MODBIND1(free_rid, const RID &); + MODBIND1R(bool, has, const RID &); + MODBIND1R(bool, load_support_data, const String &); - virtual String get_support_data_filename() const override; - virtual String get_support_data_info() const override; - virtual bool save_support_data(const String &p_filename) const override; + MODBIND0RC(String, get_support_data_filename); + MODBIND0RC(String, get_support_data_info); + MODBIND1RC(bool, save_support_data, const String &); - virtual bool is_locale_right_to_left(const String &p_locale) const override; + MODBIND1RC(bool, is_locale_right_to_left, const String &); - virtual int64_t name_to_tag(const String &p_name) const override; - virtual String tag_to_name(int64_t p_tag) const override; + MODBIND1RC(int64_t, name_to_tag, const String &); + MODBIND1RC(String, tag_to_name, int64_t); /* Font interface */ - virtual RID create_font() override; - virtual void font_set_data(const RID &p_font_rid, const PackedByteArray &p_data) override; - virtual void font_set_data_ptr(const RID &p_font_rid, const uint8_t *p_data_ptr, int64_t p_data_size) override; + MODBIND0R(RID, create_font); + + MODBIND2(font_set_data, const RID &, const PackedByteArray &); + MODBIND3(font_set_data_ptr, const RID &, const uint8_t *, int64_t); - virtual void font_set_face_index(const RID &p_font_rid, int64_t p_index) override; - virtual int64_t font_get_face_index(const RID &p_font_rid) const override; + MODBIND2(font_set_face_index, const RID &, int64_t); + MODBIND1RC(int64_t, font_get_face_index, const RID &); - virtual int64_t font_get_face_count(const RID &p_font_rid) const override; + MODBIND1RC(int64_t, font_get_face_count, const RID &); - virtual void font_set_style(const RID &p_font_rid, BitField<FontStyle> p_style) override; - virtual BitField<FontStyle> font_get_style(const RID &p_font_rid) const override; + MODBIND2(font_set_style, const RID &, BitField<FontStyle>); + MODBIND1RC(BitField<FontStyle>, font_get_style, const RID &); - virtual void font_set_style_name(const RID &p_font_rid, const String &p_name) override; - virtual String font_get_style_name(const RID &p_font_rid) const override; + MODBIND2(font_set_style_name, const RID &, const String &); + MODBIND1RC(String, font_get_style_name, const RID &); - virtual void font_set_name(const RID &p_font_rid, const String &p_name) override; - virtual String font_get_name(const RID &p_font_rid) const override; + MODBIND2(font_set_name, const RID &, const String &); + MODBIND1RC(String, font_get_name, const RID &); - virtual void font_set_antialiasing(RID p_font_rid, TextServer::FontAntialiasing p_antialiasing) override; - virtual TextServer::FontAntialiasing font_get_antialiasing(RID p_font_rid) const override; + MODBIND2(font_set_antialiasing, const RID &, TextServer::FontAntialiasing); + MODBIND1RC(TextServer::FontAntialiasing, font_get_antialiasing, const RID &); - virtual void font_set_generate_mipmaps(const RID &p_font_rid, bool p_generate_mipmaps) override; - virtual bool font_get_generate_mipmaps(const RID &p_font_rid) const override; + MODBIND2(font_set_generate_mipmaps, const RID &, bool); + MODBIND1RC(bool, font_get_generate_mipmaps, const RID &); - virtual void font_set_multichannel_signed_distance_field(const RID &p_font_rid, bool p_msdf) override; - virtual bool font_is_multichannel_signed_distance_field(const RID &p_font_rid) const override; + MODBIND2(font_set_multichannel_signed_distance_field, const RID &, bool); + MODBIND1RC(bool, font_is_multichannel_signed_distance_field, const RID &); - virtual void font_set_msdf_pixel_range(const RID &p_font_rid, int64_t p_msdf_pixel_range) override; - virtual int64_t font_get_msdf_pixel_range(const RID &p_font_rid) const override; + MODBIND2(font_set_msdf_pixel_range, const RID &, int64_t); + MODBIND1RC(int64_t, font_get_msdf_pixel_range, const RID &); - virtual void font_set_msdf_size(const RID &p_font_rid, int64_t p_msdf_size) override; - virtual int64_t font_get_msdf_size(const RID &p_font_rid) const override; + MODBIND2(font_set_msdf_size, const RID &, int64_t); + MODBIND1RC(int64_t, font_get_msdf_size, const RID &); - virtual void font_set_fixed_size(const RID &p_font_rid, int64_t p_fixed_size) override; - virtual int64_t font_get_fixed_size(const RID &p_font_rid) const override; + MODBIND2(font_set_fixed_size, const RID &, int64_t); + MODBIND1RC(int64_t, font_get_fixed_size, const RID &); - virtual void font_set_force_autohinter(const RID &p_font_rid, bool p_force_autohinter) override; - virtual bool font_is_force_autohinter(const RID &p_font_rid) const override; + MODBIND2(font_set_force_autohinter, const RID &, bool); + MODBIND1RC(bool, font_is_force_autohinter, const RID &); - virtual void font_set_subpixel_positioning(const RID &p_font_rid, SubpixelPositioning p_subpixel) override; - virtual SubpixelPositioning font_get_subpixel_positioning(const RID &p_font_rid) const override; + MODBIND2(font_set_subpixel_positioning, const RID &, SubpixelPositioning); + MODBIND1RC(SubpixelPositioning, font_get_subpixel_positioning, const RID &); - virtual void font_set_embolden(const RID &p_font_rid, double p_strength) override; - virtual double font_get_embolden(const RID &p_font_rid) const override; + MODBIND2(font_set_embolden, const RID &, double); + MODBIND1RC(double, font_get_embolden, const RID &); - virtual void font_set_transform(const RID &p_font_rid, const Transform2D &p_transform) override; - virtual Transform2D font_get_transform(const RID &p_font_rid) const override; + MODBIND2(font_set_transform, const RID &, const Transform2D &); + MODBIND1RC(Transform2D, font_get_transform, const RID &); - virtual void font_set_variation_coordinates(const RID &p_font_rid, const Dictionary &p_variation_coordinates) override; - virtual Dictionary font_get_variation_coordinates(const RID &p_font_rid) const override; + MODBIND2(font_set_variation_coordinates, const RID &, const Dictionary &); + MODBIND1RC(Dictionary, font_get_variation_coordinates, const RID &); - virtual void font_set_hinting(const RID &p_font_rid, TextServer::Hinting p_hinting) override; - virtual TextServer::Hinting font_get_hinting(const RID &p_font_rid) const override; + MODBIND2(font_set_hinting, const RID &, TextServer::Hinting); + MODBIND1RC(TextServer::Hinting, font_get_hinting, const RID &); - virtual void font_set_oversampling(const RID &p_font_rid, double p_oversampling) override; - virtual double font_get_oversampling(const RID &p_font_rid) const override; + MODBIND2(font_set_oversampling, const RID &, double); + MODBIND1RC(double, font_get_oversampling, const RID &); - virtual TypedArray<Vector2i> font_get_size_cache_list(const RID &p_font_rid) const override; - virtual void font_clear_size_cache(const RID &p_font_rid) override; - virtual void font_remove_size_cache(const RID &p_font_rid, const Vector2i &p_size) override; + MODBIND1RC(TypedArray<Vector2i>, font_get_size_cache_list, const RID &); + MODBIND1(font_clear_size_cache, const RID &); + MODBIND2(font_remove_size_cache, const RID &, const Vector2i &); - virtual void font_set_ascent(const RID &p_font_rid, int64_t p_size, double p_ascent) override; - virtual double font_get_ascent(const RID &p_font_rid, int64_t p_size) const override; + MODBIND3(font_set_ascent, const RID &, int64_t, double); + MODBIND2RC(double, font_get_ascent, const RID &, int64_t); - virtual void font_set_descent(const RID &p_font_rid, int64_t p_size, double p_descent) override; - virtual double font_get_descent(const RID &p_font_rid, int64_t p_size) const override; + MODBIND3(font_set_descent, const RID &, int64_t, double); + MODBIND2RC(double, font_get_descent, const RID &, int64_t); - virtual void font_set_underline_position(const RID &p_font_rid, int64_t p_size, double p_underline_position) override; - virtual double font_get_underline_position(const RID &p_font_rid, int64_t p_size) const override; + MODBIND3(font_set_underline_position, const RID &, int64_t, double); + MODBIND2RC(double, font_get_underline_position, const RID &, int64_t); - virtual void font_set_underline_thickness(const RID &p_font_rid, int64_t p_size, double p_underline_thickness) override; - virtual double font_get_underline_thickness(const RID &p_font_rid, int64_t p_size) const override; + MODBIND3(font_set_underline_thickness, const RID &, int64_t, double); + MODBIND2RC(double, font_get_underline_thickness, const RID &, int64_t); - virtual void font_set_scale(const RID &p_font_rid, int64_t p_size, double p_scale) override; - virtual double font_get_scale(const RID &p_font_rid, int64_t p_size) const override; + MODBIND3(font_set_scale, const RID &, int64_t, double); + MODBIND2RC(double, font_get_scale, const RID &, int64_t); - virtual int64_t font_get_texture_count(const RID &p_font_rid, const Vector2i &p_size) const override; - virtual void font_clear_textures(const RID &p_font_rid, const Vector2i &p_size) override; - virtual void font_remove_texture(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) override; + MODBIND2RC(int64_t, font_get_texture_count, const RID &, const Vector2i &); + MODBIND2(font_clear_textures, const RID &, const Vector2i &); + MODBIND3(font_remove_texture, const RID &, const Vector2i &, int64_t); - virtual void font_set_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const Ref<Image> &p_image) override; - virtual Ref<Image> font_get_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const override; + MODBIND4(font_set_texture_image, const RID &, const Vector2i &, int64_t, const Ref<Image> &); + MODBIND3RC(Ref<Image>, font_get_texture_image, const RID &, const Vector2i &, int64_t); - virtual void font_set_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const PackedInt32Array &p_offset) override; - virtual PackedInt32Array font_get_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const override; + MODBIND4(font_set_texture_offsets, const RID &, const Vector2i &, int64_t, const PackedInt32Array &); + MODBIND3RC(PackedInt32Array, font_get_texture_offsets, const RID &, const Vector2i &, int64_t); - virtual PackedInt32Array font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const override; - virtual void font_clear_glyphs(const RID &p_font_rid, const Vector2i &p_size) override; - virtual void font_remove_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) override; + MODBIND2RC(PackedInt32Array, font_get_glyph_list, const RID &, const Vector2i &); + MODBIND2(font_clear_glyphs, const RID &, const Vector2i &); + MODBIND3(font_remove_glyph, const RID &, const Vector2i &, int64_t); - virtual Vector2 font_get_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph) const override; - virtual void font_set_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph, const Vector2 &p_advance) override; + MODBIND3RC(Vector2, font_get_glyph_advance, const RID &, int64_t, int64_t); + MODBIND4(font_set_glyph_advance, const RID &, int64_t, int64_t, const Vector2 &); - virtual Vector2 font_get_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; - virtual void font_set_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_offset) override; + MODBIND3RC(Vector2, font_get_glyph_offset, const RID &, const Vector2i &, int64_t); + MODBIND4(font_set_glyph_offset, const RID &, const Vector2i &, int64_t, const Vector2 &); - virtual Vector2 font_get_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; - virtual void font_set_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_gl_size) override; + MODBIND3RC(Vector2, font_get_glyph_size, const RID &, const Vector2i &, int64_t); + MODBIND4(font_set_glyph_size, const RID &, const Vector2i &, int64_t, const Vector2 &); - virtual Rect2 font_get_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; - virtual void font_set_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Rect2 &p_uv_rect) override; + MODBIND3RC(Rect2, font_get_glyph_uv_rect, const RID &, const Vector2i &, int64_t); + MODBIND4(font_set_glyph_uv_rect, const RID &, const Vector2i &, int64_t, const Rect2 &); - virtual int64_t font_get_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; - virtual void font_set_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, int64_t p_texture_idx) override; + MODBIND3RC(int64_t, font_get_glyph_texture_idx, const RID &, const Vector2i &, int64_t); + MODBIND4(font_set_glyph_texture_idx, const RID &, const Vector2i &, int64_t, int64_t); - virtual RID font_get_glyph_texture_rid(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; - virtual Size2 font_get_glyph_texture_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; + MODBIND3RC(RID, font_get_glyph_texture_rid, const RID &, const Vector2i &, int64_t); + MODBIND3RC(Size2, font_get_glyph_texture_size, const RID &, const Vector2i &, int64_t); - virtual Dictionary font_get_glyph_contours(const RID &p_font, int64_t p_size, int64_t p_index) const override; + MODBIND3RC(Dictionary, font_get_glyph_contours, const RID &, int64_t, int64_t); - virtual TypedArray<Vector2i> font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const override; - virtual void font_clear_kerning_map(const RID &p_font_rid, int64_t p_size) override; - virtual void font_remove_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) override; + MODBIND2RC(TypedArray<Vector2i>, font_get_kerning_list, const RID &, int64_t); + MODBIND2(font_clear_kerning_map, const RID &, int64_t); + MODBIND3(font_remove_kerning, const RID &, int64_t, const Vector2i &); - virtual void font_set_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair, const Vector2 &p_kerning) override; - virtual Vector2 font_get_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) const override; + MODBIND4(font_set_kerning, const RID &, int64_t, const Vector2i &, const Vector2 &); + MODBIND3RC(Vector2, font_get_kerning, const RID &, int64_t, const Vector2i &); - virtual int64_t font_get_glyph_index(const RID &p_font_rid, int64_t p_size, int64_t p_char, int64_t p_variation_selector = 0) const override; + MODBIND4RC(int64_t, font_get_glyph_index, const RID &, int64_t, int64_t, int64_t); - virtual bool font_has_char(const RID &p_font_rid, int64_t p_char) const override; - virtual String font_get_supported_chars(const RID &p_font_rid) const override; + MODBIND2RC(bool, font_has_char, const RID &, int64_t); + MODBIND1RC(String, font_get_supported_chars, const RID &); - virtual void font_render_range(const RID &p_font, const Vector2i &p_size, int64_t p_start, int64_t p_end) override; - virtual void font_render_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_index) override; + MODBIND4(font_render_range, const RID &, const Vector2i &, int64_t, int64_t); + MODBIND3(font_render_glyph, const RID &, const Vector2i &, int64_t); - virtual void font_draw_glyph(const RID &p_font, const RID &p_canvas, int64_t p_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color = Color(1, 1, 1)) const override; - virtual void font_draw_glyph_outline(const RID &p_font, 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 = Color(1, 1, 1)) const override; + MODBIND6C(font_draw_glyph, const RID &, const RID &, int64_t, const Vector2 &, int64_t, const Color &); + MODBIND7C(font_draw_glyph_outline, const RID &, const RID &, int64_t, int64_t, const Vector2 &, int64_t, const Color &); - virtual bool font_is_language_supported(const RID &p_font_rid, const String &p_language) const override; - virtual void font_set_language_support_override(const RID &p_font_rid, const String &p_language, bool p_supported) override; - virtual bool font_get_language_support_override(const RID &p_font_rid, const String &p_language) override; - virtual void font_remove_language_support_override(const RID &p_font_rid, const String &p_language) override; - virtual PackedStringArray font_get_language_support_overrides(const RID &p_font_rid) override; + MODBIND2RC(bool, font_is_language_supported, const RID &, const String &); + MODBIND3(font_set_language_support_override, const RID &, const String &, bool); + MODBIND2R(bool, font_get_language_support_override, const RID &, const String &); + MODBIND2(font_remove_language_support_override, const RID &, const String &); + MODBIND1R(PackedStringArray, font_get_language_support_overrides, const RID &); - virtual bool font_is_script_supported(const RID &p_font_rid, const String &p_script) const override; - virtual void font_set_script_support_override(const RID &p_font_rid, const String &p_script, bool p_supported) override; - virtual bool font_get_script_support_override(const RID &p_font_rid, const String &p_script) override; - virtual void font_remove_script_support_override(const RID &p_font_rid, const String &p_script) override; - virtual PackedStringArray font_get_script_support_overrides(const RID &p_font_rid) override; + MODBIND2RC(bool, font_is_script_supported, const RID &, const String &); + MODBIND3(font_set_script_support_override, const RID &, const String &, bool); + MODBIND2R(bool, font_get_script_support_override, const RID &, const String &); + MODBIND2(font_remove_script_support_override, const RID &, const String &); + MODBIND1R(PackedStringArray, font_get_script_support_overrides, const RID &); - virtual void font_set_opentype_feature_overrides(const RID &p_font_rid, const Dictionary &p_overrides) override; - virtual Dictionary font_get_opentype_feature_overrides(const RID &p_font_rid) const override; + MODBIND2(font_set_opentype_feature_overrides, const RID &, const Dictionary &); + MODBIND1RC(Dictionary, font_get_opentype_feature_overrides, const RID &); - virtual Dictionary font_supported_feature_list(const RID &p_font_rid) const override; - virtual Dictionary font_supported_variation_list(const RID &p_font_rid) const override; + MODBIND1RC(Dictionary, font_supported_feature_list, const RID &); + MODBIND1RC(Dictionary, font_supported_variation_list, const RID &); - virtual double font_get_global_oversampling() const override; - virtual void font_set_global_oversampling(double p_oversampling) override; + MODBIND0RC(double, font_get_global_oversampling); + MODBIND1(font_set_global_oversampling, double); /* Shaped text buffer interface */ - virtual RID create_shaped_text(Direction p_direction = DIRECTION_AUTO, Orientation p_orientation = ORIENTATION_HORIZONTAL) override; + MODBIND2R(RID, create_shaped_text, Direction, Orientation); - virtual void shaped_text_clear(const RID &p_shaped) override; + MODBIND1(shaped_text_clear, const RID &); - virtual void shaped_text_set_direction(const RID &p_shaped, Direction p_direction = DIRECTION_AUTO) override; - virtual Direction shaped_text_get_direction(const RID &p_shaped) const override; - virtual Direction shaped_text_get_inferred_direction(const RID &p_shaped) const override; + MODBIND2(shaped_text_set_direction, const RID &, Direction); + MODBIND1RC(Direction, shaped_text_get_direction, const RID &); + MODBIND1RC(Direction, shaped_text_get_inferred_direction, const RID &); - virtual void shaped_text_set_bidi_override(const RID &p_shaped, const Array &p_override) override; + MODBIND2(shaped_text_set_bidi_override, const RID &, const Array &); - virtual void shaped_text_set_custom_punctuation(const RID &p_shaped, const String &p_punct) override; - virtual String shaped_text_get_custom_punctuation(const RID &p_shaped) const override; + MODBIND2(shaped_text_set_custom_punctuation, const RID &, const String &); + MODBIND1RC(String, shaped_text_get_custom_punctuation, const RID &); - virtual void shaped_text_set_orientation(const RID &p_shaped, Orientation p_orientation = ORIENTATION_HORIZONTAL) override; - virtual Orientation shaped_text_get_orientation(const RID &p_shaped) const override; + MODBIND2(shaped_text_set_orientation, const RID &, Orientation); + MODBIND1RC(Orientation, shaped_text_get_orientation, const RID &); - virtual void shaped_text_set_preserve_invalid(const RID &p_shaped, bool p_enabled) override; - virtual bool shaped_text_get_preserve_invalid(const RID &p_shaped) const override; + MODBIND2(shaped_text_set_preserve_invalid, const RID &, bool); + MODBIND1RC(bool, shaped_text_get_preserve_invalid, const RID &); - virtual void shaped_text_set_preserve_control(const RID &p_shaped, bool p_enabled) override; - virtual bool shaped_text_get_preserve_control(const RID &p_shaped) const override; + MODBIND2(shaped_text_set_preserve_control, const RID &, bool); + MODBIND1RC(bool, shaped_text_get_preserve_control, const RID &); - virtual void shaped_text_set_spacing(const RID &p_shaped, SpacingType p_spacing, int64_t p_value) override; - virtual int64_t shaped_text_get_spacing(const RID &p_shaped, SpacingType p_spacing) const override; + MODBIND3(shaped_text_set_spacing, const RID &, SpacingType, int64_t); + MODBIND2RC(int64_t, shaped_text_get_spacing, const RID &, SpacingType); - virtual bool 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 = Dictionary(), const String &p_language = "", const Variant &p_meta = Variant()) override; - virtual bool shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, int64_t p_length = 1) override; - virtual bool shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER) override; + MODBIND7R(bool, shaped_text_add_string, const RID &, const String &, const TypedArray<RID> &, int64_t, const Dictionary &, const String &, const Variant &); + MODBIND5R(bool, shaped_text_add_object, const RID &, const Variant &, const Size2 &, InlineAlignment, int64_t); + MODBIND4R(bool, shaped_text_resize_object, const RID &, const Variant &, const Size2 &, InlineAlignment); - virtual int64_t shaped_get_span_count(const RID &p_shaped) const override; - virtual Variant shaped_get_span_meta(const RID &p_shaped, int64_t p_index) const override; - virtual void 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 = Dictionary()) override; + MODBIND1RC(int64_t, shaped_get_span_count, const RID &); + MODBIND2RC(Variant, shaped_get_span_meta, const RID &, int64_t); + MODBIND5(shaped_set_span_update_font, const RID &, int64_t, const TypedArray<RID> &, int64_t, const Dictionary &); - virtual RID shaped_text_substr(const RID &p_shaped, int64_t p_start, int64_t p_length) const override; - virtual RID shaped_text_get_parent(const RID &p_shaped) const override; + MODBIND3RC(RID, shaped_text_substr, const RID &, int64_t, int64_t); + MODBIND1RC(RID, shaped_text_get_parent, const RID &); - virtual double shaped_text_fit_to_width(const RID &p_shaped, double p_width, BitField<TextServer::JustificationFlag> p_jst_flags = JUSTIFICATION_WORD_BOUND | JUSTIFICATION_KASHIDA) override; - virtual double shaped_text_tab_align(const RID &p_shaped, const PackedFloat32Array &p_tab_stops) override; + MODBIND3R(double, shaped_text_fit_to_width, const RID &, double, BitField<TextServer::JustificationFlag>); + MODBIND2R(double, shaped_text_tab_align, const RID &, const PackedFloat32Array &); - virtual bool shaped_text_shape(const RID &p_shaped) override; - virtual bool shaped_text_update_breaks(const RID &p_shaped) override; - virtual bool shaped_text_update_justification_ops(const RID &p_shaped) override; + MODBIND1R(bool, shaped_text_shape, const RID &); + MODBIND1R(bool, shaped_text_update_breaks, const RID &); + MODBIND1R(bool, shaped_text_update_justification_ops, const RID &); - virtual int64_t shaped_text_get_trim_pos(const RID &p_shaped) const override; - virtual int64_t shaped_text_get_ellipsis_pos(const RID &p_shaped) const override; - virtual const Glyph *shaped_text_get_ellipsis_glyphs(const RID &p_shaped) const override; - virtual int64_t shaped_text_get_ellipsis_glyph_count(const RID &p_shaped) const override; + MODBIND1RC(int64_t, shaped_text_get_trim_pos, const RID &); + MODBIND1RC(int64_t, shaped_text_get_ellipsis_pos, const RID &); + MODBIND1RC(const Glyph *, shaped_text_get_ellipsis_glyphs, const RID &); + MODBIND1RC(int64_t, shaped_text_get_ellipsis_glyph_count, const RID &); - virtual void shaped_text_overrun_trim_to_width(const RID &p_shaped, double p_width, BitField<TextServer::TextOverrunFlag> p_trim_flags) override; + MODBIND3(shaped_text_overrun_trim_to_width, const RID &, double, BitField<TextServer::TextOverrunFlag>); - virtual bool shaped_text_is_ready(const RID &p_shaped) const override; + MODBIND1RC(bool, shaped_text_is_ready, const RID &); - virtual const Glyph *shaped_text_get_glyphs(const RID &p_shaped) const override; - virtual const Glyph *shaped_text_sort_logical(const RID &p_shaped) override; - virtual int64_t shaped_text_get_glyph_count(const RID &p_shaped) const override; + MODBIND1RC(const Glyph *, shaped_text_get_glyphs, const RID &); + MODBIND1R(const Glyph *, shaped_text_sort_logical, const RID &); + MODBIND1RC(int64_t, shaped_text_get_glyph_count, const RID &); - virtual Vector2i shaped_text_get_range(const RID &p_shaped) const override; + MODBIND1RC(Vector2i, shaped_text_get_range, const RID &); - virtual Array shaped_text_get_objects(const RID &p_shaped) const override; - virtual Rect2 shaped_text_get_object_rect(const RID &p_shaped, const Variant &p_key) const override; + MODBIND1RC(Array, shaped_text_get_objects, const RID &); + MODBIND2RC(Rect2, shaped_text_get_object_rect, const RID &, const Variant &); - virtual Size2 shaped_text_get_size(const RID &p_shaped) const override; - virtual double shaped_text_get_ascent(const RID &p_shaped) const override; - virtual double shaped_text_get_descent(const RID &p_shaped) const override; - virtual double shaped_text_get_width(const RID &p_shaped) const override; - virtual double shaped_text_get_underline_position(const RID &p_shaped) const override; - virtual double shaped_text_get_underline_thickness(const RID &p_shaped) const override; + MODBIND1RC(Size2, shaped_text_get_size, const RID &); + MODBIND1RC(double, shaped_text_get_ascent, const RID &); + MODBIND1RC(double, shaped_text_get_descent, const RID &); + MODBIND1RC(double, shaped_text_get_width, const RID &); + MODBIND1RC(double, shaped_text_get_underline_position, const RID &); + MODBIND1RC(double, shaped_text_get_underline_thickness, const RID &); - virtual String format_number(const String &p_string, const String &p_language = "") const override; - virtual String parse_number(const String &p_string, const String &p_language = "") const override; - virtual String percent_sign(const String &p_language = "") const override; + MODBIND2RC(String, format_number, const String &, const String &); + MODBIND2RC(String, parse_number, const String &, const String &); + MODBIND1RC(String, percent_sign, const String &); - virtual PackedInt32Array string_get_word_breaks(const String &p_string, const String &p_language = "") const override; + MODBIND2RC(PackedInt32Array, string_get_word_breaks, const String &, const String &); - virtual int64_t is_confusable(const String &p_string, const PackedStringArray &p_dict) const override; - virtual bool spoof_check(const String &p_string) const override; + MODBIND2RC(int64_t, is_confusable, const String &, const PackedStringArray &); + MODBIND1RC(bool, spoof_check, const String &); - virtual String strip_diacritics(const String &p_string) const override; - virtual bool is_valid_identifier(const String &p_string) const override; + MODBIND1RC(String, strip_diacritics, const String &); + MODBIND1RC(bool, is_valid_identifier, const String &); - virtual String string_to_upper(const String &p_string, const String &p_language = "") const override; - virtual String string_to_lower(const String &p_string, const String &p_language = "") const override; + MODBIND2RC(String, string_to_upper, const String &, const String &); + MODBIND2RC(String, string_to_lower, const String &, const String &); TextServerAdvanced(); ~TextServerAdvanced(); diff --git a/modules/text_server_fb/text_server_fb.cpp b/modules/text_server_fb/text_server_fb.cpp index eaa932620e..518c877baa 100644 --- a/modules/text_server_fb/text_server_fb.cpp +++ b/modules/text_server_fb/text_server_fb.cpp @@ -33,7 +33,7 @@ #ifdef GDEXTENSION // Headers for building as GDExtension plug-in. -#include <godot_cpp/classes/file.hpp> +#include <godot_cpp/classes/file_access.hpp> #include <godot_cpp/classes/project_settings.hpp> #include <godot_cpp/classes/rendering_server.hpp> #include <godot_cpp/classes/translation_server.hpp> @@ -66,7 +66,7 @@ using namespace godot; #define OT_TAG(c1, c2, c3, c4) ((int32_t)((((uint32_t)(c1)&0xff) << 24) | (((uint32_t)(c2)&0xff) << 16) | (((uint32_t)(c3)&0xff) << 8) | ((uint32_t)(c4)&0xff))) -bool TextServerFallback::has_feature(Feature p_feature) const { +bool TextServerFallback::_has_feature(Feature p_feature) const { switch (p_feature) { case FEATURE_SIMPLE_LAYOUT: case FEATURE_FONT_BITMAP: @@ -83,7 +83,7 @@ bool TextServerFallback::has_feature(Feature p_feature) const { return false; } -String TextServerFallback::get_name() const { +String TextServerFallback::_get_name() const { #ifdef GDEXTENSION return "Fallback (GDExtension)"; #else @@ -91,7 +91,7 @@ String TextServerFallback::get_name() const { #endif } -int64_t TextServerFallback::get_features() const { +int64_t TextServerFallback::_get_features() const { int64_t interface_features = FEATURE_SIMPLE_LAYOUT | FEATURE_FONT_BITMAP; #ifdef MODULE_FREETYPE_ENABLED interface_features |= FEATURE_FONT_DYNAMIC; @@ -103,7 +103,7 @@ int64_t TextServerFallback::get_features() const { return interface_features; } -void TextServerFallback::free_rid(const RID &p_rid) { +void TextServerFallback::_free_rid(const RID &p_rid) { _THREAD_SAFE_METHOD_ if (font_owner.owns(p_rid)) { FontFallback *fd = font_owner.get_or_null(p_rid); @@ -116,20 +116,28 @@ void TextServerFallback::free_rid(const RID &p_rid) { } } -bool TextServerFallback::has(const RID &p_rid) { +bool TextServerFallback::_has(const RID &p_rid) { _THREAD_SAFE_METHOD_ return font_owner.owns(p_rid) || shaped_owner.owns(p_rid); } -bool TextServerFallback::load_support_data(const String &p_filename) { +String TextServerFallback::_get_support_data_filename() const { + return ""; +}; + +String TextServerFallback::_get_support_data_info() const { + return "Not supported"; +}; + +bool TextServerFallback::_load_support_data(const String &p_filename) { return false; // No extra data used. } -bool TextServerFallback::save_support_data(const String &p_filename) const { +bool TextServerFallback::_save_support_data(const String &p_filename) const { return false; // No extra data used. } -bool TextServerFallback::is_locale_right_to_left(const String &p_locale) const { +bool TextServerFallback::_is_locale_right_to_left(const String &p_locale) const { return false; // No RTL support. } @@ -169,7 +177,7 @@ _FORCE_INLINE_ int32_t ot_tag_from_string(const char *p_str, int p_len) { return OT_TAG(tag[0], tag[1], tag[2], tag[3]); } -int64_t TextServerFallback::name_to_tag(const String &p_name) const { +int64_t TextServerFallback::_name_to_tag(const String &p_name) const { if (feature_sets.has(p_name)) { return feature_sets[p_name]; } @@ -185,7 +193,7 @@ _FORCE_INLINE_ void ot_tag_to_string(int32_t p_tag, char *p_buf) { p_buf[3] = (char)(uint8_t)(p_tag >> 0); } -String TextServerFallback::tag_to_name(int64_t p_tag) const { +String TextServerFallback::_tag_to_name(int64_t p_tag) const { if (feature_sets_inv.has(p_tag)) { return feature_sets_inv[p_tag]; } @@ -467,8 +475,14 @@ _FORCE_INLINE_ TextServerFallback::FontGlyph TextServerFallback::rasterize_msdf( td.projection = &projection; td.distancePixelConversion = &distancePixelConversion; +#ifdef GDEXTENSION + for (int i = 0; i < h; i++) { + _generateMTSDF_threaded(i, &td); + } +#else WorkerThreadPool::GroupID group_id = WorkerThreadPool::get_singleton()->add_template_group_task(this, &TextServerFallback::_generateMTSDF_threaded, &td, h, -1, true, SNAME("TextServerFBRenderMSDF")); WorkerThreadPool::get_singleton()->wait_for_group_task_completion(group_id); +#endif msdfgen::msdfErrorCorrection(image, shape, projection, p_pixel_range, config); @@ -840,7 +854,7 @@ _FORCE_INLINE_ bool TextServerFallback::_ensure_cache_for_size(FontFallback *p_f fd->oversampling = 1.0; fd->size.x = p_font_data->msdf_source_size; } else if (p_font_data->oversampling <= 0.0) { - fd->oversampling = font_get_global_oversampling(); + fd->oversampling = _font_get_global_oversampling(); } else { fd->oversampling = p_font_data->oversampling; } @@ -921,8 +935,8 @@ _FORCE_INLINE_ bool TextServerFallback::_ensure_cache_for_size(FontFallback *p_f coords.write[i] = CLAMP(var_value * 65536.0, amaster->axis[i].minimum, amaster->axis[i].maximum); } - if (p_font_data->variation_coordinates.has(tag_to_name(var_tag))) { - var_value = p_font_data->variation_coordinates[tag_to_name(var_tag)]; + if (p_font_data->variation_coordinates.has(_tag_to_name(var_tag))) { + var_value = p_font_data->variation_coordinates[_tag_to_name(var_tag)]; coords.write[i] = CLAMP(var_value * 65536.0, amaster->axis[i].minimum, amaster->axis[i].maximum); } } @@ -948,7 +962,7 @@ _FORCE_INLINE_ void TextServerFallback::_font_clear_cache(FontFallback *p_font_d p_font_data->supported_varaitions.clear(); } -RID TextServerFallback::create_font() { +RID TextServerFallback::_create_font() { _THREAD_SAFE_METHOD_ FontFallback *fd = memnew(FontFallback); @@ -956,7 +970,7 @@ RID TextServerFallback::create_font() { return font_owner.make_rid(fd); } -void TextServerFallback::font_set_data(const RID &p_font_rid, const PackedByteArray &p_data) { +void TextServerFallback::_font_set_data(const RID &p_font_rid, const PackedByteArray &p_data) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -967,7 +981,7 @@ void TextServerFallback::font_set_data(const RID &p_font_rid, const PackedByteAr fd->data_size = fd->data.size(); } -void TextServerFallback::font_set_data_ptr(const RID &p_font_rid, const uint8_t *p_data_ptr, int64_t p_data_size) { +void TextServerFallback::_font_set_data_ptr(const RID &p_font_rid, const uint8_t *p_data_ptr, int64_t p_data_size) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -978,7 +992,7 @@ void TextServerFallback::font_set_data_ptr(const RID &p_font_rid, const uint8_t fd->data_size = p_data_size; } -void TextServerFallback::font_set_style(const RID &p_font_rid, BitField<FontStyle> p_style) { +void TextServerFallback::_font_set_style(const RID &p_font_rid, BitField<FontStyle> p_style) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -988,7 +1002,7 @@ void TextServerFallback::font_set_style(const RID &p_font_rid, BitField<FontStyl fd->style_flags = p_style; } -void TextServerFallback::font_set_face_index(const RID &p_font_rid, int64_t p_face_index) { +void TextServerFallback::_font_set_face_index(const RID &p_font_rid, int64_t p_face_index) { ERR_FAIL_COND(p_face_index < 0); ERR_FAIL_COND(p_face_index >= 0x7FFF); @@ -1002,7 +1016,7 @@ void TextServerFallback::font_set_face_index(const RID &p_font_rid, int64_t p_fa } } -int64_t TextServerFallback::font_get_face_index(const RID &p_font_rid) const { +int64_t TextServerFallback::_font_get_face_index(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); @@ -1010,7 +1024,7 @@ int64_t TextServerFallback::font_get_face_index(const RID &p_font_rid) const { return fd->face_index; } -int64_t TextServerFallback::font_get_face_count(const RID &p_font_rid) const { +int64_t TextServerFallback::_font_get_face_count(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); @@ -1051,7 +1065,7 @@ int64_t TextServerFallback::font_get_face_count(const RID &p_font_rid) const { return face_count; } -BitField<TextServer::FontStyle> TextServerFallback::font_get_style(const RID &p_font_rid) const { +BitField<TextServer::FontStyle> TextServerFallback::_font_get_style(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); @@ -1061,7 +1075,7 @@ BitField<TextServer::FontStyle> TextServerFallback::font_get_style(const RID &p_ return fd->style_flags; } -void TextServerFallback::font_set_style_name(const RID &p_font_rid, const String &p_name) { +void TextServerFallback::_font_set_style_name(const RID &p_font_rid, const String &p_name) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1071,7 +1085,7 @@ void TextServerFallback::font_set_style_name(const RID &p_font_rid, const String fd->style_name = p_name; } -String TextServerFallback::font_get_style_name(const RID &p_font_rid) const { +String TextServerFallback::_font_get_style_name(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, String()); @@ -1081,7 +1095,7 @@ String TextServerFallback::font_get_style_name(const RID &p_font_rid) const { return fd->style_name; } -void TextServerFallback::font_set_name(const RID &p_font_rid, const String &p_name) { +void TextServerFallback::_font_set_name(const RID &p_font_rid, const String &p_name) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1091,7 +1105,7 @@ void TextServerFallback::font_set_name(const RID &p_font_rid, const String &p_na fd->font_name = p_name; } -String TextServerFallback::font_get_name(const RID &p_font_rid) const { +String TextServerFallback::_font_get_name(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, String()); @@ -1101,7 +1115,7 @@ String TextServerFallback::font_get_name(const RID &p_font_rid) const { return fd->font_name; } -void TextServerFallback::font_set_antialiasing(RID p_font_rid, TextServer::FontAntialiasing p_antialiasing) { +void TextServerFallback::_font_set_antialiasing(const RID &p_font_rid, TextServer::FontAntialiasing p_antialiasing) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1112,7 +1126,7 @@ void TextServerFallback::font_set_antialiasing(RID p_font_rid, TextServer::FontA } } -TextServer::FontAntialiasing TextServerFallback::font_get_antialiasing(RID p_font_rid) const { +TextServer::FontAntialiasing TextServerFallback::_font_get_antialiasing(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, TextServer::FONT_ANTIALIASING_NONE); @@ -1120,7 +1134,7 @@ TextServer::FontAntialiasing TextServerFallback::font_get_antialiasing(RID p_fon return fd->antialiasing; } -void TextServerFallback::font_set_generate_mipmaps(const RID &p_font_rid, bool p_generate_mipmaps) { +void TextServerFallback::_font_set_generate_mipmaps(const RID &p_font_rid, bool p_generate_mipmaps) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1136,7 +1150,7 @@ void TextServerFallback::font_set_generate_mipmaps(const RID &p_font_rid, bool p } } -bool TextServerFallback::font_get_generate_mipmaps(const RID &p_font_rid) const { +bool TextServerFallback::_font_get_generate_mipmaps(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); @@ -1144,7 +1158,7 @@ bool TextServerFallback::font_get_generate_mipmaps(const RID &p_font_rid) const return fd->mipmaps; } -void TextServerFallback::font_set_multichannel_signed_distance_field(const RID &p_font_rid, bool p_msdf) { +void TextServerFallback::_font_set_multichannel_signed_distance_field(const RID &p_font_rid, bool p_msdf) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1155,7 +1169,7 @@ void TextServerFallback::font_set_multichannel_signed_distance_field(const RID & } } -bool TextServerFallback::font_is_multichannel_signed_distance_field(const RID &p_font_rid) const { +bool TextServerFallback::_font_is_multichannel_signed_distance_field(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); @@ -1163,7 +1177,7 @@ bool TextServerFallback::font_is_multichannel_signed_distance_field(const RID &p return fd->msdf; } -void TextServerFallback::font_set_msdf_pixel_range(const RID &p_font_rid, int64_t p_msdf_pixel_range) { +void TextServerFallback::_font_set_msdf_pixel_range(const RID &p_font_rid, int64_t p_msdf_pixel_range) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1174,7 +1188,7 @@ void TextServerFallback::font_set_msdf_pixel_range(const RID &p_font_rid, int64_ } } -int64_t TextServerFallback::font_get_msdf_pixel_range(const RID &p_font_rid) const { +int64_t TextServerFallback::_font_get_msdf_pixel_range(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); @@ -1182,7 +1196,7 @@ int64_t TextServerFallback::font_get_msdf_pixel_range(const RID &p_font_rid) con return fd->msdf_range; } -void TextServerFallback::font_set_msdf_size(const RID &p_font_rid, int64_t p_msdf_size) { +void TextServerFallback::_font_set_msdf_size(const RID &p_font_rid, int64_t p_msdf_size) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1193,7 +1207,7 @@ void TextServerFallback::font_set_msdf_size(const RID &p_font_rid, int64_t p_msd } } -int64_t TextServerFallback::font_get_msdf_size(const RID &p_font_rid) const { +int64_t TextServerFallback::_font_get_msdf_size(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); @@ -1201,7 +1215,7 @@ int64_t TextServerFallback::font_get_msdf_size(const RID &p_font_rid) const { return fd->msdf_source_size; } -void TextServerFallback::font_set_fixed_size(const RID &p_font_rid, int64_t p_fixed_size) { +void TextServerFallback::_font_set_fixed_size(const RID &p_font_rid, int64_t p_fixed_size) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1209,7 +1223,7 @@ void TextServerFallback::font_set_fixed_size(const RID &p_font_rid, int64_t p_fi fd->fixed_size = p_fixed_size; } -int64_t TextServerFallback::font_get_fixed_size(const RID &p_font_rid) const { +int64_t TextServerFallback::_font_get_fixed_size(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); @@ -1217,7 +1231,7 @@ int64_t TextServerFallback::font_get_fixed_size(const RID &p_font_rid) const { return fd->fixed_size; } -void TextServerFallback::font_set_force_autohinter(const RID &p_font_rid, bool p_force_autohinter) { +void TextServerFallback::_font_set_force_autohinter(const RID &p_font_rid, bool p_force_autohinter) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1228,7 +1242,7 @@ void TextServerFallback::font_set_force_autohinter(const RID &p_font_rid, bool p } } -bool TextServerFallback::font_is_force_autohinter(const RID &p_font_rid) const { +bool TextServerFallback::_font_is_force_autohinter(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); @@ -1236,7 +1250,7 @@ bool TextServerFallback::font_is_force_autohinter(const RID &p_font_rid) const { return fd->force_autohinter; } -void TextServerFallback::font_set_hinting(const RID &p_font_rid, TextServer::Hinting p_hinting) { +void TextServerFallback::_font_set_hinting(const RID &p_font_rid, TextServer::Hinting p_hinting) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1247,7 +1261,7 @@ void TextServerFallback::font_set_hinting(const RID &p_font_rid, TextServer::Hin } } -TextServer::Hinting TextServerFallback::font_get_hinting(const RID &p_font_rid) const { +TextServer::Hinting TextServerFallback::_font_get_hinting(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, HINTING_NONE); @@ -1255,7 +1269,7 @@ TextServer::Hinting TextServerFallback::font_get_hinting(const RID &p_font_rid) return fd->hinting; } -void TextServerFallback::font_set_subpixel_positioning(const RID &p_font_rid, TextServer::SubpixelPositioning p_subpixel) { +void TextServerFallback::_font_set_subpixel_positioning(const RID &p_font_rid, TextServer::SubpixelPositioning p_subpixel) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1263,7 +1277,7 @@ void TextServerFallback::font_set_subpixel_positioning(const RID &p_font_rid, Te fd->subpixel_positioning = p_subpixel; } -TextServer::SubpixelPositioning TextServerFallback::font_get_subpixel_positioning(const RID &p_font_rid) const { +TextServer::SubpixelPositioning TextServerFallback::_font_get_subpixel_positioning(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, SUBPIXEL_POSITIONING_DISABLED); @@ -1271,7 +1285,7 @@ TextServer::SubpixelPositioning TextServerFallback::font_get_subpixel_positionin return fd->subpixel_positioning; } -void TextServerFallback::font_set_embolden(const RID &p_font_rid, double p_strength) { +void TextServerFallback::_font_set_embolden(const RID &p_font_rid, double p_strength) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1282,7 +1296,7 @@ void TextServerFallback::font_set_embolden(const RID &p_font_rid, double p_stren } } -double TextServerFallback::font_get_embolden(const RID &p_font_rid) const { +double TextServerFallback::_font_get_embolden(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); @@ -1290,7 +1304,7 @@ double TextServerFallback::font_get_embolden(const RID &p_font_rid) const { return fd->embolden; } -void TextServerFallback::font_set_transform(const RID &p_font_rid, const Transform2D &p_transform) { +void TextServerFallback::_font_set_transform(const RID &p_font_rid, const Transform2D &p_transform) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1301,7 +1315,7 @@ void TextServerFallback::font_set_transform(const RID &p_font_rid, const Transfo } } -Transform2D TextServerFallback::font_get_transform(const RID &p_font_rid) const { +Transform2D TextServerFallback::_font_get_transform(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Transform2D()); @@ -1309,7 +1323,7 @@ Transform2D TextServerFallback::font_get_transform(const RID &p_font_rid) const return fd->transform; } -void TextServerFallback::font_set_variation_coordinates(const RID &p_font_rid, const Dictionary &p_variation_coordinates) { +void TextServerFallback::_font_set_variation_coordinates(const RID &p_font_rid, const Dictionary &p_variation_coordinates) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1320,7 +1334,7 @@ void TextServerFallback::font_set_variation_coordinates(const RID &p_font_rid, c } } -Dictionary TextServerFallback::font_get_variation_coordinates(const RID &p_font_rid) const { +Dictionary TextServerFallback::_font_get_variation_coordinates(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); @@ -1328,7 +1342,7 @@ Dictionary TextServerFallback::font_get_variation_coordinates(const RID &p_font_ return fd->variation_coordinates; } -void TextServerFallback::font_set_oversampling(const RID &p_font_rid, double p_oversampling) { +void TextServerFallback::_font_set_oversampling(const RID &p_font_rid, double p_oversampling) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1339,7 +1353,7 @@ void TextServerFallback::font_set_oversampling(const RID &p_font_rid, double p_o } } -double TextServerFallback::font_get_oversampling(const RID &p_font_rid) const { +double TextServerFallback::_font_get_oversampling(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); @@ -1347,7 +1361,7 @@ double TextServerFallback::font_get_oversampling(const RID &p_font_rid) const { return fd->oversampling; } -TypedArray<Vector2i> TextServerFallback::font_get_size_cache_list(const RID &p_font_rid) const { +TypedArray<Vector2i> TextServerFallback::_font_get_size_cache_list(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, TypedArray<Vector2i>()); @@ -1359,7 +1373,7 @@ TypedArray<Vector2i> TextServerFallback::font_get_size_cache_list(const RID &p_f return ret; } -void TextServerFallback::font_clear_size_cache(const RID &p_font_rid) { +void TextServerFallback::_font_clear_size_cache(const RID &p_font_rid) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1370,7 +1384,7 @@ void TextServerFallback::font_clear_size_cache(const RID &p_font_rid) { fd->cache.clear(); } -void TextServerFallback::font_remove_size_cache(const RID &p_font_rid, const Vector2i &p_size) { +void TextServerFallback::_font_remove_size_cache(const RID &p_font_rid, const Vector2i &p_size) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1381,7 +1395,7 @@ void TextServerFallback::font_remove_size_cache(const RID &p_font_rid, const Vec } } -void TextServerFallback::font_set_ascent(const RID &p_font_rid, int64_t p_size, double p_ascent) { +void TextServerFallback::_font_set_ascent(const RID &p_font_rid, int64_t p_size, double p_ascent) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1392,7 +1406,7 @@ void TextServerFallback::font_set_ascent(const RID &p_font_rid, int64_t p_size, fd->cache[size]->ascent = p_ascent; } -double TextServerFallback::font_get_ascent(const RID &p_font_rid, int64_t p_size) const { +double TextServerFallback::_font_get_ascent(const RID &p_font_rid, int64_t p_size) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); @@ -1408,7 +1422,7 @@ double TextServerFallback::font_get_ascent(const RID &p_font_rid, int64_t p_size } } -void TextServerFallback::font_set_descent(const RID &p_font_rid, int64_t p_size, double p_descent) { +void TextServerFallback::_font_set_descent(const RID &p_font_rid, int64_t p_size, double p_descent) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1418,7 +1432,7 @@ void TextServerFallback::font_set_descent(const RID &p_font_rid, int64_t p_size, fd->cache[size]->descent = p_descent; } -double TextServerFallback::font_get_descent(const RID &p_font_rid, int64_t p_size) const { +double TextServerFallback::_font_get_descent(const RID &p_font_rid, int64_t p_size) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); @@ -1434,7 +1448,7 @@ double TextServerFallback::font_get_descent(const RID &p_font_rid, int64_t p_siz } } -void TextServerFallback::font_set_underline_position(const RID &p_font_rid, int64_t p_size, double p_underline_position) { +void TextServerFallback::_font_set_underline_position(const RID &p_font_rid, int64_t p_size, double p_underline_position) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1445,7 +1459,7 @@ void TextServerFallback::font_set_underline_position(const RID &p_font_rid, int6 fd->cache[size]->underline_position = p_underline_position; } -double TextServerFallback::font_get_underline_position(const RID &p_font_rid, int64_t p_size) const { +double TextServerFallback::_font_get_underline_position(const RID &p_font_rid, int64_t p_size) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); @@ -1461,7 +1475,7 @@ double TextServerFallback::font_get_underline_position(const RID &p_font_rid, in } } -void TextServerFallback::font_set_underline_thickness(const RID &p_font_rid, int64_t p_size, double p_underline_thickness) { +void TextServerFallback::_font_set_underline_thickness(const RID &p_font_rid, int64_t p_size, double p_underline_thickness) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1472,7 +1486,7 @@ void TextServerFallback::font_set_underline_thickness(const RID &p_font_rid, int fd->cache[size]->underline_thickness = p_underline_thickness; } -double TextServerFallback::font_get_underline_thickness(const RID &p_font_rid, int64_t p_size) const { +double TextServerFallback::_font_get_underline_thickness(const RID &p_font_rid, int64_t p_size) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); @@ -1488,7 +1502,7 @@ double TextServerFallback::font_get_underline_thickness(const RID &p_font_rid, i } } -void TextServerFallback::font_set_scale(const RID &p_font_rid, int64_t p_size, double p_scale) { +void TextServerFallback::_font_set_scale(const RID &p_font_rid, int64_t p_size, double p_scale) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1504,7 +1518,7 @@ void TextServerFallback::font_set_scale(const RID &p_font_rid, int64_t p_size, d fd->cache[size]->scale = p_scale; } -double TextServerFallback::font_get_scale(const RID &p_font_rid, int64_t p_size) const { +double TextServerFallback::_font_get_scale(const RID &p_font_rid, int64_t p_size) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); @@ -1520,7 +1534,7 @@ double TextServerFallback::font_get_scale(const RID &p_font_rid, int64_t p_size) } } -int64_t TextServerFallback::font_get_texture_count(const RID &p_font_rid, const Vector2i &p_size) const { +int64_t TextServerFallback::_font_get_texture_count(const RID &p_font_rid, const Vector2i &p_size) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); @@ -1532,7 +1546,7 @@ int64_t TextServerFallback::font_get_texture_count(const RID &p_font_rid, const return fd->cache[size]->textures.size(); } -void TextServerFallback::font_clear_textures(const RID &p_font_rid, const Vector2i &p_size) { +void TextServerFallback::_font_clear_textures(const RID &p_font_rid, const Vector2i &p_size) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1542,7 +1556,7 @@ void TextServerFallback::font_clear_textures(const RID &p_font_rid, const Vector fd->cache[size]->textures.clear(); } -void TextServerFallback::font_remove_texture(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) { +void TextServerFallback::_font_remove_texture(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1554,7 +1568,7 @@ void TextServerFallback::font_remove_texture(const RID &p_font_rid, const Vector fd->cache[size]->textures.remove_at(p_texture_index); } -void TextServerFallback::font_set_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const Ref<Image> &p_image) { +void TextServerFallback::_font_set_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const Ref<Image> &p_image) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); ERR_FAIL_COND(p_image.is_null()); @@ -1585,7 +1599,7 @@ void TextServerFallback::font_set_texture_image(const RID &p_font_rid, const Vec tex.dirty = false; } -Ref<Image> TextServerFallback::font_get_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const { +Ref<Image> TextServerFallback::_font_get_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Ref<Image>()); @@ -1602,7 +1616,7 @@ Ref<Image> TextServerFallback::font_get_texture_image(const RID &p_font_rid, con return img; } -void TextServerFallback::font_set_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const PackedInt32Array &p_offset) { +void TextServerFallback::_font_set_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const PackedInt32Array &p_offset) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1618,7 +1632,7 @@ void TextServerFallback::font_set_texture_offsets(const RID &p_font_rid, const V tex.offsets = p_offset; } -PackedInt32Array TextServerFallback::font_get_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const { +PackedInt32Array TextServerFallback::_font_get_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, PackedInt32Array()); @@ -1631,7 +1645,7 @@ PackedInt32Array TextServerFallback::font_get_texture_offsets(const RID &p_font_ return tex.offsets; } -PackedInt32Array TextServerFallback::font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const { +PackedInt32Array TextServerFallback::_font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, PackedInt32Array()); @@ -1647,7 +1661,7 @@ PackedInt32Array TextServerFallback::font_get_glyph_list(const RID &p_font_rid, return ret; } -void TextServerFallback::font_clear_glyphs(const RID &p_font_rid, const Vector2i &p_size) { +void TextServerFallback::_font_clear_glyphs(const RID &p_font_rid, const Vector2i &p_size) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1658,7 +1672,7 @@ void TextServerFallback::font_clear_glyphs(const RID &p_font_rid, const Vector2i fd->cache[size]->glyph_map.clear(); } -void TextServerFallback::font_remove_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) { +void TextServerFallback::_font_remove_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1669,7 +1683,7 @@ void TextServerFallback::font_remove_glyph(const RID &p_font_rid, const Vector2i fd->cache[size]->glyph_map.erase(p_glyph); } -Vector2 TextServerFallback::font_get_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph) const { +Vector2 TextServerFallback::_font_get_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); @@ -1680,7 +1694,7 @@ Vector2 TextServerFallback::font_get_glyph_advance(const RID &p_font_rid, int64_ int mod = 0; if (fd->antialiasing == FONT_ANTIALIASING_LCD) { - TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)GLOBAL_GET("gui/theme/lcd_subpixel_layout"); + TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)ProjectSettings::get_singleton()->get("gui/theme/lcd_subpixel_layout"); if (layout != FONT_LCD_SUBPIXEL_LAYOUT_NONE) { mod = (layout << 24); } @@ -1706,7 +1720,7 @@ Vector2 TextServerFallback::font_get_glyph_advance(const RID &p_font_rid, int64_ } } -void TextServerFallback::font_set_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph, const Vector2 &p_advance) { +void TextServerFallback::_font_set_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph, const Vector2 &p_advance) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1721,7 +1735,7 @@ void TextServerFallback::font_set_glyph_advance(const RID &p_font_rid, int64_t p gl[p_glyph].found = true; } -Vector2 TextServerFallback::font_get_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { +Vector2 TextServerFallback::_font_get_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); @@ -1732,7 +1746,7 @@ Vector2 TextServerFallback::font_get_glyph_offset(const RID &p_font_rid, const V int mod = 0; if (fd->antialiasing == FONT_ANTIALIASING_LCD) { - TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)GLOBAL_GET("gui/theme/lcd_subpixel_layout"); + TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)ProjectSettings::get_singleton()->get("gui/theme/lcd_subpixel_layout"); if (layout != FONT_LCD_SUBPIXEL_LAYOUT_NONE) { mod = (layout << 24); } @@ -1751,7 +1765,7 @@ Vector2 TextServerFallback::font_get_glyph_offset(const RID &p_font_rid, const V } } -void TextServerFallback::font_set_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_offset) { +void TextServerFallback::_font_set_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_offset) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1766,7 +1780,7 @@ void TextServerFallback::font_set_glyph_offset(const RID &p_font_rid, const Vect gl[p_glyph].found = true; } -Vector2 TextServerFallback::font_get_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { +Vector2 TextServerFallback::_font_get_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); @@ -1777,7 +1791,7 @@ Vector2 TextServerFallback::font_get_glyph_size(const RID &p_font_rid, const Vec int mod = 0; if (fd->antialiasing == FONT_ANTIALIASING_LCD) { - TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)GLOBAL_GET("gui/theme/lcd_subpixel_layout"); + TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)ProjectSettings::get_singleton()->get("gui/theme/lcd_subpixel_layout"); if (layout != FONT_LCD_SUBPIXEL_LAYOUT_NONE) { mod = (layout << 24); } @@ -1796,7 +1810,7 @@ Vector2 TextServerFallback::font_get_glyph_size(const RID &p_font_rid, const Vec } } -void TextServerFallback::font_set_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_gl_size) { +void TextServerFallback::_font_set_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_gl_size) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1811,7 +1825,7 @@ void TextServerFallback::font_set_glyph_size(const RID &p_font_rid, const Vector gl[p_glyph].found = true; } -Rect2 TextServerFallback::font_get_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { +Rect2 TextServerFallback::_font_get_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Rect2()); @@ -1822,7 +1836,7 @@ Rect2 TextServerFallback::font_get_glyph_uv_rect(const RID &p_font_rid, const Ve int mod = 0; if (fd->antialiasing == FONT_ANTIALIASING_LCD) { - TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)GLOBAL_GET("gui/theme/lcd_subpixel_layout"); + TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)ProjectSettings::get_singleton()->get("gui/theme/lcd_subpixel_layout"); if (layout != FONT_LCD_SUBPIXEL_LAYOUT_NONE) { mod = (layout << 24); } @@ -1836,7 +1850,7 @@ Rect2 TextServerFallback::font_get_glyph_uv_rect(const RID &p_font_rid, const Ve return gl[p_glyph | mod].uv_rect; } -void TextServerFallback::font_set_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Rect2 &p_uv_rect) { +void TextServerFallback::_font_set_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Rect2 &p_uv_rect) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1851,7 +1865,7 @@ void TextServerFallback::font_set_glyph_uv_rect(const RID &p_font_rid, const Vec gl[p_glyph].found = true; } -int64_t TextServerFallback::font_get_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { +int64_t TextServerFallback::_font_get_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, -1); @@ -1862,7 +1876,7 @@ int64_t TextServerFallback::font_get_glyph_texture_idx(const RID &p_font_rid, co int mod = 0; if (fd->antialiasing == FONT_ANTIALIASING_LCD) { - TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)GLOBAL_GET("gui/theme/lcd_subpixel_layout"); + TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)ProjectSettings::get_singleton()->get("gui/theme/lcd_subpixel_layout"); if (layout != FONT_LCD_SUBPIXEL_LAYOUT_NONE) { mod = (layout << 24); } @@ -1876,7 +1890,7 @@ int64_t TextServerFallback::font_get_glyph_texture_idx(const RID &p_font_rid, co return gl[p_glyph | mod].texture_idx; } -void TextServerFallback::font_set_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, int64_t p_texture_idx) { +void TextServerFallback::_font_set_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, int64_t p_texture_idx) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -1891,7 +1905,7 @@ void TextServerFallback::font_set_glyph_texture_idx(const RID &p_font_rid, const gl[p_glyph].found = true; } -RID TextServerFallback::font_get_glyph_texture_rid(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { +RID TextServerFallback::_font_get_glyph_texture_rid(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, RID()); @@ -1902,7 +1916,7 @@ RID TextServerFallback::font_get_glyph_texture_rid(const RID &p_font_rid, const int mod = 0; if (fd->antialiasing == FONT_ANTIALIASING_LCD) { - TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)GLOBAL_GET("gui/theme/lcd_subpixel_layout"); + TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)ProjectSettings::get_singleton()->get("gui/theme/lcd_subpixel_layout"); if (layout != FONT_LCD_SUBPIXEL_LAYOUT_NONE) { mod = (layout << 24); } @@ -1939,7 +1953,7 @@ RID TextServerFallback::font_get_glyph_texture_rid(const RID &p_font_rid, const return RID(); } -Size2 TextServerFallback::font_get_glyph_texture_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { +Size2 TextServerFallback::_font_get_glyph_texture_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Size2()); @@ -1950,7 +1964,7 @@ Size2 TextServerFallback::font_get_glyph_texture_size(const RID &p_font_rid, con int mod = 0; if (fd->antialiasing == FONT_ANTIALIASING_LCD) { - TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)GLOBAL_GET("gui/theme/lcd_subpixel_layout"); + TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)ProjectSettings::get_singleton()->get("gui/theme/lcd_subpixel_layout"); if (layout != FONT_LCD_SUBPIXEL_LAYOUT_NONE) { mod = (layout << 24); } @@ -1987,7 +2001,7 @@ Size2 TextServerFallback::font_get_glyph_texture_size(const RID &p_font_rid, con return Size2(); } -Dictionary TextServerFallback::font_get_glyph_contours(const RID &p_font_rid, int64_t p_size, int64_t p_index) const { +Dictionary TextServerFallback::_font_get_glyph_contours(const RID &p_font_rid, int64_t p_size, int64_t p_index) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); @@ -2037,7 +2051,7 @@ Dictionary TextServerFallback::font_get_glyph_contours(const RID &p_font_rid, in #endif } -TypedArray<Vector2i> TextServerFallback::font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const { +TypedArray<Vector2i> TextServerFallback::_font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, TypedArray<Vector2i>()); @@ -2053,7 +2067,7 @@ TypedArray<Vector2i> TextServerFallback::font_get_kerning_list(const RID &p_font return ret; } -void TextServerFallback::font_clear_kerning_map(const RID &p_font_rid, int64_t p_size) { +void TextServerFallback::_font_clear_kerning_map(const RID &p_font_rid, int64_t p_size) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2064,7 +2078,7 @@ void TextServerFallback::font_clear_kerning_map(const RID &p_font_rid, int64_t p fd->cache[size]->kerning_map.clear(); } -void TextServerFallback::font_remove_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) { +void TextServerFallback::_font_remove_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2075,7 +2089,7 @@ void TextServerFallback::font_remove_kerning(const RID &p_font_rid, int64_t p_si fd->cache[size]->kerning_map.erase(p_glyph_pair); } -void TextServerFallback::font_set_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair, const Vector2 &p_kerning) { +void TextServerFallback::_font_set_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair, const Vector2 &p_kerning) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2086,7 +2100,7 @@ void TextServerFallback::font_set_kerning(const RID &p_font_rid, int64_t p_size, fd->cache[size]->kerning_map[p_glyph_pair] = p_kerning; } -Vector2 TextServerFallback::font_get_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) const { +Vector2 TextServerFallback::_font_get_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); @@ -2121,12 +2135,12 @@ Vector2 TextServerFallback::font_get_kerning(const RID &p_font_rid, int64_t p_si return Vector2(); } -int64_t TextServerFallback::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 TextServerFallback::_font_get_glyph_index(const RID &p_font_rid, int64_t p_size, int64_t p_char, int64_t p_variation_selector) const { ERR_FAIL_COND_V_MSG((p_char >= 0xd800 && p_char <= 0xdfff) || (p_char > 0x10ffff), 0, "Unicode parsing error: Invalid unicode codepoint " + String::num_int64(p_char, 16) + "."); return (int64_t)p_char; } -bool TextServerFallback::font_has_char(const RID &p_font_rid, int64_t p_char) const { +bool TextServerFallback::_font_has_char(const RID &p_font_rid, int64_t p_char) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V_MSG((p_char >= 0xd800 && p_char <= 0xdfff) || (p_char > 0x10ffff), false, "Unicode parsing error: Invalid unicode codepoint " + String::num_int64(p_char, 16) + "."); if (!fd) { @@ -2147,7 +2161,7 @@ bool TextServerFallback::font_has_char(const RID &p_font_rid, int64_t p_char) co return (at_size) ? at_size->glyph_map.has((int32_t)p_char) : false; } -String TextServerFallback::font_get_supported_chars(const RID &p_font_rid) const { +String TextServerFallback::_font_get_supported_chars(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, String()); @@ -2180,7 +2194,7 @@ String TextServerFallback::font_get_supported_chars(const RID &p_font_rid) const return chars; } -void TextServerFallback::font_render_range(const RID &p_font_rid, const Vector2i &p_size, int64_t p_start, int64_t p_end) { +void TextServerFallback::_font_render_range(const RID &p_font_rid, const Vector2i &p_size, int64_t p_start, int64_t p_end) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); ERR_FAIL_COND_MSG((p_start >= 0xd800 && p_start <= 0xdfff) || (p_start > 0x10ffff), "Unicode parsing error: Invalid unicode codepoint " + String::num_int64(p_start, 16) + "."); @@ -2215,7 +2229,7 @@ void TextServerFallback::font_render_range(const RID &p_font_rid, const Vector2i } } -void TextServerFallback::font_render_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_index) { +void TextServerFallback::_font_render_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_index) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2246,7 +2260,7 @@ void TextServerFallback::font_render_glyph(const RID &p_font_rid, const Vector2i #endif } -void TextServerFallback::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 { +void TextServerFallback::_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 { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2261,7 +2275,7 @@ void TextServerFallback::font_draw_glyph(const RID &p_font_rid, const RID &p_can if (!fd->msdf && fd->cache[size]->face) { // LCD layout, bits 24, 25, 26 if (fd->antialiasing == FONT_ANTIALIASING_LCD) { - TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)GLOBAL_GET("gui/theme/lcd_subpixel_layout"); + TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)ProjectSettings::get_singleton()->get("gui/theme/lcd_subpixel_layout"); if (layout != FONT_LCD_SUBPIXEL_LAYOUT_NONE) { lcd_aa = true; index = index | (layout << 24); @@ -2338,7 +2352,7 @@ void TextServerFallback::font_draw_glyph(const RID &p_font_rid, const RID &p_can } } -void TextServerFallback::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 { +void TextServerFallback::_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 { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2353,7 +2367,7 @@ void TextServerFallback::font_draw_glyph_outline(const RID &p_font_rid, const RI if (!fd->msdf && fd->cache[size]->face) { // LCD layout, bits 24, 25, 26 if (fd->antialiasing == FONT_ANTIALIASING_LCD) { - TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)GLOBAL_GET("gui/theme/lcd_subpixel_layout"); + TextServer::FontLCDSubpixelLayout layout = (TextServer::FontLCDSubpixelLayout)(int)ProjectSettings::get_singleton()->get("gui/theme/lcd_subpixel_layout"); if (layout != FONT_LCD_SUBPIXEL_LAYOUT_NONE) { lcd_aa = true; index = index | (layout << 24); @@ -2430,7 +2444,7 @@ void TextServerFallback::font_draw_glyph_outline(const RID &p_font_rid, const RI } } -bool TextServerFallback::font_is_language_supported(const RID &p_font_rid, const String &p_language) const { +bool TextServerFallback::_font_is_language_supported(const RID &p_font_rid, const String &p_language) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); @@ -2442,7 +2456,7 @@ bool TextServerFallback::font_is_language_supported(const RID &p_font_rid, const } } -void TextServerFallback::font_set_language_support_override(const RID &p_font_rid, const String &p_language, bool p_supported) { +void TextServerFallback::_font_set_language_support_override(const RID &p_font_rid, const String &p_language, bool p_supported) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2450,7 +2464,7 @@ void TextServerFallback::font_set_language_support_override(const RID &p_font_ri fd->language_support_overrides[p_language] = p_supported; } -bool TextServerFallback::font_get_language_support_override(const RID &p_font_rid, const String &p_language) { +bool TextServerFallback::_font_get_language_support_override(const RID &p_font_rid, const String &p_language) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); @@ -2458,7 +2472,7 @@ bool TextServerFallback::font_get_language_support_override(const RID &p_font_ri return fd->language_support_overrides[p_language]; } -void TextServerFallback::font_remove_language_support_override(const RID &p_font_rid, const String &p_language) { +void TextServerFallback::_font_remove_language_support_override(const RID &p_font_rid, const String &p_language) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2466,7 +2480,7 @@ void TextServerFallback::font_remove_language_support_override(const RID &p_font fd->language_support_overrides.erase(p_language); } -PackedStringArray TextServerFallback::font_get_language_support_overrides(const RID &p_font_rid) { +PackedStringArray TextServerFallback::_font_get_language_support_overrides(const RID &p_font_rid) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, PackedStringArray()); @@ -2478,7 +2492,7 @@ PackedStringArray TextServerFallback::font_get_language_support_overrides(const return out; } -bool TextServerFallback::font_is_script_supported(const RID &p_font_rid, const String &p_script) const { +bool TextServerFallback::_font_is_script_supported(const RID &p_font_rid, const String &p_script) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); @@ -2490,7 +2504,7 @@ bool TextServerFallback::font_is_script_supported(const RID &p_font_rid, const S } } -void TextServerFallback::font_set_script_support_override(const RID &p_font_rid, const String &p_script, bool p_supported) { +void TextServerFallback::_font_set_script_support_override(const RID &p_font_rid, const String &p_script, bool p_supported) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2498,7 +2512,7 @@ void TextServerFallback::font_set_script_support_override(const RID &p_font_rid, fd->script_support_overrides[p_script] = p_supported; } -bool TextServerFallback::font_get_script_support_override(const RID &p_font_rid, const String &p_script) { +bool TextServerFallback::_font_get_script_support_override(const RID &p_font_rid, const String &p_script) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); @@ -2506,7 +2520,7 @@ bool TextServerFallback::font_get_script_support_override(const RID &p_font_rid, return fd->script_support_overrides[p_script]; } -void TextServerFallback::font_remove_script_support_override(const RID &p_font_rid, const String &p_script) { +void TextServerFallback::_font_remove_script_support_override(const RID &p_font_rid, const String &p_script) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2516,7 +2530,7 @@ void TextServerFallback::font_remove_script_support_override(const RID &p_font_r fd->script_support_overrides.erase(p_script); } -PackedStringArray TextServerFallback::font_get_script_support_overrides(const RID &p_font_rid) { +PackedStringArray TextServerFallback::_font_get_script_support_overrides(const RID &p_font_rid) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, PackedStringArray()); @@ -2528,7 +2542,7 @@ PackedStringArray TextServerFallback::font_get_script_support_overrides(const RI return out; } -void TextServerFallback::font_set_opentype_feature_overrides(const RID &p_font_rid, const Dictionary &p_overrides) { +void TextServerFallback::_font_set_opentype_feature_overrides(const RID &p_font_rid, const Dictionary &p_overrides) { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); @@ -2538,7 +2552,7 @@ void TextServerFallback::font_set_opentype_feature_overrides(const RID &p_font_r fd->feature_overrides = p_overrides; } -Dictionary TextServerFallback::font_get_opentype_feature_overrides(const RID &p_font_rid) const { +Dictionary TextServerFallback::_font_get_opentype_feature_overrides(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); @@ -2546,11 +2560,11 @@ Dictionary TextServerFallback::font_get_opentype_feature_overrides(const RID &p_ return fd->feature_overrides; } -Dictionary TextServerFallback::font_supported_feature_list(const RID &p_font_rid) const { +Dictionary TextServerFallback::_font_supported_feature_list(const RID &p_font_rid) const { return Dictionary(); } -Dictionary TextServerFallback::font_supported_variation_list(const RID &p_font_rid) const { +Dictionary TextServerFallback::_font_supported_variation_list(const RID &p_font_rid) const { FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); @@ -2560,11 +2574,11 @@ Dictionary TextServerFallback::font_supported_variation_list(const RID &p_font_r return fd->supported_varaitions; } -double TextServerFallback::font_get_global_oversampling() const { +double TextServerFallback::_font_get_global_oversampling() const { return oversampling; } -void TextServerFallback::font_set_global_oversampling(double p_oversampling) { +void TextServerFallback::_font_set_global_oversampling(double p_oversampling) { _THREAD_SAFE_METHOD_ if (oversampling != p_oversampling) { oversampling = p_oversampling; @@ -2572,8 +2586,8 @@ void TextServerFallback::font_set_global_oversampling(double p_oversampling) { font_owner.get_owned_list(&fonts); bool font_cleared = false; for (const RID &E : fonts) { - if (!font_is_multichannel_signed_distance_field(E) && font_get_oversampling(E) <= 0) { - font_clear_size_cache(E); + if (!_font_is_multichannel_signed_distance_field(E) && _font_get_oversampling(E) <= 0) { + _font_clear_size_cache(E); font_cleared = true; } } @@ -2628,7 +2642,7 @@ void TextServerFallback::full_copy(ShapedTextDataFallback *p_shaped) { p_shaped->parent = RID(); } -RID TextServerFallback::create_shaped_text(TextServer::Direction p_direction, TextServer::Orientation p_orientation) { +RID TextServerFallback::_create_shaped_text(TextServer::Direction p_direction, TextServer::Orientation p_orientation) { _THREAD_SAFE_METHOD_ ShapedTextDataFallback *sd = memnew(ShapedTextDataFallback); @@ -2638,7 +2652,7 @@ RID TextServerFallback::create_shaped_text(TextServer::Direction p_direction, Te return shaped_owner.make_rid(sd); } -void TextServerFallback::shaped_text_clear(const RID &p_shaped) { +void TextServerFallback::_shaped_text_clear(const RID &p_shaped) { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); @@ -2652,21 +2666,21 @@ void TextServerFallback::shaped_text_clear(const RID &p_shaped) { invalidate(sd); } -void TextServerFallback::shaped_text_set_direction(const RID &p_shaped, TextServer::Direction p_direction) { +void TextServerFallback::_shaped_text_set_direction(const RID &p_shaped, TextServer::Direction p_direction) { if (p_direction == DIRECTION_RTL) { ERR_PRINT_ONCE("Right-to-left layout is not supported by this text server."); } } -TextServer::Direction TextServerFallback::shaped_text_get_direction(const RID &p_shaped) const { +TextServer::Direction TextServerFallback::_shaped_text_get_direction(const RID &p_shaped) const { return TextServer::DIRECTION_LTR; } -TextServer::Direction TextServerFallback::shaped_text_get_inferred_direction(const RID &p_shaped) const { +TextServer::Direction TextServerFallback::_shaped_text_get_inferred_direction(const RID &p_shaped) const { return TextServer::DIRECTION_LTR; } -void TextServerFallback::shaped_text_set_custom_punctuation(const RID &p_shaped, const String &p_punct) { +void TextServerFallback::_shaped_text_set_custom_punctuation(const RID &p_shaped, const String &p_punct) { _THREAD_SAFE_METHOD_ ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); @@ -2680,14 +2694,14 @@ void TextServerFallback::shaped_text_set_custom_punctuation(const RID &p_shaped, } } -String TextServerFallback::shaped_text_get_custom_punctuation(const RID &p_shaped) const { +String TextServerFallback::_shaped_text_get_custom_punctuation(const RID &p_shaped) const { _THREAD_SAFE_METHOD_ const ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, String()); return sd->custom_punct; } -void TextServerFallback::shaped_text_set_orientation(const RID &p_shaped, TextServer::Orientation p_orientation) { +void TextServerFallback::_shaped_text_set_orientation(const RID &p_shaped, TextServer::Orientation p_orientation) { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); @@ -2701,11 +2715,11 @@ void TextServerFallback::shaped_text_set_orientation(const RID &p_shaped, TextSe } } -void TextServerFallback::shaped_text_set_bidi_override(const RID &p_shaped, const Array &p_override) { +void TextServerFallback::_shaped_text_set_bidi_override(const RID &p_shaped, const Array &p_override) { // No BiDi support, ignore. } -TextServer::Orientation TextServerFallback::shaped_text_get_orientation(const RID &p_shaped) const { +TextServer::Orientation TextServerFallback::_shaped_text_get_orientation(const RID &p_shaped) const { const ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, TextServer::ORIENTATION_HORIZONTAL); @@ -2713,7 +2727,7 @@ TextServer::Orientation TextServerFallback::shaped_text_get_orientation(const RI return sd->orientation; } -void TextServerFallback::shaped_text_set_preserve_invalid(const RID &p_shaped, bool p_enabled) { +void TextServerFallback::_shaped_text_set_preserve_invalid(const RID &p_shaped, bool p_enabled) { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); MutexLock lock(sd->mutex); @@ -2727,7 +2741,7 @@ void TextServerFallback::shaped_text_set_preserve_invalid(const RID &p_shaped, b } } -bool TextServerFallback::shaped_text_get_preserve_invalid(const RID &p_shaped) const { +bool TextServerFallback::_shaped_text_get_preserve_invalid(const RID &p_shaped) const { const ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); @@ -2735,7 +2749,7 @@ bool TextServerFallback::shaped_text_get_preserve_invalid(const RID &p_shaped) c return sd->preserve_invalid; } -void TextServerFallback::shaped_text_set_preserve_control(const RID &p_shaped, bool p_enabled) { +void TextServerFallback::_shaped_text_set_preserve_control(const RID &p_shaped, bool p_enabled) { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); @@ -2749,7 +2763,7 @@ void TextServerFallback::shaped_text_set_preserve_control(const RID &p_shaped, b } } -bool TextServerFallback::shaped_text_get_preserve_control(const RID &p_shaped) const { +bool TextServerFallback::_shaped_text_get_preserve_control(const RID &p_shaped) const { const ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); @@ -2757,7 +2771,7 @@ bool TextServerFallback::shaped_text_get_preserve_control(const RID &p_shaped) c return sd->preserve_control; } -void TextServerFallback::shaped_text_set_spacing(const RID &p_shaped, SpacingType p_spacing, int64_t p_value) { +void TextServerFallback::_shaped_text_set_spacing(const RID &p_shaped, SpacingType p_spacing, int64_t p_value) { ERR_FAIL_INDEX((int)p_spacing, 4); ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); @@ -2772,7 +2786,7 @@ void TextServerFallback::shaped_text_set_spacing(const RID &p_shaped, SpacingTyp } } -int64_t TextServerFallback::shaped_text_get_spacing(const RID &p_shaped, SpacingType p_spacing) const { +int64_t TextServerFallback::_shaped_text_get_spacing(const RID &p_shaped, SpacingType p_spacing) const { ERR_FAIL_INDEX_V((int)p_spacing, 4, 0); const ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); @@ -2782,20 +2796,20 @@ int64_t TextServerFallback::shaped_text_get_spacing(const RID &p_shaped, Spacing return sd->extra_spacing[p_spacing]; } -int64_t TextServerFallback::shaped_get_span_count(const RID &p_shaped) const { +int64_t TextServerFallback::_shaped_get_span_count(const RID &p_shaped) const { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0); return sd->spans.size(); } -Variant TextServerFallback::shaped_get_span_meta(const RID &p_shaped, int64_t p_index) const { +Variant TextServerFallback::_shaped_get_span_meta(const RID &p_shaped, int64_t p_index) const { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, Variant()); ERR_FAIL_INDEX_V(p_index, sd->spans.size(), Variant()); return sd->spans[p_index].meta; } -void TextServerFallback::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) { +void TextServerFallback::_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) { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); ERR_FAIL_INDEX(p_index, sd->spans.size()); @@ -2806,7 +2820,7 @@ void TextServerFallback::shaped_set_span_update_font(const RID &p_shaped, int64_ Array fonts_no_match; int font_count = p_fonts.size(); for (int i = 0; i < font_count; i++) { - if (font_is_language_supported(p_fonts[i], span.language)) { + if (_font_is_language_supported(p_fonts[i], span.language)) { span.fonts.push_back(p_fonts[i]); } else { fonts_no_match.push_back(p_fonts[i]); @@ -2819,7 +2833,7 @@ void TextServerFallback::shaped_set_span_update_font(const RID &p_shaped, int64_ sd->valid = false; } -bool TextServerFallback::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 TextServerFallback::_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) { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); @@ -2849,7 +2863,7 @@ bool TextServerFallback::shaped_text_add_string(const RID &p_shaped, const Strin span.fonts.push_back(p_fonts[0]); } for (int i = 1; i < font_count; i++) { - if (font_is_language_supported(p_fonts[i], p_language)) { + if (_font_is_language_supported(p_fonts[i], p_language)) { span.fonts.push_back(p_fonts[i]); } else { fonts_no_match.push_back(p_fonts[i]); @@ -2870,7 +2884,7 @@ bool TextServerFallback::shaped_text_add_string(const RID &p_shaped, const Strin return true; } -bool TextServerFallback::shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align, int64_t p_length) { +bool TextServerFallback::_shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align, int64_t p_length) { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); @@ -2901,7 +2915,7 @@ bool TextServerFallback::shaped_text_add_object(const RID &p_shaped, const Varia return true; } -bool TextServerFallback::shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align) { +bool TextServerFallback::_shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align) { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); @@ -2942,14 +2956,14 @@ bool TextServerFallback::shaped_text_resize_object(const RID &p_shaped, const Va } else { if (gl.font_rid.is_valid()) { if (sd->orientation == ORIENTATION_HORIZONTAL) { - sd->ascent = MAX(sd->ascent, font_get_ascent(gl.font_rid, gl.font_size)); - sd->descent = MAX(sd->descent, font_get_descent(gl.font_rid, gl.font_size)); + sd->ascent = MAX(sd->ascent, _font_get_ascent(gl.font_rid, gl.font_size)); + sd->descent = MAX(sd->descent, _font_get_descent(gl.font_rid, gl.font_size)); } else { - sd->ascent = MAX(sd->ascent, Math::round(font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5)); - sd->descent = MAX(sd->descent, Math::round(font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5)); + sd->ascent = MAX(sd->ascent, Math::round(_font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5)); + sd->descent = MAX(sd->descent, Math::round(_font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5)); } - sd->upos = MAX(sd->upos, font_get_underline_position(gl.font_rid, gl.font_size)); - sd->uthk = MAX(sd->uthk, font_get_underline_thickness(gl.font_rid, gl.font_size)); + sd->upos = MAX(sd->upos, _font_get_underline_position(gl.font_rid, gl.font_size)); + sd->uthk = MAX(sd->uthk, _font_get_underline_thickness(gl.font_rid, gl.font_size)); } else if (sd->preserve_invalid || (sd->preserve_control && is_control(gl.index))) { // Glyph not found, replace with hex code box. if (sd->orientation == ORIENTATION_HORIZONTAL) { @@ -3036,7 +3050,7 @@ void TextServerFallback::_realign(ShapedTextDataFallback *p_sd) const { p_sd->descent = full_descent; } -RID TextServerFallback::shaped_text_substr(const RID &p_shaped, int64_t p_start, int64_t p_length) const { +RID TextServerFallback::_shaped_text_substr(const RID &p_shaped, int64_t p_start, int64_t p_length) const { _THREAD_SAFE_METHOD_ const ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); @@ -3044,10 +3058,10 @@ RID TextServerFallback::shaped_text_substr(const RID &p_shaped, int64_t p_start, MutexLock lock(sd->mutex); if (sd->parent != RID()) { - return shaped_text_substr(sd->parent, p_start, p_length); + return _shaped_text_substr(sd->parent, p_start, p_length); } if (!sd->valid) { - const_cast<TextServerFallback *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerFallback *>(this)->_shaped_text_shape(p_shaped); } ERR_FAIL_COND_V(p_start < 0 || p_length < 0, RID()); ERR_FAIL_COND_V(sd->start > p_start || sd->end < p_start, RID()); @@ -3102,11 +3116,11 @@ RID TextServerFallback::shaped_text_substr(const RID &p_shaped, int64_t p_start, } else { if (gl.font_rid.is_valid()) { if (new_sd->orientation == ORIENTATION_HORIZONTAL) { - new_sd->ascent = MAX(new_sd->ascent, font_get_ascent(gl.font_rid, gl.font_size)); - new_sd->descent = MAX(new_sd->descent, font_get_descent(gl.font_rid, gl.font_size)); + new_sd->ascent = MAX(new_sd->ascent, _font_get_ascent(gl.font_rid, gl.font_size)); + new_sd->descent = MAX(new_sd->descent, _font_get_descent(gl.font_rid, gl.font_size)); } else { - new_sd->ascent = MAX(new_sd->ascent, Math::round(font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5)); - new_sd->descent = MAX(new_sd->descent, Math::round(font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5)); + new_sd->ascent = MAX(new_sd->ascent, Math::round(_font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5)); + new_sd->descent = MAX(new_sd->descent, Math::round(_font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5)); } } else if (new_sd->preserve_invalid || (new_sd->preserve_control && is_control(gl.index))) { // Glyph not found, replace with hex code box. @@ -3130,7 +3144,7 @@ RID TextServerFallback::shaped_text_substr(const RID &p_shaped, int64_t p_start, return shaped_owner.make_rid(new_sd); } -RID TextServerFallback::shaped_text_get_parent(const RID &p_shaped) const { +RID TextServerFallback::_shaped_text_get_parent(const RID &p_shaped) const { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, RID()); @@ -3138,16 +3152,16 @@ RID TextServerFallback::shaped_text_get_parent(const RID &p_shaped) const { return sd->parent; } -double TextServerFallback::shaped_text_fit_to_width(const RID &p_shaped, double p_width, BitField<JustificationFlag> p_jst_flags) { +double TextServerFallback::_shaped_text_fit_to_width(const RID &p_shaped, double p_width, BitField<JustificationFlag> p_jst_flags) { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.0); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerFallback *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerFallback *>(this)->_shaped_text_shape(p_shaped); } if (!sd->justification_ops_valid) { - const_cast<TextServerFallback *>(this)->shaped_text_update_justification_ops(p_shaped); + const_cast<TextServerFallback *>(this)->_shaped_text_update_justification_ops(p_shaped); } int start_pos = 0; @@ -3247,16 +3261,16 @@ double TextServerFallback::shaped_text_fit_to_width(const RID &p_shaped, double return Math::ceil(justification_width); } -double TextServerFallback::shaped_text_tab_align(const RID &p_shaped, const PackedFloat32Array &p_tab_stops) { +double TextServerFallback::_shaped_text_tab_align(const RID &p_shaped, const PackedFloat32Array &p_tab_stops) { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.0); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerFallback *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerFallback *>(this)->_shaped_text_shape(p_shaped); } if (!sd->line_breaks_valid) { - const_cast<TextServerFallback *>(this)->shaped_text_update_breaks(p_shaped); + const_cast<TextServerFallback *>(this)->_shaped_text_update_breaks(p_shaped); } for (int i = 0; i < p_tab_stops.size(); i++) { @@ -3303,13 +3317,13 @@ double TextServerFallback::shaped_text_tab_align(const RID &p_shaped, const Pack return 0.0; } -bool TextServerFallback::shaped_text_update_breaks(const RID &p_shaped) { +bool TextServerFallback::_shaped_text_update_breaks(const RID &p_shaped) { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); MutexLock lock(sd->mutex); if (!sd->valid) { - shaped_text_shape(p_shaped); + _shaped_text_shape(p_shaped); } if (sd->line_breaks_valid) { @@ -3359,29 +3373,29 @@ bool TextServerFallback::shaped_text_update_breaks(const RID &p_shaped) { return sd->line_breaks_valid; } -bool TextServerFallback::shaped_text_update_justification_ops(const RID &p_shaped) { +bool TextServerFallback::_shaped_text_update_justification_ops(const RID &p_shaped) { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); MutexLock lock(sd->mutex); if (!sd->valid) { - shaped_text_shape(p_shaped); + _shaped_text_shape(p_shaped); } if (!sd->line_breaks_valid) { - shaped_text_update_breaks(p_shaped); + _shaped_text_update_breaks(p_shaped); } sd->justification_ops_valid = true; // Not supported by fallback server. return true; } -void TextServerFallback::shaped_text_overrun_trim_to_width(const RID &p_shaped_line, double p_width, BitField<TextServer::TextOverrunFlag> p_trim_flags) { +void TextServerFallback::_shaped_text_overrun_trim_to_width(const RID &p_shaped_line, double p_width, BitField<TextServer::TextOverrunFlag> p_trim_flags) { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped_line); ERR_FAIL_COND_MSG(!sd, "ShapedTextDataFallback invalid."); MutexLock lock(sd->mutex); if (!sd->valid) { - shaped_text_shape(p_shaped_line); + _shaped_text_shape(p_shaped_line); } sd->text_trimmed = false; @@ -3420,30 +3434,30 @@ void TextServerFallback::shaped_text_overrun_trim_to_width(const RID &p_shaped_l // Find usable fonts, if fonts from the last glyph do not have required chars. RID dot_gl_font_rid = sd_glyphs[sd_size - 1].font_rid; - if (!font_has_char(dot_gl_font_rid, '.')) { + if (!_font_has_char(dot_gl_font_rid, '.')) { const Array &fonts = spans[spans.size() - 1].fonts; for (int i = 0; i < fonts.size(); i++) { - if (font_has_char(fonts[i], '.')) { + if (_font_has_char(fonts[i], '.')) { dot_gl_font_rid = fonts[i]; break; } } } RID whitespace_gl_font_rid = sd_glyphs[sd_size - 1].font_rid; - if (!font_has_char(whitespace_gl_font_rid, '.')) { + if (!_font_has_char(whitespace_gl_font_rid, '.')) { const Array &fonts = spans[spans.size() - 1].fonts; for (int i = 0; i < fonts.size(); i++) { - if (font_has_char(fonts[i], ' ')) { + if (_font_has_char(fonts[i], ' ')) { whitespace_gl_font_rid = fonts[i]; break; } } } - int32_t dot_gl_idx = dot_gl_font_rid.is_valid() ? font_get_glyph_index(dot_gl_font_rid, last_gl_font_size, '.') : -10; - Vector2 dot_adv = dot_gl_font_rid.is_valid() ? font_get_glyph_advance(dot_gl_font_rid, last_gl_font_size, dot_gl_idx) : Vector2(); - int32_t whitespace_gl_idx = whitespace_gl_font_rid.is_valid() ? font_get_glyph_index(whitespace_gl_font_rid, last_gl_font_size, ' ') : -10; - Vector2 whitespace_adv = whitespace_gl_font_rid.is_valid() ? font_get_glyph_advance(whitespace_gl_font_rid, last_gl_font_size, whitespace_gl_idx) : Vector2(); + int32_t dot_gl_idx = dot_gl_font_rid.is_valid() ? _font_get_glyph_index(dot_gl_font_rid, last_gl_font_size, '.', 0) : -10; + Vector2 dot_adv = dot_gl_font_rid.is_valid() ? _font_get_glyph_advance(dot_gl_font_rid, last_gl_font_size, dot_gl_idx) : Vector2(); + int32_t whitespace_gl_idx = whitespace_gl_font_rid.is_valid() ? _font_get_glyph_index(whitespace_gl_font_rid, last_gl_font_size, ' ', 0) : -10; + Vector2 whitespace_adv = whitespace_gl_font_rid.is_valid() ? _font_get_glyph_advance(whitespace_gl_font_rid, last_gl_font_size, whitespace_gl_idx) : Vector2(); int ellipsis_width = 0; if (add_ellipsis && whitespace_gl_font_rid.is_valid()) { @@ -3532,7 +3546,7 @@ void TextServerFallback::shaped_text_overrun_trim_to_width(const RID &p_shaped_l } } -int64_t TextServerFallback::shaped_text_get_trim_pos(const RID &p_shaped) const { +int64_t TextServerFallback::_shaped_text_get_trim_pos(const RID &p_shaped) const { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V_MSG(!sd, -1, "ShapedTextDataFallback invalid."); @@ -3540,7 +3554,7 @@ int64_t TextServerFallback::shaped_text_get_trim_pos(const RID &p_shaped) const return sd->overrun_trim_data.trim_pos; } -int64_t TextServerFallback::shaped_text_get_ellipsis_pos(const RID &p_shaped) const { +int64_t TextServerFallback::_shaped_text_get_ellipsis_pos(const RID &p_shaped) const { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V_MSG(!sd, -1, "ShapedTextDataFallback invalid."); @@ -3548,7 +3562,7 @@ int64_t TextServerFallback::shaped_text_get_ellipsis_pos(const RID &p_shaped) co return sd->overrun_trim_data.ellipsis_pos; } -const Glyph *TextServerFallback::shaped_text_get_ellipsis_glyphs(const RID &p_shaped) const { +const Glyph *TextServerFallback::_shaped_text_get_ellipsis_glyphs(const RID &p_shaped) const { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V_MSG(!sd, nullptr, "ShapedTextDataFallback invalid."); @@ -3556,7 +3570,7 @@ const Glyph *TextServerFallback::shaped_text_get_ellipsis_glyphs(const RID &p_sh return sd->overrun_trim_data.ellipsis_glyph_buf.ptr(); } -int64_t TextServerFallback::shaped_text_get_ellipsis_glyph_count(const RID &p_shaped) const { +int64_t TextServerFallback::_shaped_text_get_ellipsis_glyph_count(const RID &p_shaped) const { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V_MSG(!sd, 0, "ShapedTextDataFallback invalid."); @@ -3564,7 +3578,7 @@ int64_t TextServerFallback::shaped_text_get_ellipsis_glyph_count(const RID &p_sh return sd->overrun_trim_data.ellipsis_glyph_buf.size(); } -bool TextServerFallback::shaped_text_shape(const RID &p_shaped) { +bool TextServerFallback::_shaped_text_shape(const RID &p_shaped) { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); @@ -3631,27 +3645,27 @@ bool TextServerFallback::shaped_text_shape(const RID &p_shaped) { } // Select first font which has character (font are already sorted by span language). for (int k = 0; k < span.fonts.size(); k++) { - if (font_has_char(span.fonts[k], gl.index)) { + if (_font_has_char(span.fonts[k], gl.index)) { gl.font_rid = span.fonts[k]; break; } } if (gl.font_rid.is_valid()) { - bool subpos = (font_get_subpixel_positioning(gl.font_rid) == SUBPIXEL_POSITIONING_ONE_HALF) || (font_get_subpixel_positioning(gl.font_rid) == SUBPIXEL_POSITIONING_ONE_QUARTER) || (font_get_subpixel_positioning(gl.font_rid) == SUBPIXEL_POSITIONING_AUTO && gl.font_size <= SUBPIXEL_POSITIONING_ONE_HALF_MAX_SIZE); + bool subpos = (_font_get_subpixel_positioning(gl.font_rid) == SUBPIXEL_POSITIONING_ONE_HALF) || (_font_get_subpixel_positioning(gl.font_rid) == SUBPIXEL_POSITIONING_ONE_QUARTER) || (_font_get_subpixel_positioning(gl.font_rid) == SUBPIXEL_POSITIONING_AUTO && gl.font_size <= SUBPIXEL_POSITIONING_ONE_HALF_MAX_SIZE); if (sd->text[j - sd->start] != 0 && !is_linebreak(sd->text[j - sd->start])) { if (sd->orientation == ORIENTATION_HORIZONTAL) { - gl.advance = Math::round(font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x); + gl.advance = Math::round(_font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x); gl.x_off = 0; gl.y_off = 0; - sd->ascent = MAX(sd->ascent, font_get_ascent(gl.font_rid, gl.font_size)); - sd->descent = MAX(sd->descent, font_get_descent(gl.font_rid, gl.font_size)); + sd->ascent = MAX(sd->ascent, _font_get_ascent(gl.font_rid, gl.font_size)); + sd->descent = MAX(sd->descent, _font_get_descent(gl.font_rid, gl.font_size)); } else { - gl.advance = Math::round(font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).y); - gl.x_off = -Math::round(font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5); - gl.y_off = font_get_ascent(gl.font_rid, gl.font_size); - sd->ascent = MAX(sd->ascent, Math::round(font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5)); - sd->descent = MAX(sd->descent, Math::round(font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5)); + gl.advance = Math::round(_font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).y); + gl.x_off = -Math::round(_font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5); + gl.y_off = _font_get_ascent(gl.font_rid, gl.font_size); + sd->ascent = MAX(sd->ascent, Math::round(_font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5)); + sd->descent = MAX(sd->descent, Math::round(_font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5)); } } if (j < sd->end - 1) { @@ -3662,17 +3676,17 @@ bool TextServerFallback::shaped_text_shape(const RID &p_shaped) { gl.advance += sd->extra_spacing[SPACING_GLYPH]; } } - sd->upos = MAX(sd->upos, font_get_underline_position(gl.font_rid, gl.font_size)); - sd->uthk = MAX(sd->uthk, font_get_underline_thickness(gl.font_rid, gl.font_size)); + sd->upos = MAX(sd->upos, _font_get_underline_position(gl.font_rid, gl.font_size)); + sd->uthk = MAX(sd->uthk, _font_get_underline_thickness(gl.font_rid, gl.font_size)); // Add kerning to previous glyph. if (sd->glyphs.size() > 0) { Glyph &prev_gl = sd->glyphs.write[sd->glyphs.size() - 1]; if (prev_gl.font_rid == gl.font_rid && prev_gl.font_size == gl.font_size) { if (sd->orientation == ORIENTATION_HORIZONTAL) { - prev_gl.advance += font_get_kerning(gl.font_rid, gl.font_size, Vector2i(prev_gl.index, gl.index)).x; + prev_gl.advance += _font_get_kerning(gl.font_rid, gl.font_size, Vector2i(prev_gl.index, gl.index)).x; } else { - prev_gl.advance += font_get_kerning(gl.font_rid, gl.font_size, Vector2i(prev_gl.index, gl.index)).y; + prev_gl.advance += _font_get_kerning(gl.font_rid, gl.font_size, Vector2i(prev_gl.index, gl.index)).y; } } } @@ -3703,7 +3717,7 @@ bool TextServerFallback::shaped_text_shape(const RID &p_shaped) { return sd->valid; } -bool TextServerFallback::shaped_text_is_ready(const RID &p_shaped) const { +bool TextServerFallback::_shaped_text_is_ready(const RID &p_shaped) const { const ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); @@ -3711,41 +3725,41 @@ bool TextServerFallback::shaped_text_is_ready(const RID &p_shaped) const { return sd->valid; } -const Glyph *TextServerFallback::shaped_text_get_glyphs(const RID &p_shaped) const { +const Glyph *TextServerFallback::_shaped_text_get_glyphs(const RID &p_shaped) const { const ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, nullptr); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerFallback *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerFallback *>(this)->_shaped_text_shape(p_shaped); } return sd->glyphs.ptr(); } -int64_t TextServerFallback::shaped_text_get_glyph_count(const RID &p_shaped) const { +int64_t TextServerFallback::_shaped_text_get_glyph_count(const RID &p_shaped) const { const ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerFallback *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerFallback *>(this)->_shaped_text_shape(p_shaped); } return sd->glyphs.size(); } -const Glyph *TextServerFallback::shaped_text_sort_logical(const RID &p_shaped) { +const Glyph *TextServerFallback::_shaped_text_sort_logical(const RID &p_shaped) { const ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, nullptr); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerFallback *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerFallback *>(this)->_shaped_text_shape(p_shaped); } return sd->glyphs.ptr(); // Already in the logical order, return as is. } -Vector2i TextServerFallback::shaped_text_get_range(const RID &p_shaped) const { +Vector2i TextServerFallback::_shaped_text_get_range(const RID &p_shaped) const { const ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, Vector2i()); @@ -3753,7 +3767,7 @@ Vector2i TextServerFallback::shaped_text_get_range(const RID &p_shaped) const { return Vector2(sd->start, sd->end); } -Array TextServerFallback::shaped_text_get_objects(const RID &p_shaped) const { +Array TextServerFallback::_shaped_text_get_objects(const RID &p_shaped) const { Array ret; const ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, ret); @@ -3766,25 +3780,25 @@ Array TextServerFallback::shaped_text_get_objects(const RID &p_shaped) const { return ret; } -Rect2 TextServerFallback::shaped_text_get_object_rect(const RID &p_shaped, const Variant &p_key) const { +Rect2 TextServerFallback::_shaped_text_get_object_rect(const RID &p_shaped, const Variant &p_key) const { const ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, Rect2()); MutexLock lock(sd->mutex); ERR_FAIL_COND_V(!sd->objects.has(p_key), Rect2()); if (!sd->valid) { - const_cast<TextServerFallback *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerFallback *>(this)->_shaped_text_shape(p_shaped); } return sd->objects[p_key].rect; } -Size2 TextServerFallback::shaped_text_get_size(const RID &p_shaped) const { +Size2 TextServerFallback::_shaped_text_get_size(const RID &p_shaped) const { const ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, Size2()); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerFallback *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerFallback *>(this)->_shaped_text_shape(p_shaped); } if (sd->orientation == TextServer::ORIENTATION_HORIZONTAL) { return Size2(sd->width, sd->ascent + sd->descent + sd->extra_spacing[SPACING_TOP] + sd->extra_spacing[SPACING_BOTTOM]).ceil(); @@ -3793,64 +3807,64 @@ Size2 TextServerFallback::shaped_text_get_size(const RID &p_shaped) const { } } -double TextServerFallback::shaped_text_get_ascent(const RID &p_shaped) const { +double TextServerFallback::_shaped_text_get_ascent(const RID &p_shaped) const { const ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.0); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerFallback *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerFallback *>(this)->_shaped_text_shape(p_shaped); } return sd->ascent + sd->extra_spacing[SPACING_TOP]; } -double TextServerFallback::shaped_text_get_descent(const RID &p_shaped) const { +double TextServerFallback::_shaped_text_get_descent(const RID &p_shaped) const { const ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.0); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerFallback *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerFallback *>(this)->_shaped_text_shape(p_shaped); } return sd->descent + sd->extra_spacing[SPACING_BOTTOM]; } -double TextServerFallback::shaped_text_get_width(const RID &p_shaped) const { +double TextServerFallback::_shaped_text_get_width(const RID &p_shaped) const { const ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.0); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerFallback *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerFallback *>(this)->_shaped_text_shape(p_shaped); } return Math::ceil(sd->width); } -double TextServerFallback::shaped_text_get_underline_position(const RID &p_shaped) const { +double TextServerFallback::_shaped_text_get_underline_position(const RID &p_shaped) const { const ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.0); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerFallback *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerFallback *>(this)->_shaped_text_shape(p_shaped); } return sd->upos; } -double TextServerFallback::shaped_text_get_underline_thickness(const RID &p_shaped) const { +double TextServerFallback::_shaped_text_get_underline_thickness(const RID &p_shaped) const { const ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.0); MutexLock lock(sd->mutex); if (!sd->valid) { - const_cast<TextServerFallback *>(this)->shaped_text_shape(p_shaped); + const_cast<TextServerFallback *>(this)->_shaped_text_shape(p_shaped); } return sd->uthk; } -String TextServerFallback::string_to_upper(const String &p_string, const String &p_language) const { +String TextServerFallback::_string_to_upper(const String &p_string, const String &p_language) const { String upper = p_string; for (int i = 0; i <= upper.length(); i++) { @@ -3864,7 +3878,7 @@ String TextServerFallback::string_to_upper(const String &p_string, const String return upper; } -String TextServerFallback::string_to_lower(const String &p_string, const String &p_language) const { +String TextServerFallback::_string_to_lower(const String &p_string, const String &p_language) const { String lower = p_string; for (int i = 0; i <= lower.length(); i++) { @@ -3878,7 +3892,7 @@ String TextServerFallback::string_to_lower(const String &p_string, const String return lower; } -PackedInt32Array TextServerFallback::string_get_word_breaks(const String &p_string, const String &p_language) const { +PackedInt32Array TextServerFallback::_string_get_word_breaks(const String &p_string, const String &p_language) const { PackedInt32Array ret; for (int i = 0; i < p_string.length(); i++) { char32_t c = p_string[i]; diff --git a/modules/text_server_fb/text_server_fb.h b/modules/text_server_fb/text_server_fb.h index 42f311f5ad..4aeec4f452 100644 --- a/modules/text_server_fb/text_server_fb.h +++ b/modules/text_server_fb/text_server_fb.h @@ -42,6 +42,7 @@ #include <godot_cpp/godot.hpp> #include <godot_cpp/core/class_db.hpp> +#include <godot_cpp/core/ext_wrappers.gen.inc> #include <godot_cpp/core/mutex_lock.hpp> #include <godot_cpp/variant/array.hpp> @@ -80,6 +81,7 @@ using namespace godot; #include "servers/text/text_server_extension.h" +#include "core/extension/ext_wrappers.gen.inc" #include "core/object/worker_thread_pool.h" #include "core/templates/hash_map.h" #include "core/templates/rid_owner.h" @@ -338,251 +340,249 @@ protected: void invalidate(ShapedTextDataFallback *p_shaped); public: - virtual bool has_feature(Feature p_feature) const override; - virtual String get_name() const override; - virtual int64_t get_features() const override; + MODBIND1RC(bool, has_feature, Feature); + MODBIND0RC(String, get_name); + MODBIND0RC(int64_t, get_features); - virtual void free_rid(const RID &p_rid) override; - virtual bool has(const RID &p_rid) override; - virtual bool load_support_data(const String &p_filename) override; + MODBIND1(free_rid, const RID &); + MODBIND1R(bool, has, const RID &); + MODBIND1R(bool, load_support_data, const String &); - virtual String get_support_data_filename() const override { - return ""; - }; - virtual String get_support_data_info() const override { - return "Not supported"; - }; - virtual bool save_support_data(const String &p_filename) const override; + MODBIND0RC(String, get_support_data_filename); + MODBIND0RC(String, get_support_data_info); + MODBIND1RC(bool, save_support_data, const String &); - virtual bool is_locale_right_to_left(const String &p_locale) const override; + MODBIND1RC(bool, is_locale_right_to_left, const String &); - virtual int64_t name_to_tag(const String &p_name) const override; - virtual String tag_to_name(int64_t p_tag) const override; + MODBIND1RC(int64_t, name_to_tag, const String &); + MODBIND1RC(String, tag_to_name, int64_t); /* Font interface */ - virtual RID create_font() override; - virtual void font_set_data(const RID &p_font_rid, const PackedByteArray &p_data) override; - virtual void font_set_data_ptr(const RID &p_font_rid, const uint8_t *p_data_ptr, int64_t p_data_size) override; + MODBIND0R(RID, create_font); + + MODBIND2(font_set_data, const RID &, const PackedByteArray &); + MODBIND3(font_set_data_ptr, const RID &, const uint8_t *, int64_t); + + MODBIND2(font_set_face_index, const RID &, int64_t); + MODBIND1RC(int64_t, font_get_face_index, const RID &); - virtual void font_set_face_index(const RID &p_font_rid, int64_t p_index) override; - virtual int64_t font_get_face_index(const RID &p_font_rid) const override; + MODBIND1RC(int64_t, font_get_face_count, const RID &); - virtual int64_t font_get_face_count(const RID &p_font_rid) const override; + MODBIND2(font_set_style, const RID &, BitField<FontStyle>); + MODBIND1RC(BitField<FontStyle>, font_get_style, const RID &); - virtual void font_set_style(const RID &p_font_rid, BitField<FontStyle> p_style) override; - virtual BitField<FontStyle> font_get_style(const RID &p_font_rid) const override; + MODBIND2(font_set_style_name, const RID &, const String &); + MODBIND1RC(String, font_get_style_name, const RID &); - virtual void font_set_style_name(const RID &p_font_rid, const String &p_name) override; - virtual String font_get_style_name(const RID &p_font_rid) const override; + MODBIND2(font_set_name, const RID &, const String &); + MODBIND1RC(String, font_get_name, const RID &); - virtual void font_set_name(const RID &p_font_rid, const String &p_name) override; - virtual String font_get_name(const RID &p_font_rid) const override; + MODBIND2(font_set_antialiasing, const RID &, TextServer::FontAntialiasing); + MODBIND1RC(TextServer::FontAntialiasing, font_get_antialiasing, const RID &); - virtual void font_set_antialiasing(RID p_font_rid, TextServer::FontAntialiasing p_antialiasing) override; - virtual TextServer::FontAntialiasing font_get_antialiasing(RID p_font_rid) const override; + MODBIND2(font_set_generate_mipmaps, const RID &, bool); + MODBIND1RC(bool, font_get_generate_mipmaps, const RID &); - virtual void font_set_generate_mipmaps(const RID &p_font_rid, bool p_generate_mipmaps) override; - virtual bool font_get_generate_mipmaps(const RID &p_font_rid) const override; + MODBIND2(font_set_multichannel_signed_distance_field, const RID &, bool); + MODBIND1RC(bool, font_is_multichannel_signed_distance_field, const RID &); - virtual void font_set_multichannel_signed_distance_field(const RID &p_font_rid, bool p_msdf) override; - virtual bool font_is_multichannel_signed_distance_field(const RID &p_font_rid) const override; + MODBIND2(font_set_msdf_pixel_range, const RID &, int64_t); + MODBIND1RC(int64_t, font_get_msdf_pixel_range, const RID &); - virtual void font_set_msdf_pixel_range(const RID &p_font_rid, int64_t p_msdf_pixel_range) override; - virtual int64_t font_get_msdf_pixel_range(const RID &p_font_rid) const override; + MODBIND2(font_set_msdf_size, const RID &, int64_t); + MODBIND1RC(int64_t, font_get_msdf_size, const RID &); - virtual void font_set_msdf_size(const RID &p_font_rid, int64_t p_msdf_size) override; - virtual int64_t font_get_msdf_size(const RID &p_font_rid) const override; + MODBIND2(font_set_fixed_size, const RID &, int64_t); + MODBIND1RC(int64_t, font_get_fixed_size, const RID &); - virtual void font_set_fixed_size(const RID &p_font_rid, int64_t p_fixed_size) override; - virtual int64_t font_get_fixed_size(const RID &p_font_rid) const override; + MODBIND2(font_set_force_autohinter, const RID &, bool); + MODBIND1RC(bool, font_is_force_autohinter, const RID &); - virtual void font_set_force_autohinter(const RID &p_font_rid, bool p_force_autohinter) override; - virtual bool font_is_force_autohinter(const RID &p_font_rid) const override; + MODBIND2(font_set_subpixel_positioning, const RID &, SubpixelPositioning); + MODBIND1RC(SubpixelPositioning, font_get_subpixel_positioning, const RID &); - virtual void font_set_hinting(const RID &p_font_rid, TextServer::Hinting p_hinting) override; - virtual TextServer::Hinting font_get_hinting(const RID &p_font_rid) const override; + MODBIND2(font_set_embolden, const RID &, double); + MODBIND1RC(double, font_get_embolden, const RID &); - virtual void font_set_subpixel_positioning(const RID &p_font_rid, SubpixelPositioning p_subpixel) override; - virtual SubpixelPositioning font_get_subpixel_positioning(const RID &p_font_rid) const override; + MODBIND2(font_set_transform, const RID &, const Transform2D &); + MODBIND1RC(Transform2D, font_get_transform, const RID &); - virtual void font_set_embolden(const RID &p_font_rid, double p_strength) override; - virtual double font_get_embolden(const RID &p_font_rid) const override; + MODBIND2(font_set_variation_coordinates, const RID &, const Dictionary &); + MODBIND1RC(Dictionary, font_get_variation_coordinates, const RID &); - virtual void font_set_transform(const RID &p_font_rid, const Transform2D &p_transform) override; - virtual Transform2D font_get_transform(const RID &p_font_rid) const override; + MODBIND2(font_set_hinting, const RID &, TextServer::Hinting); + MODBIND1RC(TextServer::Hinting, font_get_hinting, const RID &); - virtual void font_set_variation_coordinates(const RID &p_font_rid, const Dictionary &p_variation_coordinates) override; - virtual Dictionary font_get_variation_coordinates(const RID &p_font_rid) const override; + MODBIND2(font_set_oversampling, const RID &, double); + MODBIND1RC(double, font_get_oversampling, const RID &); - virtual void font_set_oversampling(const RID &p_font_rid, double p_oversampling) override; - virtual double font_get_oversampling(const RID &p_font_rid) const override; + MODBIND1RC(TypedArray<Vector2i>, font_get_size_cache_list, const RID &); + MODBIND1(font_clear_size_cache, const RID &); + MODBIND2(font_remove_size_cache, const RID &, const Vector2i &); - virtual TypedArray<Vector2i> font_get_size_cache_list(const RID &p_font_rid) const override; - virtual void font_clear_size_cache(const RID &p_font_rid) override; - virtual void font_remove_size_cache(const RID &p_font_rid, const Vector2i &p_size) override; + MODBIND3(font_set_ascent, const RID &, int64_t, double); + MODBIND2RC(double, font_get_ascent, const RID &, int64_t); - virtual void font_set_ascent(const RID &p_font_rid, int64_t p_size, double p_ascent) override; - virtual double font_get_ascent(const RID &p_font_rid, int64_t p_size) const override; + MODBIND3(font_set_descent, const RID &, int64_t, double); + MODBIND2RC(double, font_get_descent, const RID &, int64_t); - virtual void font_set_descent(const RID &p_font_rid, int64_t p_size, double p_descent) override; - virtual double font_get_descent(const RID &p_font_rid, int64_t p_size) const override; + MODBIND3(font_set_underline_position, const RID &, int64_t, double); + MODBIND2RC(double, font_get_underline_position, const RID &, int64_t); - virtual void font_set_underline_position(const RID &p_font_rid, int64_t p_size, double p_underline_position) override; - virtual double font_get_underline_position(const RID &p_font_rid, int64_t p_size) const override; + MODBIND3(font_set_underline_thickness, const RID &, int64_t, double); + MODBIND2RC(double, font_get_underline_thickness, const RID &, int64_t); - virtual void font_set_underline_thickness(const RID &p_font_rid, int64_t p_size, double p_underline_thickness) override; - virtual double font_get_underline_thickness(const RID &p_font_rid, int64_t p_size) const override; + MODBIND3(font_set_scale, const RID &, int64_t, double); + MODBIND2RC(double, font_get_scale, const RID &, int64_t); - virtual void font_set_scale(const RID &p_font_rid, int64_t p_size, double p_scale) override; - virtual double font_get_scale(const RID &p_font_rid, int64_t p_size) const override; + MODBIND2RC(int64_t, font_get_texture_count, const RID &, const Vector2i &); + MODBIND2(font_clear_textures, const RID &, const Vector2i &); + MODBIND3(font_remove_texture, const RID &, const Vector2i &, int64_t); - virtual int64_t font_get_texture_count(const RID &p_font_rid, const Vector2i &p_size) const override; - virtual void font_clear_textures(const RID &p_font_rid, const Vector2i &p_size) override; - virtual void font_remove_texture(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) override; + MODBIND4(font_set_texture_image, const RID &, const Vector2i &, int64_t, const Ref<Image> &); + MODBIND3RC(Ref<Image>, font_get_texture_image, const RID &, const Vector2i &, int64_t); - virtual void font_set_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const Ref<Image> &p_image) override; - virtual Ref<Image> font_get_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const override; + MODBIND4(font_set_texture_offsets, const RID &, const Vector2i &, int64_t, const PackedInt32Array &); + MODBIND3RC(PackedInt32Array, font_get_texture_offsets, const RID &, const Vector2i &, int64_t); - virtual void font_set_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const PackedInt32Array &p_offset) override; - virtual PackedInt32Array font_get_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const override; + MODBIND2RC(PackedInt32Array, font_get_glyph_list, const RID &, const Vector2i &); + MODBIND2(font_clear_glyphs, const RID &, const Vector2i &); + MODBIND3(font_remove_glyph, const RID &, const Vector2i &, int64_t); - virtual PackedInt32Array font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const override; - virtual void font_clear_glyphs(const RID &p_font_rid, const Vector2i &p_size) override; - virtual void font_remove_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) override; + MODBIND3RC(Vector2, font_get_glyph_advance, const RID &, int64_t, int64_t); + MODBIND4(font_set_glyph_advance, const RID &, int64_t, int64_t, const Vector2 &); - virtual Vector2 font_get_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph) const override; - virtual void font_set_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph, const Vector2 &p_advance) override; + MODBIND3RC(Vector2, font_get_glyph_offset, const RID &, const Vector2i &, int64_t); + MODBIND4(font_set_glyph_offset, const RID &, const Vector2i &, int64_t, const Vector2 &); - virtual Vector2 font_get_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; - virtual void font_set_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_offset) override; + MODBIND3RC(Vector2, font_get_glyph_size, const RID &, const Vector2i &, int64_t); + MODBIND4(font_set_glyph_size, const RID &, const Vector2i &, int64_t, const Vector2 &); - virtual Vector2 font_get_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; - virtual void font_set_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_gl_size) override; + MODBIND3RC(Rect2, font_get_glyph_uv_rect, const RID &, const Vector2i &, int64_t); + MODBIND4(font_set_glyph_uv_rect, const RID &, const Vector2i &, int64_t, const Rect2 &); - virtual Rect2 font_get_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; - virtual void font_set_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Rect2 &p_uv_rect) override; + MODBIND3RC(int64_t, font_get_glyph_texture_idx, const RID &, const Vector2i &, int64_t); + MODBIND4(font_set_glyph_texture_idx, const RID &, const Vector2i &, int64_t, int64_t); - virtual int64_t font_get_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; - virtual void font_set_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, int64_t p_texture_idx) override; - virtual RID font_get_glyph_texture_rid(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; - virtual Size2 font_get_glyph_texture_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; + MODBIND3RC(RID, font_get_glyph_texture_rid, const RID &, const Vector2i &, int64_t); + MODBIND3RC(Size2, font_get_glyph_texture_size, const RID &, const Vector2i &, int64_t); - virtual Dictionary font_get_glyph_contours(const RID &p_font, int64_t p_size, int64_t p_index) const override; + MODBIND3RC(Dictionary, font_get_glyph_contours, const RID &, int64_t, int64_t); - virtual TypedArray<Vector2i> font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const override; - virtual void font_clear_kerning_map(const RID &p_font_rid, int64_t p_size) override; - virtual void font_remove_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) override; + MODBIND2RC(TypedArray<Vector2i>, font_get_kerning_list, const RID &, int64_t); + MODBIND2(font_clear_kerning_map, const RID &, int64_t); + MODBIND3(font_remove_kerning, const RID &, int64_t, const Vector2i &); - virtual void font_set_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair, const Vector2 &p_kerning) override; - virtual Vector2 font_get_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) const override; + MODBIND4(font_set_kerning, const RID &, int64_t, const Vector2i &, const Vector2 &); + MODBIND3RC(Vector2, font_get_kerning, const RID &, int64_t, const Vector2i &); - virtual int64_t font_get_glyph_index(const RID &p_font_rid, int64_t p_size, int64_t p_char, int64_t p_variation_selector = 0) const override; + MODBIND4RC(int64_t, font_get_glyph_index, const RID &, int64_t, int64_t, int64_t); - virtual bool font_has_char(const RID &p_font_rid, int64_t p_char) const override; - virtual String font_get_supported_chars(const RID &p_font_rid) const override; + MODBIND2RC(bool, font_has_char, const RID &, int64_t); + MODBIND1RC(String, font_get_supported_chars, const RID &); - virtual void font_render_range(const RID &p_font, const Vector2i &p_size, int64_t p_start, int64_t p_end) override; - virtual void font_render_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_index) override; + MODBIND4(font_render_range, const RID &, const Vector2i &, int64_t, int64_t); + MODBIND3(font_render_glyph, const RID &, const Vector2i &, int64_t); - virtual void font_draw_glyph(const RID &p_font, const RID &p_canvas, int64_t p_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color = Color(1, 1, 1)) const override; - virtual void font_draw_glyph_outline(const RID &p_font, 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 = Color(1, 1, 1)) const override; + MODBIND6C(font_draw_glyph, const RID &, const RID &, int64_t, const Vector2 &, int64_t, const Color &); + MODBIND7C(font_draw_glyph_outline, const RID &, const RID &, int64_t, int64_t, const Vector2 &, int64_t, const Color &); - virtual bool font_is_language_supported(const RID &p_font_rid, const String &p_language) const override; - virtual void font_set_language_support_override(const RID &p_font_rid, const String &p_language, bool p_supported) override; - virtual bool font_get_language_support_override(const RID &p_font_rid, const String &p_language) override; - virtual void font_remove_language_support_override(const RID &p_font_rid, const String &p_language) override; - virtual PackedStringArray font_get_language_support_overrides(const RID &p_font_rid) override; + MODBIND2RC(bool, font_is_language_supported, const RID &, const String &); + MODBIND3(font_set_language_support_override, const RID &, const String &, bool); + MODBIND2R(bool, font_get_language_support_override, const RID &, const String &); + MODBIND2(font_remove_language_support_override, const RID &, const String &); + MODBIND1R(PackedStringArray, font_get_language_support_overrides, const RID &); - virtual bool font_is_script_supported(const RID &p_font_rid, const String &p_script) const override; - virtual void font_set_script_support_override(const RID &p_font_rid, const String &p_script, bool p_supported) override; - virtual bool font_get_script_support_override(const RID &p_font_rid, const String &p_script) override; - virtual void font_remove_script_support_override(const RID &p_font_rid, const String &p_script) override; - virtual PackedStringArray font_get_script_support_overrides(const RID &p_font_rid) override; + MODBIND2RC(bool, font_is_script_supported, const RID &, const String &); + MODBIND3(font_set_script_support_override, const RID &, const String &, bool); + MODBIND2R(bool, font_get_script_support_override, const RID &, const String &); + MODBIND2(font_remove_script_support_override, const RID &, const String &); + MODBIND1R(PackedStringArray, font_get_script_support_overrides, const RID &); - virtual void font_set_opentype_feature_overrides(const RID &p_font_rid, const Dictionary &p_overrides) override; - virtual Dictionary font_get_opentype_feature_overrides(const RID &p_font_rid) const override; + MODBIND2(font_set_opentype_feature_overrides, const RID &, const Dictionary &); + MODBIND1RC(Dictionary, font_get_opentype_feature_overrides, const RID &); - virtual Dictionary font_supported_feature_list(const RID &p_font_rid) const override; - virtual Dictionary font_supported_variation_list(const RID &p_font_rid) const override; + MODBIND1RC(Dictionary, font_supported_feature_list, const RID &); + MODBIND1RC(Dictionary, font_supported_variation_list, const RID &); - virtual double font_get_global_oversampling() const override; - virtual void font_set_global_oversampling(double p_oversampling) override; + MODBIND0RC(double, font_get_global_oversampling); + MODBIND1(font_set_global_oversampling, double); /* Shaped text buffer interface */ - virtual RID create_shaped_text(Direction p_direction = DIRECTION_AUTO, Orientation p_orientation = ORIENTATION_HORIZONTAL) override; + MODBIND2R(RID, create_shaped_text, Direction, Orientation); - virtual void shaped_text_clear(const RID &p_shaped) override; + MODBIND1(shaped_text_clear, const RID &); - virtual void shaped_text_set_direction(const RID &p_shaped, Direction p_direction = DIRECTION_AUTO) override; - virtual Direction shaped_text_get_direction(const RID &p_shaped) const override; - virtual Direction shaped_text_get_inferred_direction(const RID &p_shaped) const override; + MODBIND2(shaped_text_set_direction, const RID &, Direction); + MODBIND1RC(Direction, shaped_text_get_direction, const RID &); + MODBIND1RC(Direction, shaped_text_get_inferred_direction, const RID &); - virtual void shaped_text_set_bidi_override(const RID &p_shaped, const Array &p_override) override; + MODBIND2(shaped_text_set_bidi_override, const RID &, const Array &); - virtual void shaped_text_set_custom_punctuation(const RID &p_shaped, const String &p_punct) override; - virtual String shaped_text_get_custom_punctuation(const RID &p_shaped) const override; + MODBIND2(shaped_text_set_custom_punctuation, const RID &, const String &); + MODBIND1RC(String, shaped_text_get_custom_punctuation, const RID &); - virtual void shaped_text_set_orientation(const RID &p_shaped, Orientation p_orientation = ORIENTATION_HORIZONTAL) override; - virtual Orientation shaped_text_get_orientation(const RID &p_shaped) const override; + MODBIND2(shaped_text_set_orientation, const RID &, Orientation); + MODBIND1RC(Orientation, shaped_text_get_orientation, const RID &); - virtual void shaped_text_set_preserve_invalid(const RID &p_shaped, bool p_enabled) override; - virtual bool shaped_text_get_preserve_invalid(const RID &p_shaped) const override; + MODBIND2(shaped_text_set_preserve_invalid, const RID &, bool); + MODBIND1RC(bool, shaped_text_get_preserve_invalid, const RID &); - virtual void shaped_text_set_preserve_control(const RID &p_shaped, bool p_enabled) override; - virtual bool shaped_text_get_preserve_control(const RID &p_shaped) const override; + MODBIND2(shaped_text_set_preserve_control, const RID &, bool); + MODBIND1RC(bool, shaped_text_get_preserve_control, const RID &); - virtual void shaped_text_set_spacing(const RID &p_shaped, SpacingType p_spacing, int64_t p_value) override; - virtual int64_t shaped_text_get_spacing(const RID &p_shaped, SpacingType p_spacing) const override; + MODBIND3(shaped_text_set_spacing, const RID &, SpacingType, int64_t); + MODBIND2RC(int64_t, shaped_text_get_spacing, const RID &, SpacingType); - virtual bool 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 = Dictionary(), const String &p_language = "", const Variant &p_meta = Variant()) override; - virtual bool shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, int64_t p_length = 1) override; - virtual bool shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER) override; + MODBIND7R(bool, shaped_text_add_string, const RID &, const String &, const TypedArray<RID> &, int64_t, const Dictionary &, const String &, const Variant &); + MODBIND5R(bool, shaped_text_add_object, const RID &, const Variant &, const Size2 &, InlineAlignment, int64_t); + MODBIND4R(bool, shaped_text_resize_object, const RID &, const Variant &, const Size2 &, InlineAlignment); - virtual int64_t shaped_get_span_count(const RID &p_shaped) const override; - virtual Variant shaped_get_span_meta(const RID &p_shaped, int64_t p_index) const override; - virtual void 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 = Dictionary()) override; + MODBIND1RC(int64_t, shaped_get_span_count, const RID &); + MODBIND2RC(Variant, shaped_get_span_meta, const RID &, int64_t); + MODBIND5(shaped_set_span_update_font, const RID &, int64_t, const TypedArray<RID> &, int64_t, const Dictionary &); - virtual RID shaped_text_substr(const RID &p_shaped, int64_t p_start, int64_t p_length) const override; - virtual RID shaped_text_get_parent(const RID &p_shaped) const override; + MODBIND3RC(RID, shaped_text_substr, const RID &, int64_t, int64_t); + MODBIND1RC(RID, shaped_text_get_parent, const RID &); - virtual double shaped_text_fit_to_width(const RID &p_shaped, double p_width, BitField<TextServer::JustificationFlag> p_jst_flags = JUSTIFICATION_WORD_BOUND | JUSTIFICATION_KASHIDA) override; - virtual double shaped_text_tab_align(const RID &p_shaped, const PackedFloat32Array &p_tab_stops) override; + MODBIND3R(double, shaped_text_fit_to_width, const RID &, double, BitField<TextServer::JustificationFlag>); + MODBIND2R(double, shaped_text_tab_align, const RID &, const PackedFloat32Array &); - virtual bool shaped_text_shape(const RID &p_shaped) override; - virtual bool shaped_text_update_breaks(const RID &p_shaped) override; - virtual bool shaped_text_update_justification_ops(const RID &p_shaped) override; + MODBIND1R(bool, shaped_text_shape, const RID &); + MODBIND1R(bool, shaped_text_update_breaks, const RID &); + MODBIND1R(bool, shaped_text_update_justification_ops, const RID &); - virtual int64_t shaped_text_get_trim_pos(const RID &p_shaped) const override; - virtual int64_t shaped_text_get_ellipsis_pos(const RID &p_shaped) const override; - virtual const Glyph *shaped_text_get_ellipsis_glyphs(const RID &p_shaped) const override; - virtual int64_t shaped_text_get_ellipsis_glyph_count(const RID &p_shaped) const override; + MODBIND1RC(int64_t, shaped_text_get_trim_pos, const RID &); + MODBIND1RC(int64_t, shaped_text_get_ellipsis_pos, const RID &); + MODBIND1RC(const Glyph *, shaped_text_get_ellipsis_glyphs, const RID &); + MODBIND1RC(int64_t, shaped_text_get_ellipsis_glyph_count, const RID &); - virtual void shaped_text_overrun_trim_to_width(const RID &p_shaped, double p_width, BitField<TextServer::TextOverrunFlag> p_trim_flags) override; + MODBIND3(shaped_text_overrun_trim_to_width, const RID &, double, BitField<TextServer::TextOverrunFlag>); - virtual bool shaped_text_is_ready(const RID &p_shaped) const override; + MODBIND1RC(bool, shaped_text_is_ready, const RID &); - virtual const Glyph *shaped_text_get_glyphs(const RID &p_shaped) const override; - virtual const Glyph *shaped_text_sort_logical(const RID &p_shaped) override; - virtual int64_t shaped_text_get_glyph_count(const RID &p_shaped) const override; + MODBIND1RC(const Glyph *, shaped_text_get_glyphs, const RID &); + MODBIND1R(const Glyph *, shaped_text_sort_logical, const RID &); + MODBIND1RC(int64_t, shaped_text_get_glyph_count, const RID &); - virtual Vector2i shaped_text_get_range(const RID &p_shaped) const override; + MODBIND1RC(Vector2i, shaped_text_get_range, const RID &); - virtual Array shaped_text_get_objects(const RID &p_shaped) const override; - virtual Rect2 shaped_text_get_object_rect(const RID &p_shaped, const Variant &p_key) const override; + MODBIND1RC(Array, shaped_text_get_objects, const RID &); + MODBIND2RC(Rect2, shaped_text_get_object_rect, const RID &, const Variant &); - virtual Size2 shaped_text_get_size(const RID &p_shaped) const override; - virtual double shaped_text_get_ascent(const RID &p_shaped) const override; - virtual double shaped_text_get_descent(const RID &p_shaped) const override; - virtual double shaped_text_get_width(const RID &p_shaped) const override; - virtual double shaped_text_get_underline_position(const RID &p_shaped) const override; - virtual double shaped_text_get_underline_thickness(const RID &p_shaped) const override; + MODBIND1RC(Size2, shaped_text_get_size, const RID &); + MODBIND1RC(double, shaped_text_get_ascent, const RID &); + MODBIND1RC(double, shaped_text_get_descent, const RID &); + MODBIND1RC(double, shaped_text_get_width, const RID &); + MODBIND1RC(double, shaped_text_get_underline_position, const RID &); + MODBIND1RC(double, shaped_text_get_underline_thickness, const RID &); - virtual PackedInt32Array string_get_word_breaks(const String &p_string, const String &p_language = "") const override; + MODBIND2RC(PackedInt32Array, string_get_word_breaks, const String &, const String &); - virtual String string_to_upper(const String &p_string, const String &p_language = "") const override; - virtual String string_to_lower(const String &p_string, const String &p_language = "") const override; + MODBIND2RC(String, string_to_upper, const String &, const String &); + MODBIND2RC(String, string_to_lower, const String &, const String &); TextServerFallback(); ~TextServerFallback(); diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index b9e6f7b843..77b20dd924 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -2554,24 +2554,27 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA if ((tablet_get_current_driver() == "wintab") && wintab_available && windows[window_id].wtctx) { PACKET packet; if (wintab_WTPacket(windows[window_id].wtctx, wParam, &packet)) { - float pressure = float(packet.pkNormalPressure - windows[window_id].min_pressure) / float(windows[window_id].max_pressure - windows[window_id].min_pressure); - windows[window_id].last_pressure = pressure; + POINT coords; + GetCursorPos(&coords); + ScreenToClient(windows[window_id].hWnd, &coords); + windows[window_id].last_pressure_update = 0; + float pressure = float(packet.pkNormalPressure - windows[window_id].min_pressure) / float(windows[window_id].max_pressure - windows[window_id].min_pressure); double azim = (packet.pkOrientation.orAzimuth / 10.0f) * (Math_PI / 180); double alt = Math::tan((Math::abs(packet.pkOrientation.orAltitude / 10.0f)) * (Math_PI / 180)); + bool inverted = packet.pkStatus & TPS_INVERT; - if (windows[window_id].tilt_supported) { - windows[window_id].last_tilt = Vector2(Math::atan(Math::sin(azim) / alt), Math::atan(Math::cos(azim) / alt)); - } else { - windows[window_id].last_tilt = Vector2(); - } + Vector2 tilt = (windows[window_id].tilt_supported) ? Vector2(Math::atan(Math::sin(azim) / alt), Math::atan(Math::cos(azim) / alt)) : Vector2(); - windows[window_id].last_pen_inverted = packet.pkStatus & TPS_INVERT; + // Nothing changed, ignore event. + if (!old_invalid && coords.x == old_x && coords.y == old_y && windows[window_id].last_pressure == pressure && windows[window_id].last_tilt == tilt && windows[window_id].last_pen_inverted == inverted) { + break; + } - POINT coords; - GetCursorPos(&coords); - ScreenToClient(windows[window_id].hWnd, &coords); + windows[window_id].last_pressure = pressure; + windows[window_id].last_tilt = tilt; + windows[window_id].last_pen_inverted = inverted; // Don't calculate relative mouse movement if we don't have focus in CAPTURED mode. if (!windows[window_id].window_has_focus && mouse_mode == MOUSE_MODE_CAPTURED) { diff --git a/servers/text/text_server_extension.cpp b/servers/text/text_server_extension.cpp index 7a8a298dbd..0e1069dcf4 100644 --- a/servers/text/text_server_extension.cpp +++ b/servers/text/text_server_extension.cpp @@ -31,288 +31,288 @@ #include "text_server_extension.h" void TextServerExtension::_bind_methods() { - GDVIRTUAL_BIND(has_feature, "feature"); - GDVIRTUAL_BIND(get_name); - GDVIRTUAL_BIND(get_features); + GDVIRTUAL_BIND(_has_feature, "feature"); + GDVIRTUAL_BIND(_get_name); + GDVIRTUAL_BIND(_get_features); - GDVIRTUAL_BIND(free_rid, "rid"); - GDVIRTUAL_BIND(has, "rid"); - GDVIRTUAL_BIND(load_support_data, "filename"); + GDVIRTUAL_BIND(_free_rid, "rid"); + GDVIRTUAL_BIND(_has, "rid"); + GDVIRTUAL_BIND(_load_support_data, "filename"); - GDVIRTUAL_BIND(get_support_data_filename); - GDVIRTUAL_BIND(get_support_data_info); - GDVIRTUAL_BIND(save_support_data, "filename"); + GDVIRTUAL_BIND(_get_support_data_filename); + GDVIRTUAL_BIND(_get_support_data_info); + GDVIRTUAL_BIND(_save_support_data, "filename"); - GDVIRTUAL_BIND(is_locale_right_to_left, "locale"); + GDVIRTUAL_BIND(_is_locale_right_to_left, "locale"); - GDVIRTUAL_BIND(name_to_tag, "name"); - GDVIRTUAL_BIND(tag_to_name, "tag"); + GDVIRTUAL_BIND(_name_to_tag, "name"); + GDVIRTUAL_BIND(_tag_to_name, "tag"); /* Font interface */ - GDVIRTUAL_BIND(create_font); + GDVIRTUAL_BIND(_create_font); - GDVIRTUAL_BIND(font_set_data, "font_rid", "data"); - GDVIRTUAL_BIND(font_set_data_ptr, "font_rid", "data_ptr", "data_size"); + GDVIRTUAL_BIND(_font_set_data, "font_rid", "data"); + GDVIRTUAL_BIND(_font_set_data_ptr, "font_rid", "data_ptr", "data_size"); - GDVIRTUAL_BIND(font_set_face_index, "font_rid", "face_index"); - GDVIRTUAL_BIND(font_get_face_index, "font_rid"); + GDVIRTUAL_BIND(_font_set_face_index, "font_rid", "face_index"); + GDVIRTUAL_BIND(_font_get_face_index, "font_rid"); - GDVIRTUAL_BIND(font_get_face_count, "font_rid"); + GDVIRTUAL_BIND(_font_get_face_count, "font_rid"); - GDVIRTUAL_BIND(font_set_style, "font_rid", "style"); - GDVIRTUAL_BIND(font_get_style, "font_rid"); + GDVIRTUAL_BIND(_font_set_style, "font_rid", "style"); + GDVIRTUAL_BIND(_font_get_style, "font_rid"); - GDVIRTUAL_BIND(font_set_name, "font_rid", "name"); - GDVIRTUAL_BIND(font_get_name, "font_rid"); + GDVIRTUAL_BIND(_font_set_name, "font_rid", "name"); + GDVIRTUAL_BIND(_font_get_name, "font_rid"); - GDVIRTUAL_BIND(font_set_style_name, "font_rid", "name_style"); - GDVIRTUAL_BIND(font_get_style_name, "font_rid"); + GDVIRTUAL_BIND(_font_set_style_name, "font_rid", "name_style"); + GDVIRTUAL_BIND(_font_get_style_name, "font_rid"); - GDVIRTUAL_BIND(font_set_antialiasing, "font_rid", "antialiasing"); - GDVIRTUAL_BIND(font_get_antialiasing, "font_rid"); + GDVIRTUAL_BIND(_font_set_antialiasing, "font_rid", "antialiasing"); + GDVIRTUAL_BIND(_font_get_antialiasing, "font_rid"); - GDVIRTUAL_BIND(font_set_generate_mipmaps, "font_rid", "generate_mipmaps"); - GDVIRTUAL_BIND(font_get_generate_mipmaps, "font_rid"); + GDVIRTUAL_BIND(_font_set_generate_mipmaps, "font_rid", "generate_mipmaps"); + GDVIRTUAL_BIND(_font_get_generate_mipmaps, "font_rid"); - GDVIRTUAL_BIND(font_set_multichannel_signed_distance_field, "font_rid", "msdf"); - GDVIRTUAL_BIND(font_is_multichannel_signed_distance_field, "font_rid"); + GDVIRTUAL_BIND(_font_set_multichannel_signed_distance_field, "font_rid", "msdf"); + GDVIRTUAL_BIND(_font_is_multichannel_signed_distance_field, "font_rid"); - GDVIRTUAL_BIND(font_set_msdf_pixel_range, "font_rid", "msdf_pixel_range"); - GDVIRTUAL_BIND(font_get_msdf_pixel_range, "font_rid"); + GDVIRTUAL_BIND(_font_set_msdf_pixel_range, "font_rid", "msdf_pixel_range"); + GDVIRTUAL_BIND(_font_get_msdf_pixel_range, "font_rid"); - GDVIRTUAL_BIND(font_set_msdf_size, "font_rid", "msdf_size"); - GDVIRTUAL_BIND(font_get_msdf_size, "font_rid"); + GDVIRTUAL_BIND(_font_set_msdf_size, "font_rid", "msdf_size"); + GDVIRTUAL_BIND(_font_get_msdf_size, "font_rid"); - GDVIRTUAL_BIND(font_set_fixed_size, "font_rid", "fixed_size"); - GDVIRTUAL_BIND(font_get_fixed_size, "font_rid"); + GDVIRTUAL_BIND(_font_set_fixed_size, "font_rid", "fixed_size"); + GDVIRTUAL_BIND(_font_get_fixed_size, "font_rid"); - GDVIRTUAL_BIND(font_set_force_autohinter, "font_rid", "force_autohinter"); - GDVIRTUAL_BIND(font_is_force_autohinter, "font_rid"); + GDVIRTUAL_BIND(_font_set_force_autohinter, "font_rid", "force_autohinter"); + GDVIRTUAL_BIND(_font_is_force_autohinter, "font_rid"); - GDVIRTUAL_BIND(font_set_hinting, "font_rid", "hinting"); - GDVIRTUAL_BIND(font_get_hinting, "font_rid"); + GDVIRTUAL_BIND(_font_set_hinting, "font_rid", "hinting"); + GDVIRTUAL_BIND(_font_get_hinting, "font_rid"); - GDVIRTUAL_BIND(font_set_subpixel_positioning, "font_rid", "subpixel_positioning"); - GDVIRTUAL_BIND(font_get_subpixel_positioning, "font_rid"); + GDVIRTUAL_BIND(_font_set_subpixel_positioning, "font_rid", "subpixel_positioning"); + GDVIRTUAL_BIND(_font_get_subpixel_positioning, "font_rid"); - GDVIRTUAL_BIND(font_set_embolden, "font_rid", "strength"); - GDVIRTUAL_BIND(font_get_embolden, "font_rid"); + GDVIRTUAL_BIND(_font_set_embolden, "font_rid", "strength"); + GDVIRTUAL_BIND(_font_get_embolden, "font_rid"); - GDVIRTUAL_BIND(font_set_transform, "font_rid", "transform"); - GDVIRTUAL_BIND(font_get_transform, "font_rid"); + GDVIRTUAL_BIND(_font_set_transform, "font_rid", "transform"); + GDVIRTUAL_BIND(_font_get_transform, "font_rid"); - GDVIRTUAL_BIND(font_set_variation_coordinates, "font_rid", "variation_coordinates"); - GDVIRTUAL_BIND(font_get_variation_coordinates, "font_rid"); + GDVIRTUAL_BIND(_font_set_variation_coordinates, "font_rid", "variation_coordinates"); + GDVIRTUAL_BIND(_font_get_variation_coordinates, "font_rid"); - GDVIRTUAL_BIND(font_set_oversampling, "font_rid", "oversampling"); - GDVIRTUAL_BIND(font_get_oversampling, "font_rid"); + GDVIRTUAL_BIND(_font_set_oversampling, "font_rid", "oversampling"); + GDVIRTUAL_BIND(_font_get_oversampling, "font_rid"); - GDVIRTUAL_BIND(font_get_size_cache_list, "font_rid"); - GDVIRTUAL_BIND(font_clear_size_cache, "font_rid"); - GDVIRTUAL_BIND(font_remove_size_cache, "font_rid", "size"); + GDVIRTUAL_BIND(_font_get_size_cache_list, "font_rid"); + GDVIRTUAL_BIND(_font_clear_size_cache, "font_rid"); + GDVIRTUAL_BIND(_font_remove_size_cache, "font_rid", "size"); - GDVIRTUAL_BIND(font_set_ascent, "font_rid", "size", "ascent"); - GDVIRTUAL_BIND(font_get_ascent, "font_rid", "size"); + GDVIRTUAL_BIND(_font_set_ascent, "font_rid", "size", "ascent"); + GDVIRTUAL_BIND(_font_get_ascent, "font_rid", "size"); - GDVIRTUAL_BIND(font_set_descent, "font_rid", "size", "descent"); - GDVIRTUAL_BIND(font_get_descent, "font_rid", "size"); + GDVIRTUAL_BIND(_font_set_descent, "font_rid", "size", "descent"); + GDVIRTUAL_BIND(_font_get_descent, "font_rid", "size"); - GDVIRTUAL_BIND(font_set_underline_position, "font_rid", "size", "underline_position"); - GDVIRTUAL_BIND(font_get_underline_position, "font_rid", "size"); + GDVIRTUAL_BIND(_font_set_underline_position, "font_rid", "size", "underline_position"); + GDVIRTUAL_BIND(_font_get_underline_position, "font_rid", "size"); - GDVIRTUAL_BIND(font_set_underline_thickness, "font_rid", "size", "underline_thickness"); - GDVIRTUAL_BIND(font_get_underline_thickness, "font_rid", "size"); + GDVIRTUAL_BIND(_font_set_underline_thickness, "font_rid", "size", "underline_thickness"); + GDVIRTUAL_BIND(_font_get_underline_thickness, "font_rid", "size"); - GDVIRTUAL_BIND(font_set_scale, "font_rid", "size", "scale"); - GDVIRTUAL_BIND(font_get_scale, "font_rid", "size"); + GDVIRTUAL_BIND(_font_set_scale, "font_rid", "size", "scale"); + GDVIRTUAL_BIND(_font_get_scale, "font_rid", "size"); - GDVIRTUAL_BIND(font_get_texture_count, "font_rid", "size"); - GDVIRTUAL_BIND(font_clear_textures, "font_rid", "size"); - GDVIRTUAL_BIND(font_remove_texture, "font_rid", "size", "texture_index"); + GDVIRTUAL_BIND(_font_get_texture_count, "font_rid", "size"); + GDVIRTUAL_BIND(_font_clear_textures, "font_rid", "size"); + GDVIRTUAL_BIND(_font_remove_texture, "font_rid", "size", "texture_index"); - GDVIRTUAL_BIND(font_set_texture_image, "font_rid", "size", "texture_index", "image"); - GDVIRTUAL_BIND(font_get_texture_image, "font_rid", "size", "texture_index"); + GDVIRTUAL_BIND(_font_set_texture_image, "font_rid", "size", "texture_index", "image"); + GDVIRTUAL_BIND(_font_get_texture_image, "font_rid", "size", "texture_index"); - GDVIRTUAL_BIND(font_set_texture_offsets, "font_rid", "size", "texture_index", "offset"); - GDVIRTUAL_BIND(font_get_texture_offsets, "font_rid", "size", "texture_index"); + GDVIRTUAL_BIND(_font_set_texture_offsets, "font_rid", "size", "texture_index", "offset"); + GDVIRTUAL_BIND(_font_get_texture_offsets, "font_rid", "size", "texture_index"); - GDVIRTUAL_BIND(font_get_glyph_list, "font_rid", "size"); - GDVIRTUAL_BIND(font_clear_glyphs, "font_rid", "size"); - GDVIRTUAL_BIND(font_remove_glyph, "font_rid", "size", "glyph"); + GDVIRTUAL_BIND(_font_get_glyph_list, "font_rid", "size"); + GDVIRTUAL_BIND(_font_clear_glyphs, "font_rid", "size"); + GDVIRTUAL_BIND(_font_remove_glyph, "font_rid", "size", "glyph"); - GDVIRTUAL_BIND(font_get_glyph_advance, "font_rid", "size", "glyph"); - GDVIRTUAL_BIND(font_set_glyph_advance, "font_rid", "size", "glyph", "advance"); + GDVIRTUAL_BIND(_font_get_glyph_advance, "font_rid", "size", "glyph"); + GDVIRTUAL_BIND(_font_set_glyph_advance, "font_rid", "size", "glyph", "advance"); - GDVIRTUAL_BIND(font_get_glyph_offset, "font_rid", "size", "glyph"); - GDVIRTUAL_BIND(font_set_glyph_offset, "font_rid", "size", "glyph", "offset"); + GDVIRTUAL_BIND(_font_get_glyph_offset, "font_rid", "size", "glyph"); + GDVIRTUAL_BIND(_font_set_glyph_offset, "font_rid", "size", "glyph", "offset"); - GDVIRTUAL_BIND(font_get_glyph_size, "font_rid", "size", "glyph"); - GDVIRTUAL_BIND(font_set_glyph_size, "font_rid", "size", "glyph", "gl_size"); + GDVIRTUAL_BIND(_font_get_glyph_size, "font_rid", "size", "glyph"); + GDVIRTUAL_BIND(_font_set_glyph_size, "font_rid", "size", "glyph", "gl_size"); - GDVIRTUAL_BIND(font_get_glyph_uv_rect, "font_rid", "size", "glyph"); - GDVIRTUAL_BIND(font_set_glyph_uv_rect, "font_rid", "size", "glyph", "uv_rect"); + GDVIRTUAL_BIND(_font_get_glyph_uv_rect, "font_rid", "size", "glyph"); + GDVIRTUAL_BIND(_font_set_glyph_uv_rect, "font_rid", "size", "glyph", "uv_rect"); - GDVIRTUAL_BIND(font_get_glyph_texture_idx, "font_rid", "size", "glyph"); - GDVIRTUAL_BIND(font_set_glyph_texture_idx, "font_rid", "size", "glyph", "texture_idx"); + GDVIRTUAL_BIND(_font_get_glyph_texture_idx, "font_rid", "size", "glyph"); + GDVIRTUAL_BIND(_font_set_glyph_texture_idx, "font_rid", "size", "glyph", "texture_idx"); - GDVIRTUAL_BIND(font_get_glyph_texture_rid, "font_rid", "size", "glyph"); - GDVIRTUAL_BIND(font_get_glyph_texture_size, "font_rid", "size", "glyph"); + GDVIRTUAL_BIND(_font_get_glyph_texture_rid, "font_rid", "size", "glyph"); + GDVIRTUAL_BIND(_font_get_glyph_texture_size, "font_rid", "size", "glyph"); - GDVIRTUAL_BIND(font_get_glyph_contours, "font_rid", "size", "index"); + GDVIRTUAL_BIND(_font_get_glyph_contours, "font_rid", "size", "index"); - GDVIRTUAL_BIND(font_get_kerning_list, "font_rid", "size"); - GDVIRTUAL_BIND(font_clear_kerning_map, "font_rid", "size"); - GDVIRTUAL_BIND(font_remove_kerning, "font_rid", "size", "glyph_pair"); + GDVIRTUAL_BIND(_font_get_kerning_list, "font_rid", "size"); + GDVIRTUAL_BIND(_font_clear_kerning_map, "font_rid", "size"); + GDVIRTUAL_BIND(_font_remove_kerning, "font_rid", "size", "glyph_pair"); - GDVIRTUAL_BIND(font_set_kerning, "font_rid", "size", "glyph_pair", "kerning"); - GDVIRTUAL_BIND(font_get_kerning, "font_rid", "size", "glyph_pair"); + GDVIRTUAL_BIND(_font_set_kerning, "font_rid", "size", "glyph_pair", "kerning"); + GDVIRTUAL_BIND(_font_get_kerning, "font_rid", "size", "glyph_pair"); - GDVIRTUAL_BIND(font_get_glyph_index, "font_rid", "size", "char", "variation_selector"); + GDVIRTUAL_BIND(_font_get_glyph_index, "font_rid", "size", "char", "variation_selector"); - GDVIRTUAL_BIND(font_has_char, "font_rid", "char"); - GDVIRTUAL_BIND(font_get_supported_chars, "font_rid"); + GDVIRTUAL_BIND(_font_has_char, "font_rid", "char"); + GDVIRTUAL_BIND(_font_get_supported_chars, "font_rid"); - GDVIRTUAL_BIND(font_render_range, "font_rid", "size", "start", "end"); - GDVIRTUAL_BIND(font_render_glyph, "font_rid", "size", "index"); + GDVIRTUAL_BIND(_font_render_range, "font_rid", "size", "start", "end"); + GDVIRTUAL_BIND(_font_render_glyph, "font_rid", "size", "index"); - GDVIRTUAL_BIND(font_draw_glyph, "font_rid", "canvas", "size", "pos", "index", "color"); - GDVIRTUAL_BIND(font_draw_glyph_outline, "font_rid", "canvas", "size", "outline_size", "pos", "index", "color"); + GDVIRTUAL_BIND(_font_draw_glyph, "font_rid", "canvas", "size", "pos", "index", "color"); + GDVIRTUAL_BIND(_font_draw_glyph_outline, "font_rid", "canvas", "size", "outline_size", "pos", "index", "color"); - GDVIRTUAL_BIND(font_is_language_supported, "font_rid", "language"); - GDVIRTUAL_BIND(font_set_language_support_override, "font_rid", "language", "supported"); - GDVIRTUAL_BIND(font_get_language_support_override, "font_rid", "language"); - GDVIRTUAL_BIND(font_remove_language_support_override, "font_rid", "language"); - GDVIRTUAL_BIND(font_get_language_support_overrides, "font_rid"); + GDVIRTUAL_BIND(_font_is_language_supported, "font_rid", "language"); + GDVIRTUAL_BIND(_font_set_language_support_override, "font_rid", "language", "supported"); + GDVIRTUAL_BIND(_font_get_language_support_override, "font_rid", "language"); + GDVIRTUAL_BIND(_font_remove_language_support_override, "font_rid", "language"); + GDVIRTUAL_BIND(_font_get_language_support_overrides, "font_rid"); - GDVIRTUAL_BIND(font_is_script_supported, "font_rid", "script"); - GDVIRTUAL_BIND(font_set_script_support_override, "font_rid", "script", "supported"); - GDVIRTUAL_BIND(font_get_script_support_override, "font_rid", "script"); - GDVIRTUAL_BIND(font_remove_script_support_override, "font_rid", "script"); - GDVIRTUAL_BIND(font_get_script_support_overrides, "font_rid"); + GDVIRTUAL_BIND(_font_is_script_supported, "font_rid", "script"); + GDVIRTUAL_BIND(_font_set_script_support_override, "font_rid", "script", "supported"); + GDVIRTUAL_BIND(_font_get_script_support_override, "font_rid", "script"); + GDVIRTUAL_BIND(_font_remove_script_support_override, "font_rid", "script"); + GDVIRTUAL_BIND(_font_get_script_support_overrides, "font_rid"); - GDVIRTUAL_BIND(font_set_opentype_feature_overrides, "font_rid", "overrides"); - GDVIRTUAL_BIND(font_get_opentype_feature_overrides, "font_rid"); + GDVIRTUAL_BIND(_font_set_opentype_feature_overrides, "font_rid", "overrides"); + GDVIRTUAL_BIND(_font_get_opentype_feature_overrides, "font_rid"); - GDVIRTUAL_BIND(font_supported_feature_list, "font_rid"); - GDVIRTUAL_BIND(font_supported_variation_list, "font_rid"); + GDVIRTUAL_BIND(_font_supported_feature_list, "font_rid"); + GDVIRTUAL_BIND(_font_supported_variation_list, "font_rid"); - GDVIRTUAL_BIND(font_get_global_oversampling); - GDVIRTUAL_BIND(font_set_global_oversampling, "oversampling"); + GDVIRTUAL_BIND(_font_get_global_oversampling); + GDVIRTUAL_BIND(_font_set_global_oversampling, "oversampling"); - GDVIRTUAL_BIND(get_hex_code_box_size, "size", "index"); - GDVIRTUAL_BIND(draw_hex_code_box, "canvas", "size", "pos", "index", "color"); + GDVIRTUAL_BIND(_get_hex_code_box_size, "size", "index"); + GDVIRTUAL_BIND(_draw_hex_code_box, "canvas", "size", "pos", "index", "color"); /* Shaped text buffer interface */ - GDVIRTUAL_BIND(create_shaped_text, "direction", "orientation"); + GDVIRTUAL_BIND(_create_shaped_text, "direction", "orientation"); - GDVIRTUAL_BIND(shaped_text_clear, "shaped"); + GDVIRTUAL_BIND(_shaped_text_clear, "shaped"); - GDVIRTUAL_BIND(shaped_text_set_direction, "shaped", "direction"); - GDVIRTUAL_BIND(shaped_text_get_direction, "shaped"); - GDVIRTUAL_BIND(shaped_text_get_inferred_direction, "shaped"); + GDVIRTUAL_BIND(_shaped_text_set_direction, "shaped", "direction"); + GDVIRTUAL_BIND(_shaped_text_get_direction, "shaped"); + GDVIRTUAL_BIND(_shaped_text_get_inferred_direction, "shaped"); - GDVIRTUAL_BIND(shaped_text_set_bidi_override, "shaped", "override"); + GDVIRTUAL_BIND(_shaped_text_set_bidi_override, "shaped", "override"); - GDVIRTUAL_BIND(shaped_text_set_custom_punctuation, "shaped", "punct"); - GDVIRTUAL_BIND(shaped_text_get_custom_punctuation, "shaped"); + GDVIRTUAL_BIND(_shaped_text_set_custom_punctuation, "shaped", "punct"); + GDVIRTUAL_BIND(_shaped_text_get_custom_punctuation, "shaped"); - GDVIRTUAL_BIND(shaped_text_set_orientation, "shaped", "orientation"); - GDVIRTUAL_BIND(shaped_text_get_orientation, "shaped"); + GDVIRTUAL_BIND(_shaped_text_set_orientation, "shaped", "orientation"); + GDVIRTUAL_BIND(_shaped_text_get_orientation, "shaped"); - GDVIRTUAL_BIND(shaped_text_set_preserve_invalid, "shaped", "enabled"); - GDVIRTUAL_BIND(shaped_text_get_preserve_invalid, "shaped"); + GDVIRTUAL_BIND(_shaped_text_set_preserve_invalid, "shaped", "enabled"); + GDVIRTUAL_BIND(_shaped_text_get_preserve_invalid, "shaped"); - GDVIRTUAL_BIND(shaped_text_set_preserve_control, "shaped", "enabled"); - GDVIRTUAL_BIND(shaped_text_get_preserve_control, "shaped"); + GDVIRTUAL_BIND(_shaped_text_set_preserve_control, "shaped", "enabled"); + GDVIRTUAL_BIND(_shaped_text_get_preserve_control, "shaped"); - GDVIRTUAL_BIND(shaped_text_set_spacing, "shaped", "spacing", "value"); - GDVIRTUAL_BIND(shaped_text_get_spacing, "shaped", "spacing"); + GDVIRTUAL_BIND(_shaped_text_set_spacing, "shaped", "spacing", "value"); + GDVIRTUAL_BIND(_shaped_text_get_spacing, "shaped", "spacing"); - GDVIRTUAL_BIND(shaped_text_add_string, "shaped", "text", "fonts", "size", "opentype_features", "language", "meta"); - GDVIRTUAL_BIND(shaped_text_add_object, "shaped", "key", "size", "inline_align", "length"); - GDVIRTUAL_BIND(shaped_text_resize_object, "shaped", "key", "size", "inline_align"); + GDVIRTUAL_BIND(_shaped_text_add_string, "shaped", "text", "fonts", "size", "opentype_features", "language", "meta"); + GDVIRTUAL_BIND(_shaped_text_add_object, "shaped", "key", "size", "inline_align", "length"); + GDVIRTUAL_BIND(_shaped_text_resize_object, "shaped", "key", "size", "inline_align"); - GDVIRTUAL_BIND(shaped_get_span_count, "shaped"); - GDVIRTUAL_BIND(shaped_get_span_meta, "shaped", "index"); - GDVIRTUAL_BIND(shaped_set_span_update_font, "shaped", "index", "fonts", "size", "opentype_features"); + GDVIRTUAL_BIND(_shaped_get_span_count, "shaped"); + GDVIRTUAL_BIND(_shaped_get_span_meta, "shaped", "index"); + GDVIRTUAL_BIND(_shaped_set_span_update_font, "shaped", "index", "fonts", "size", "opentype_features"); - GDVIRTUAL_BIND(shaped_text_substr, "shaped", "start", "length"); - GDVIRTUAL_BIND(shaped_text_get_parent, "shaped"); + GDVIRTUAL_BIND(_shaped_text_substr, "shaped", "start", "length"); + GDVIRTUAL_BIND(_shaped_text_get_parent, "shaped"); - GDVIRTUAL_BIND(shaped_text_fit_to_width, "shaped", "width", "jst_flags"); - GDVIRTUAL_BIND(shaped_text_tab_align, "shaped", "tab_stops"); + GDVIRTUAL_BIND(_shaped_text_fit_to_width, "shaped", "width", "jst_flags"); + GDVIRTUAL_BIND(_shaped_text_tab_align, "shaped", "tab_stops"); - GDVIRTUAL_BIND(shaped_text_shape, "shaped"); - GDVIRTUAL_BIND(shaped_text_update_breaks, "shaped"); - GDVIRTUAL_BIND(shaped_text_update_justification_ops, "shaped"); + GDVIRTUAL_BIND(_shaped_text_shape, "shaped"); + GDVIRTUAL_BIND(_shaped_text_update_breaks, "shaped"); + GDVIRTUAL_BIND(_shaped_text_update_justification_ops, "shaped"); - GDVIRTUAL_BIND(shaped_text_is_ready, "shaped"); + GDVIRTUAL_BIND(_shaped_text_is_ready, "shaped"); - GDVIRTUAL_BIND(shaped_text_get_glyphs, "shaped"); - GDVIRTUAL_BIND(shaped_text_sort_logical, "shaped"); - GDVIRTUAL_BIND(shaped_text_get_glyph_count, "shaped"); + GDVIRTUAL_BIND(_shaped_text_get_glyphs, "shaped"); + GDVIRTUAL_BIND(_shaped_text_sort_logical, "shaped"); + GDVIRTUAL_BIND(_shaped_text_get_glyph_count, "shaped"); - GDVIRTUAL_BIND(shaped_text_get_range, "shaped"); + GDVIRTUAL_BIND(_shaped_text_get_range, "shaped"); - GDVIRTUAL_BIND(shaped_text_get_line_breaks_adv, "shaped", "width", "start", "once", "break_flags"); - GDVIRTUAL_BIND(shaped_text_get_line_breaks, "shaped", "width", "start", "break_flags"); - GDVIRTUAL_BIND(shaped_text_get_word_breaks, "shaped", "grapheme_flags"); + GDVIRTUAL_BIND(_shaped_text_get_line_breaks_adv, "shaped", "width", "start", "once", "break_flags"); + GDVIRTUAL_BIND(_shaped_text_get_line_breaks, "shaped", "width", "start", "break_flags"); + GDVIRTUAL_BIND(_shaped_text_get_word_breaks, "shaped", "grapheme_flags"); - GDVIRTUAL_BIND(shaped_text_get_trim_pos, "shaped"); - GDVIRTUAL_BIND(shaped_text_get_ellipsis_pos, "shaped"); - GDVIRTUAL_BIND(shaped_text_get_ellipsis_glyph_count, "shaped"); - GDVIRTUAL_BIND(shaped_text_get_ellipsis_glyphs, "shaped"); + GDVIRTUAL_BIND(_shaped_text_get_trim_pos, "shaped"); + GDVIRTUAL_BIND(_shaped_text_get_ellipsis_pos, "shaped"); + GDVIRTUAL_BIND(_shaped_text_get_ellipsis_glyph_count, "shaped"); + GDVIRTUAL_BIND(_shaped_text_get_ellipsis_glyphs, "shaped"); - GDVIRTUAL_BIND(shaped_text_overrun_trim_to_width, "shaped", "width", "trim_flags"); + GDVIRTUAL_BIND(_shaped_text_overrun_trim_to_width, "shaped", "width", "trim_flags"); - GDVIRTUAL_BIND(shaped_text_get_objects, "shaped"); - GDVIRTUAL_BIND(shaped_text_get_object_rect, "shaped", "key"); + GDVIRTUAL_BIND(_shaped_text_get_objects, "shaped"); + GDVIRTUAL_BIND(_shaped_text_get_object_rect, "shaped", "key"); - GDVIRTUAL_BIND(shaped_text_get_size, "shaped"); - GDVIRTUAL_BIND(shaped_text_get_ascent, "shaped"); - GDVIRTUAL_BIND(shaped_text_get_descent, "shaped"); - GDVIRTUAL_BIND(shaped_text_get_width, "shaped"); - GDVIRTUAL_BIND(shaped_text_get_underline_position, "shaped"); - GDVIRTUAL_BIND(shaped_text_get_underline_thickness, "shaped"); + GDVIRTUAL_BIND(_shaped_text_get_size, "shaped"); + GDVIRTUAL_BIND(_shaped_text_get_ascent, "shaped"); + GDVIRTUAL_BIND(_shaped_text_get_descent, "shaped"); + GDVIRTUAL_BIND(_shaped_text_get_width, "shaped"); + GDVIRTUAL_BIND(_shaped_text_get_underline_position, "shaped"); + GDVIRTUAL_BIND(_shaped_text_get_underline_thickness, "shaped"); - GDVIRTUAL_BIND(shaped_text_get_dominant_direction_in_range, "shaped", "start", "end"); + GDVIRTUAL_BIND(_shaped_text_get_dominant_direction_in_range, "shaped", "start", "end"); - GDVIRTUAL_BIND(shaped_text_get_carets, "shaped", "position", "caret"); - GDVIRTUAL_BIND(shaped_text_get_selection, "shaped", "start", "end"); + GDVIRTUAL_BIND(_shaped_text_get_carets, "shaped", "position", "caret"); + GDVIRTUAL_BIND(_shaped_text_get_selection, "shaped", "start", "end"); - GDVIRTUAL_BIND(shaped_text_hit_test_grapheme, "shaped", "coord"); - GDVIRTUAL_BIND(shaped_text_hit_test_position, "shaped", "coord"); + GDVIRTUAL_BIND(_shaped_text_hit_test_grapheme, "shaped", "coord"); + GDVIRTUAL_BIND(_shaped_text_hit_test_position, "shaped", "coord"); - GDVIRTUAL_BIND(shaped_text_draw, "shaped", "canvas", "pos", "clip_l", "clip_r", "color"); - GDVIRTUAL_BIND(shaped_text_draw_outline, "shaped", "canvas", "pos", "clip_l", "clip_r", "outline_size", "color"); + GDVIRTUAL_BIND(_shaped_text_draw, "shaped", "canvas", "pos", "clip_l", "clip_r", "color"); + GDVIRTUAL_BIND(_shaped_text_draw_outline, "shaped", "canvas", "pos", "clip_l", "clip_r", "outline_size", "color"); - GDVIRTUAL_BIND(shaped_text_get_grapheme_bounds, "shaped", "pos"); - GDVIRTUAL_BIND(shaped_text_next_grapheme_pos, "shaped", "pos"); - GDVIRTUAL_BIND(shaped_text_prev_grapheme_pos, "shaped", "pos"); + GDVIRTUAL_BIND(_shaped_text_get_grapheme_bounds, "shaped", "pos"); + GDVIRTUAL_BIND(_shaped_text_next_grapheme_pos, "shaped", "pos"); + GDVIRTUAL_BIND(_shaped_text_prev_grapheme_pos, "shaped", "pos"); - GDVIRTUAL_BIND(format_number, "string", "language"); - GDVIRTUAL_BIND(parse_number, "string", "language"); - GDVIRTUAL_BIND(percent_sign, "language"); + GDVIRTUAL_BIND(_format_number, "string", "language"); + GDVIRTUAL_BIND(_parse_number, "string", "language"); + GDVIRTUAL_BIND(_percent_sign, "language"); - GDVIRTUAL_BIND(strip_diacritics, "string"); - GDVIRTUAL_BIND(is_valid_identifier, "string"); + GDVIRTUAL_BIND(_strip_diacritics, "string"); + GDVIRTUAL_BIND(_is_valid_identifier, "string"); - GDVIRTUAL_BIND(string_get_word_breaks, "string", "language"); + GDVIRTUAL_BIND(_string_get_word_breaks, "string", "language"); - GDVIRTUAL_BIND(is_confusable, "string", "dict"); - GDVIRTUAL_BIND(spoof_check, "string"); + GDVIRTUAL_BIND(_is_confusable, "string", "dict"); + GDVIRTUAL_BIND(_spoof_check, "string"); - GDVIRTUAL_BIND(string_to_upper, "string", "language"); - GDVIRTUAL_BIND(string_to_lower, "string", "language"); + GDVIRTUAL_BIND(_string_to_upper, "string", "language"); + GDVIRTUAL_BIND(_string_to_lower, "string", "language"); - GDVIRTUAL_BIND(parse_structured_text, "parser_type", "args", "text"); + GDVIRTUAL_BIND(_parse_structured_text, "parser_type", "args", "text"); } bool TextServerExtension::has_feature(Feature p_feature) const { bool ret; - if (GDVIRTUAL_CALL(has_feature, p_feature, ret)) { + if (GDVIRTUAL_CALL(_has_feature, p_feature, ret)) { return ret; } return false; @@ -320,7 +320,7 @@ bool TextServerExtension::has_feature(Feature p_feature) const { String TextServerExtension::get_name() const { String ret; - if (GDVIRTUAL_CALL(get_name, ret)) { + if (GDVIRTUAL_CALL(_get_name, ret)) { return ret; } return "Unknown"; @@ -328,19 +328,19 @@ String TextServerExtension::get_name() const { int64_t TextServerExtension::get_features() const { int64_t ret; - if (GDVIRTUAL_CALL(get_features, ret)) { + if (GDVIRTUAL_CALL(_get_features, ret)) { return ret; } return 0; } void TextServerExtension::free_rid(const RID &p_rid) { - GDVIRTUAL_CALL(free_rid, p_rid); + GDVIRTUAL_CALL(_free_rid, p_rid); } bool TextServerExtension::has(const RID &p_rid) { bool ret; - if (GDVIRTUAL_CALL(has, p_rid, ret)) { + if (GDVIRTUAL_CALL(_has, p_rid, ret)) { return ret; } return false; @@ -348,7 +348,7 @@ bool TextServerExtension::has(const RID &p_rid) { bool TextServerExtension::load_support_data(const String &p_filename) { bool ret; - if (GDVIRTUAL_CALL(load_support_data, p_filename, ret)) { + if (GDVIRTUAL_CALL(_load_support_data, p_filename, ret)) { return ret; } return false; @@ -356,7 +356,7 @@ bool TextServerExtension::load_support_data(const String &p_filename) { String TextServerExtension::get_support_data_filename() const { String ret; - if (GDVIRTUAL_CALL(get_support_data_filename, ret)) { + if (GDVIRTUAL_CALL(_get_support_data_filename, ret)) { return ret; } return String(); @@ -364,7 +364,7 @@ String TextServerExtension::get_support_data_filename() const { String TextServerExtension::get_support_data_info() const { String ret; - if (GDVIRTUAL_CALL(get_support_data_info, ret)) { + if (GDVIRTUAL_CALL(_get_support_data_info, ret)) { return ret; } return String(); @@ -372,7 +372,7 @@ String TextServerExtension::get_support_data_info() const { bool TextServerExtension::save_support_data(const String &p_filename) const { bool ret; - if (GDVIRTUAL_CALL(save_support_data, p_filename, ret)) { + if (GDVIRTUAL_CALL(_save_support_data, p_filename, ret)) { return ret; } return false; @@ -380,7 +380,7 @@ bool TextServerExtension::save_support_data(const String &p_filename) const { bool TextServerExtension::is_locale_right_to_left(const String &p_locale) const { bool ret; - if (GDVIRTUAL_CALL(is_locale_right_to_left, p_locale, ret)) { + if (GDVIRTUAL_CALL(_is_locale_right_to_left, p_locale, ret)) { return ret; } return false; @@ -388,7 +388,7 @@ 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; - if (GDVIRTUAL_CALL(name_to_tag, p_name, ret)) { + if (GDVIRTUAL_CALL(_name_to_tag, p_name, ret)) { return ret; } return 0; @@ -396,7 +396,7 @@ int64_t TextServerExtension::name_to_tag(const String &p_name) const { String TextServerExtension::tag_to_name(int64_t p_tag) const { String ret; - if (GDVIRTUAL_CALL(tag_to_name, p_tag, ret)) { + if (GDVIRTUAL_CALL(_tag_to_name, p_tag, ret)) { return ret; } return ""; @@ -408,27 +408,27 @@ String TextServerExtension::tag_to_name(int64_t p_tag) const { RID TextServerExtension::create_font() { RID ret; - if (GDVIRTUAL_CALL(create_font, ret)) { + if (GDVIRTUAL_CALL(_create_font, ret)) { return ret; } return RID(); } void TextServerExtension::font_set_data(const RID &p_font_rid, const PackedByteArray &p_data) { - GDVIRTUAL_CALL(font_set_data, p_font_rid, p_data); + GDVIRTUAL_CALL(_font_set_data, p_font_rid, p_data); } void TextServerExtension::font_set_data_ptr(const RID &p_font_rid, const uint8_t *p_data_ptr, int64_t p_data_size) { - GDVIRTUAL_CALL(font_set_data_ptr, p_font_rid, p_data_ptr, p_data_size); + GDVIRTUAL_CALL(_font_set_data_ptr, p_font_rid, p_data_ptr, p_data_size); } void TextServerExtension::font_set_face_index(const RID &p_font_rid, int64_t p_index) { - GDVIRTUAL_CALL(font_set_face_index, p_font_rid, p_index); + GDVIRTUAL_CALL(_font_set_face_index, p_font_rid, p_index); } int64_t TextServerExtension::font_get_face_index(const RID &p_font_rid) const { int64_t ret; - if (GDVIRTUAL_CALL(font_get_face_index, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_get_face_index, p_font_rid, ret)) { return ret; } return 0; @@ -436,199 +436,199 @@ 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; - if (GDVIRTUAL_CALL(font_get_face_count, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_get_face_count, p_font_rid, ret)) { return ret; } return 0; } void TextServerExtension::font_set_style(const RID &p_font_rid, BitField<TextServer::FontStyle> p_style) { - GDVIRTUAL_CALL(font_set_style, p_font_rid, p_style); + GDVIRTUAL_CALL(_font_set_style, p_font_rid, p_style); } BitField<TextServer::FontStyle> TextServerExtension::font_get_style(const RID &p_font_rid) const { BitField<TextServer::FontStyle> ret = 0; - if (GDVIRTUAL_CALL(font_get_style, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_get_style, p_font_rid, ret)) { return ret; } return 0; } void TextServerExtension::font_set_style_name(const RID &p_font_rid, const String &p_name) { - GDVIRTUAL_CALL(font_set_style_name, p_font_rid, p_name); + GDVIRTUAL_CALL(_font_set_style_name, p_font_rid, p_name); } String TextServerExtension::font_get_style_name(const RID &p_font_rid) const { String ret; - if (GDVIRTUAL_CALL(font_get_style_name, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_get_style_name, p_font_rid, ret)) { return ret; } return String(); } void TextServerExtension::font_set_name(const RID &p_font_rid, const String &p_name) { - GDVIRTUAL_CALL(font_set_name, p_font_rid, p_name); + GDVIRTUAL_CALL(_font_set_name, p_font_rid, p_name); } String TextServerExtension::font_get_name(const RID &p_font_rid) const { String ret; - if (GDVIRTUAL_CALL(font_get_name, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_get_name, p_font_rid, ret)) { return ret; } return String(); } -void TextServerExtension::font_set_antialiasing(RID p_font_rid, TextServer::FontAntialiasing p_antialiasing) { - GDVIRTUAL_CALL(font_set_antialiasing, p_font_rid, p_antialiasing); +void TextServerExtension::font_set_antialiasing(const RID &p_font_rid, TextServer::FontAntialiasing p_antialiasing) { + GDVIRTUAL_CALL(_font_set_antialiasing, p_font_rid, p_antialiasing); } -TextServer::FontAntialiasing TextServerExtension::font_get_antialiasing(RID p_font_rid) const { +TextServer::FontAntialiasing TextServerExtension::font_get_antialiasing(const RID &p_font_rid) const { TextServer::FontAntialiasing ret; - if (GDVIRTUAL_CALL(font_get_antialiasing, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_get_antialiasing, p_font_rid, ret)) { return ret; } return TextServer::FONT_ANTIALIASING_NONE; } 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); + GDVIRTUAL_CALL(_font_set_generate_mipmaps, p_font_rid, p_generate_mipmaps); } bool TextServerExtension::font_get_generate_mipmaps(const RID &p_font_rid) const { bool ret; - if (GDVIRTUAL_CALL(font_get_generate_mipmaps, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_get_generate_mipmaps, p_font_rid, ret)) { return ret; } return false; } void TextServerExtension::font_set_multichannel_signed_distance_field(const RID &p_font_rid, bool p_msdf) { - GDVIRTUAL_CALL(font_set_multichannel_signed_distance_field, p_font_rid, p_msdf); + GDVIRTUAL_CALL(_font_set_multichannel_signed_distance_field, p_font_rid, p_msdf); } bool TextServerExtension::font_is_multichannel_signed_distance_field(const RID &p_font_rid) const { bool ret; - if (GDVIRTUAL_CALL(font_is_multichannel_signed_distance_field, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_is_multichannel_signed_distance_field, p_font_rid, ret)) { return ret; } return false; } void TextServerExtension::font_set_msdf_pixel_range(const RID &p_font_rid, int64_t p_msdf_pixel_range) { - GDVIRTUAL_CALL(font_set_msdf_pixel_range, p_font_rid, p_msdf_pixel_range); + GDVIRTUAL_CALL(_font_set_msdf_pixel_range, p_font_rid, p_msdf_pixel_range); } int64_t TextServerExtension::font_get_msdf_pixel_range(const RID &p_font_rid) const { int64_t ret; - if (GDVIRTUAL_CALL(font_get_msdf_pixel_range, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_get_msdf_pixel_range, p_font_rid, ret)) { return ret; } return 0; } void TextServerExtension::font_set_msdf_size(const RID &p_font_rid, int64_t p_msdf_size) { - GDVIRTUAL_CALL(font_set_msdf_size, p_font_rid, p_msdf_size); + GDVIRTUAL_CALL(_font_set_msdf_size, p_font_rid, p_msdf_size); } int64_t TextServerExtension::font_get_msdf_size(const RID &p_font_rid) const { int64_t ret; - if (GDVIRTUAL_CALL(font_get_msdf_size, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_get_msdf_size, p_font_rid, ret)) { return ret; } return 0; } 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_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; - if (GDVIRTUAL_CALL(font_get_fixed_size, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_get_fixed_size, p_font_rid, ret)) { return ret; } return 0; } void TextServerExtension::font_set_force_autohinter(const RID &p_font_rid, bool p_force_autohinter) { - GDVIRTUAL_CALL(font_set_force_autohinter, p_font_rid, p_force_autohinter); + GDVIRTUAL_CALL(_font_set_force_autohinter, p_font_rid, p_force_autohinter); } bool TextServerExtension::font_is_force_autohinter(const RID &p_font_rid) const { bool ret; - if (GDVIRTUAL_CALL(font_is_force_autohinter, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_is_force_autohinter, p_font_rid, ret)) { return ret; } return false; } void TextServerExtension::font_set_hinting(const RID &p_font_rid, TextServer::Hinting p_hinting) { - GDVIRTUAL_CALL(font_set_hinting, p_font_rid, p_hinting); + GDVIRTUAL_CALL(_font_set_hinting, p_font_rid, p_hinting); } TextServer::Hinting TextServerExtension::font_get_hinting(const RID &p_font_rid) const { TextServer::Hinting ret; - if (GDVIRTUAL_CALL(font_get_hinting, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_get_hinting, p_font_rid, ret)) { return (TextServer::Hinting)ret; } return TextServer::Hinting::HINTING_NONE; } void TextServerExtension::font_set_subpixel_positioning(const RID &p_font_rid, TextServer::SubpixelPositioning p_subpixel) { - GDVIRTUAL_CALL(font_set_subpixel_positioning, p_font_rid, p_subpixel); + GDVIRTUAL_CALL(_font_set_subpixel_positioning, p_font_rid, p_subpixel); } TextServer::SubpixelPositioning TextServerExtension::font_get_subpixel_positioning(const RID &p_font_rid) const { TextServer::SubpixelPositioning ret; - if (GDVIRTUAL_CALL(font_get_subpixel_positioning, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_get_subpixel_positioning, p_font_rid, ret)) { return (TextServer::SubpixelPositioning)ret; } return TextServer::SubpixelPositioning::SUBPIXEL_POSITIONING_DISABLED; } void TextServerExtension::font_set_embolden(const RID &p_font_rid, double p_strength) { - GDVIRTUAL_CALL(font_set_embolden, p_font_rid, p_strength); + GDVIRTUAL_CALL(_font_set_embolden, p_font_rid, p_strength); } double TextServerExtension::font_get_embolden(const RID &p_font_rid) const { double ret; - if (GDVIRTUAL_CALL(font_get_embolden, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_get_embolden, p_font_rid, ret)) { return ret; } return 0.0; } void TextServerExtension::font_set_transform(const RID &p_font_rid, const Transform2D &p_transform) { - GDVIRTUAL_CALL(font_set_transform, p_font_rid, p_transform); + GDVIRTUAL_CALL(_font_set_transform, p_font_rid, p_transform); } Transform2D TextServerExtension::font_get_transform(const RID &p_font_rid) const { Transform2D ret; - if (GDVIRTUAL_CALL(font_get_transform, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_get_transform, p_font_rid, ret)) { return ret; } return Transform2D(); } void TextServerExtension::font_set_variation_coordinates(const RID &p_font_rid, const Dictionary &p_variation_coordinates) { - GDVIRTUAL_CALL(font_set_variation_coordinates, p_font_rid, p_variation_coordinates); + GDVIRTUAL_CALL(_font_set_variation_coordinates, p_font_rid, p_variation_coordinates); } Dictionary TextServerExtension::font_get_variation_coordinates(const RID &p_font_rid) const { Dictionary ret; - if (GDVIRTUAL_CALL(font_get_variation_coordinates, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_get_variation_coordinates, p_font_rid, ret)) { return ret; } return Dictionary(); } void TextServerExtension::font_set_oversampling(const RID &p_font_rid, double p_oversampling) { - GDVIRTUAL_CALL(font_set_oversampling, p_font_rid, p_oversampling); + GDVIRTUAL_CALL(_font_set_oversampling, p_font_rid, p_oversampling); } double TextServerExtension::font_get_oversampling(const RID &p_font_rid) const { double ret; - if (GDVIRTUAL_CALL(font_get_oversampling, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_get_oversampling, p_font_rid, ret)) { return ret; } return 0.0; @@ -636,75 +636,75 @@ 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; - if (GDVIRTUAL_CALL(font_get_size_cache_list, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_get_size_cache_list, p_font_rid, ret)) { return ret; } return TypedArray<Vector2i>(); } void TextServerExtension::font_clear_size_cache(const RID &p_font_rid) { - GDVIRTUAL_CALL(font_clear_size_cache, p_font_rid); + GDVIRTUAL_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_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_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; - if (GDVIRTUAL_CALL(font_get_ascent, p_font_rid, p_size, ret)) { + if (GDVIRTUAL_CALL(_font_get_ascent, p_font_rid, p_size, ret)) { return ret; } return 0.0; } 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_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; - if (GDVIRTUAL_CALL(font_get_descent, p_font_rid, p_size, ret)) { + if (GDVIRTUAL_CALL(_font_get_descent, p_font_rid, p_size, ret)) { return ret; } return 0.0; } 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_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; - if (GDVIRTUAL_CALL(font_get_underline_position, p_font_rid, p_size, ret)) { + if (GDVIRTUAL_CALL(_font_get_underline_position, p_font_rid, p_size, ret)) { return ret; } return 0.0; } 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_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; - if (GDVIRTUAL_CALL(font_get_underline_thickness, p_font_rid, p_size, ret)) { + if (GDVIRTUAL_CALL(_font_get_underline_thickness, p_font_rid, p_size, ret)) { return ret; } return 0.0; } 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_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; - if (GDVIRTUAL_CALL(font_get_scale, p_font_rid, p_size, ret)) { + if (GDVIRTUAL_CALL(_font_get_scale, p_font_rid, p_size, ret)) { return ret; } return 0.0; @@ -712,39 +712,39 @@ double TextServerExtension::font_get_scale(const RID &p_font_rid, int64_t p_size int64_t TextServerExtension::font_get_texture_count(const RID &p_font_rid, const Vector2i &p_size) const { int64_t ret; - if (GDVIRTUAL_CALL(font_get_texture_count, p_font_rid, p_size, ret)) { + if (GDVIRTUAL_CALL(_font_get_texture_count, p_font_rid, p_size, ret)) { return ret; } return 0; } 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_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_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_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; - if (GDVIRTUAL_CALL(font_get_texture_image, p_font_rid, p_size, p_texture_index, ret)) { + if (GDVIRTUAL_CALL(_font_get_texture_image, p_font_rid, p_size, p_texture_index, ret)) { return ret; } return Ref<Image>(); } void TextServerExtension::font_set_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const PackedInt32Array &p_offset) { - GDVIRTUAL_CALL(font_set_texture_offsets, p_font_rid, p_size, p_texture_index, p_offset); + GDVIRTUAL_CALL(_font_set_texture_offsets, p_font_rid, p_size, p_texture_index, p_offset); } PackedInt32Array TextServerExtension::font_get_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const { PackedInt32Array ret; - if (GDVIRTUAL_CALL(font_get_texture_offsets, p_font_rid, p_size, p_texture_index, ret)) { + if (GDVIRTUAL_CALL(_font_get_texture_offsets, p_font_rid, p_size, p_texture_index, ret)) { return ret; } return PackedInt32Array(); @@ -752,83 +752,83 @@ 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; - if (GDVIRTUAL_CALL(font_get_glyph_list, p_font_rid, p_size, ret)) { + if (GDVIRTUAL_CALL(_font_get_glyph_list, p_font_rid, p_size, ret)) { return ret; } return PackedInt32Array(); } 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_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_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; - if (GDVIRTUAL_CALL(font_get_glyph_advance, p_font_rid, p_size, p_glyph, ret)) { + if (GDVIRTUAL_CALL(_font_get_glyph_advance, p_font_rid, p_size, p_glyph, ret)) { return ret; } return Vector2(); } 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_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; - if (GDVIRTUAL_CALL(font_get_glyph_offset, p_font_rid, p_size, p_glyph, ret)) { + if (GDVIRTUAL_CALL(_font_get_glyph_offset, p_font_rid, p_size, p_glyph, ret)) { return ret; } return Vector2(); } 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_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; - if (GDVIRTUAL_CALL(font_get_glyph_size, p_font_rid, p_size, p_glyph, ret)) { + if (GDVIRTUAL_CALL(_font_get_glyph_size, p_font_rid, p_size, p_glyph, ret)) { return ret; } return Vector2(); } 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_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; - if (GDVIRTUAL_CALL(font_get_glyph_uv_rect, p_font_rid, p_size, p_glyph, ret)) { + if (GDVIRTUAL_CALL(_font_get_glyph_uv_rect, p_font_rid, p_size, p_glyph, ret)) { return ret; } return Rect2(); } 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_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; - if (GDVIRTUAL_CALL(font_get_glyph_texture_idx, p_font_rid, p_size, p_glyph, ret)) { + if (GDVIRTUAL_CALL(_font_get_glyph_texture_idx, p_font_rid, p_size, p_glyph, ret)) { return ret; } return 0; } 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_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; - if (GDVIRTUAL_CALL(font_get_glyph_texture_rid, p_font_rid, p_size, p_glyph, ret)) { + if (GDVIRTUAL_CALL(_font_get_glyph_texture_rid, p_font_rid, p_size, p_glyph, ret)) { return ret; } return RID(); @@ -836,7 +836,7 @@ RID TextServerExtension::font_get_glyph_texture_rid(const RID &p_font_rid, const Size2 TextServerExtension::font_get_glyph_texture_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { Size2 ret; - if (GDVIRTUAL_CALL(font_get_glyph_texture_size, p_font_rid, p_size, p_glyph, ret)) { + if (GDVIRTUAL_CALL(_font_get_glyph_texture_size, p_font_rid, p_size, p_glyph, ret)) { return ret; } return Size2(); @@ -844,7 +844,7 @@ Size2 TextServerExtension::font_get_glyph_texture_size(const RID &p_font_rid, co Dictionary TextServerExtension::font_get_glyph_contours(const RID &p_font_rid, int64_t p_size, int64_t p_index) const { Dictionary ret; - if (GDVIRTUAL_CALL(font_get_glyph_contours, p_font_rid, p_size, p_index, ret)) { + if (GDVIRTUAL_CALL(_font_get_glyph_contours, p_font_rid, p_size, p_index, ret)) { return ret; } return Dictionary(); @@ -852,27 +852,27 @@ Dictionary TextServerExtension::font_get_glyph_contours(const RID &p_font_rid, i TypedArray<Vector2i> TextServerExtension::font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const { TypedArray<Vector2i> ret; - if (GDVIRTUAL_CALL(font_get_kerning_list, p_font_rid, p_size, ret)) { + if (GDVIRTUAL_CALL(_font_get_kerning_list, p_font_rid, p_size, ret)) { return ret; } return TypedArray<Vector2i>(); } void TextServerExtension::font_clear_kerning_map(const RID &p_font_rid, int64_t p_size) { - GDVIRTUAL_CALL(font_clear_kerning_map, p_font_rid, p_size); + GDVIRTUAL_CALL(_font_clear_kerning_map, p_font_rid, p_size); } void TextServerExtension::font_remove_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) { - GDVIRTUAL_CALL(font_remove_kerning, p_font_rid, p_size, p_glyph_pair); + GDVIRTUAL_CALL(_font_remove_kerning, p_font_rid, p_size, p_glyph_pair); } void TextServerExtension::font_set_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair, const Vector2 &p_kerning) { - GDVIRTUAL_CALL(font_set_kerning, p_font_rid, p_size, p_glyph_pair, p_kerning); + GDVIRTUAL_CALL(_font_set_kerning, p_font_rid, p_size, p_glyph_pair, p_kerning); } Vector2 TextServerExtension::font_get_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) const { Vector2 ret; - if (GDVIRTUAL_CALL(font_get_kerning, p_font_rid, p_size, p_glyph_pair, ret)) { + if (GDVIRTUAL_CALL(_font_get_kerning, p_font_rid, p_size, p_glyph_pair, ret)) { return ret; } return Vector2(); @@ -880,7 +880,7 @@ 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; - if (GDVIRTUAL_CALL(font_get_glyph_index, p_font_rid, p_size, p_char, p_variation_selector, ret)) { + if (GDVIRTUAL_CALL(_font_get_glyph_index, p_font_rid, p_size, p_char, p_variation_selector, ret)) { return ret; } return 0; @@ -888,7 +888,7 @@ int64_t TextServerExtension::font_get_glyph_index(const RID &p_font_rid, int64_t bool TextServerExtension::font_has_char(const RID &p_font_rid, int64_t p_char) const { bool ret; - if (GDVIRTUAL_CALL(font_has_char, p_font_rid, p_char, ret)) { + if (GDVIRTUAL_CALL(_font_has_char, p_font_rid, p_char, ret)) { return ret; } return false; @@ -896,55 +896,55 @@ bool TextServerExtension::font_has_char(const RID &p_font_rid, int64_t p_char) c String TextServerExtension::font_get_supported_chars(const RID &p_font_rid) const { String ret; - if (GDVIRTUAL_CALL(font_get_supported_chars, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_get_supported_chars, p_font_rid, ret)) { return ret; } return String(); } void TextServerExtension::font_render_range(const RID &p_font_rid, const Vector2i &p_size, int64_t p_start, int64_t p_end) { - GDVIRTUAL_CALL(font_render_range, p_font_rid, p_size, p_start, p_end); + GDVIRTUAL_CALL(_font_render_range, p_font_rid, p_size, p_start, p_end); } void TextServerExtension::font_render_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_index) { - GDVIRTUAL_CALL(font_render_glyph, p_font_rid, p_size, p_index); + GDVIRTUAL_CALL(_font_render_glyph, p_font_rid, p_size, p_index); } 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_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_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 { bool ret; - if (GDVIRTUAL_CALL(font_is_language_supported, p_font_rid, p_language, ret)) { + if (GDVIRTUAL_CALL(_font_is_language_supported, p_font_rid, p_language, ret)) { return ret; } return false; } void TextServerExtension::font_set_language_support_override(const RID &p_font_rid, const String &p_language, bool p_supported) { - GDVIRTUAL_CALL(font_set_language_support_override, p_font_rid, p_language, p_supported); + GDVIRTUAL_CALL(_font_set_language_support_override, p_font_rid, p_language, p_supported); } bool TextServerExtension::font_get_language_support_override(const RID &p_font_rid, const String &p_language) { bool ret; - if (GDVIRTUAL_CALL(font_get_language_support_override, p_font_rid, p_language, ret)) { + if (GDVIRTUAL_CALL(_font_get_language_support_override, p_font_rid, p_language, ret)) { return ret; } return false; } void TextServerExtension::font_remove_language_support_override(const RID &p_font_rid, const String &p_language) { - GDVIRTUAL_CALL(font_remove_language_support_override, p_font_rid, p_language); + GDVIRTUAL_CALL(_font_remove_language_support_override, p_font_rid, p_language); } PackedStringArray TextServerExtension::font_get_language_support_overrides(const RID &p_font_rid) { PackedStringArray ret; - if (GDVIRTUAL_CALL(font_get_language_support_overrides, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_get_language_support_overrides, p_font_rid, ret)) { return ret; } return PackedStringArray(); @@ -952,43 +952,43 @@ PackedStringArray TextServerExtension::font_get_language_support_overrides(const bool TextServerExtension::font_is_script_supported(const RID &p_font_rid, const String &p_script) const { bool ret; - if (GDVIRTUAL_CALL(font_is_script_supported, p_font_rid, p_script, ret)) { + if (GDVIRTUAL_CALL(_font_is_script_supported, p_font_rid, p_script, ret)) { return ret; } return false; } void TextServerExtension::font_set_script_support_override(const RID &p_font_rid, const String &p_script, bool p_supported) { - GDVIRTUAL_CALL(font_set_script_support_override, p_font_rid, p_script, p_supported); + GDVIRTUAL_CALL(_font_set_script_support_override, p_font_rid, p_script, p_supported); } bool TextServerExtension::font_get_script_support_override(const RID &p_font_rid, const String &p_script) { bool ret; - if (GDVIRTUAL_CALL(font_get_script_support_override, p_font_rid, p_script, ret)) { + if (GDVIRTUAL_CALL(_font_get_script_support_override, p_font_rid, p_script, ret)) { return ret; } return false; } void TextServerExtension::font_remove_script_support_override(const RID &p_font_rid, const String &p_script) { - GDVIRTUAL_CALL(font_remove_script_support_override, p_font_rid, p_script); + GDVIRTUAL_CALL(_font_remove_script_support_override, p_font_rid, p_script); } PackedStringArray TextServerExtension::font_get_script_support_overrides(const RID &p_font_rid) { PackedStringArray ret; - if (GDVIRTUAL_CALL(font_get_script_support_overrides, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_get_script_support_overrides, p_font_rid, ret)) { return ret; } return PackedStringArray(); } void TextServerExtension::font_set_opentype_feature_overrides(const RID &p_font_rid, const Dictionary &p_overrides) { - GDVIRTUAL_CALL(font_set_opentype_feature_overrides, p_font_rid, p_overrides); + GDVIRTUAL_CALL(_font_set_opentype_feature_overrides, p_font_rid, p_overrides); } Dictionary TextServerExtension::font_get_opentype_feature_overrides(const RID &p_font_rid) const { Dictionary ret; - if (GDVIRTUAL_CALL(font_get_opentype_feature_overrides, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_get_opentype_feature_overrides, p_font_rid, ret)) { return ret; } return Dictionary(); @@ -996,7 +996,7 @@ Dictionary TextServerExtension::font_get_opentype_feature_overrides(const RID &p Dictionary TextServerExtension::font_supported_feature_list(const RID &p_font_rid) const { Dictionary ret; - if (GDVIRTUAL_CALL(font_supported_feature_list, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_supported_feature_list, p_font_rid, ret)) { return ret; } return Dictionary(); @@ -1004,7 +1004,7 @@ Dictionary TextServerExtension::font_supported_feature_list(const RID &p_font_ri Dictionary TextServerExtension::font_supported_variation_list(const RID &p_font_rid) const { Dictionary ret; - if (GDVIRTUAL_CALL(font_supported_variation_list, p_font_rid, ret)) { + if (GDVIRTUAL_CALL(_font_supported_variation_list, p_font_rid, ret)) { return ret; } return Dictionary(); @@ -1012,26 +1012,26 @@ Dictionary TextServerExtension::font_supported_variation_list(const RID &p_font_ double TextServerExtension::font_get_global_oversampling() const { double ret; - if (GDVIRTUAL_CALL(font_get_global_oversampling, ret)) { + if (GDVIRTUAL_CALL(_font_get_global_oversampling, ret)) { return ret; } return 0.0; } void TextServerExtension::font_set_global_oversampling(double p_oversampling) { - GDVIRTUAL_CALL(font_set_global_oversampling, p_oversampling); + GDVIRTUAL_CALL(_font_set_global_oversampling, p_oversampling); } Vector2 TextServerExtension::get_hex_code_box_size(int64_t p_size, int64_t p_index) const { Vector2 ret; - if (GDVIRTUAL_CALL(get_hex_code_box_size, p_size, p_index, ret)) { + if (GDVIRTUAL_CALL(_get_hex_code_box_size, p_size, p_index, ret)) { return ret; } return TextServer::get_hex_code_box_size(p_size, p_index); } 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 { - if (!GDVIRTUAL_CALL(draw_hex_code_box, p_canvas, p_size, p_pos, p_index, p_color)) { + if (!GDVIRTUAL_CALL(_draw_hex_code_box, p_canvas, p_size, p_pos, p_index, p_color)) { TextServer::draw_hex_code_box(p_canvas, p_size, p_pos, p_index, p_color); } } @@ -1042,23 +1042,23 @@ 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; - if (GDVIRTUAL_CALL(create_shaped_text, p_direction, p_orientation, ret)) { + if (GDVIRTUAL_CALL(_create_shaped_text, p_direction, p_orientation, ret)) { return ret; } return RID(); } void TextServerExtension::shaped_text_clear(const RID &p_shaped) { - GDVIRTUAL_CALL(shaped_text_clear, p_shaped); + GDVIRTUAL_CALL(_shaped_text_clear, p_shaped); } void TextServerExtension::shaped_text_set_direction(const RID &p_shaped, TextServer::Direction p_direction) { - GDVIRTUAL_CALL(shaped_text_set_direction, p_shaped, p_direction); + GDVIRTUAL_CALL(_shaped_text_set_direction, p_shaped, p_direction); } TextServer::Direction TextServerExtension::shaped_text_get_direction(const RID &p_shaped) const { TextServer::Direction ret; - if (GDVIRTUAL_CALL(shaped_text_get_direction, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_direction, p_shaped, ret)) { return (TextServer::Direction)ret; } return TextServer::Direction::DIRECTION_AUTO; @@ -1066,71 +1066,71 @@ TextServer::Direction TextServerExtension::shaped_text_get_direction(const RID & TextServer::Direction TextServerExtension::shaped_text_get_inferred_direction(const RID &p_shaped) const { TextServer::Direction ret; - if (GDVIRTUAL_CALL(shaped_text_get_inferred_direction, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_inferred_direction, p_shaped, ret)) { return (TextServer::Direction)ret; } return TextServer::Direction::DIRECTION_LTR; } void TextServerExtension::shaped_text_set_orientation(const RID &p_shaped, TextServer::Orientation p_orientation) { - GDVIRTUAL_CALL(shaped_text_set_orientation, p_shaped, p_orientation); + GDVIRTUAL_CALL(_shaped_text_set_orientation, p_shaped, p_orientation); } TextServer::Orientation TextServerExtension::shaped_text_get_orientation(const RID &p_shaped) const { TextServer::Orientation ret; - if (GDVIRTUAL_CALL(shaped_text_get_orientation, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_orientation, p_shaped, ret)) { return (TextServer::Orientation)ret; } return TextServer::Orientation::ORIENTATION_HORIZONTAL; } void TextServerExtension::shaped_text_set_bidi_override(const RID &p_shaped, const Array &p_override) { - GDVIRTUAL_CALL(shaped_text_set_bidi_override, p_shaped, p_override); + GDVIRTUAL_CALL(_shaped_text_set_bidi_override, p_shaped, p_override); } void TextServerExtension::shaped_text_set_custom_punctuation(const RID &p_shaped, const String &p_punct) { - GDVIRTUAL_CALL(shaped_text_set_custom_punctuation, p_shaped, p_punct); + GDVIRTUAL_CALL(_shaped_text_set_custom_punctuation, p_shaped, p_punct); } String TextServerExtension::shaped_text_get_custom_punctuation(const RID &p_shaped) const { String ret; - if (GDVIRTUAL_CALL(shaped_text_get_custom_punctuation, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_custom_punctuation, p_shaped, ret)) { return ret; } return String(); } void TextServerExtension::shaped_text_set_preserve_invalid(const RID &p_shaped, bool p_enabled) { - GDVIRTUAL_CALL(shaped_text_set_preserve_invalid, p_shaped, p_enabled); + GDVIRTUAL_CALL(_shaped_text_set_preserve_invalid, p_shaped, p_enabled); } bool TextServerExtension::shaped_text_get_preserve_invalid(const RID &p_shaped) const { bool ret; - if (GDVIRTUAL_CALL(shaped_text_get_preserve_invalid, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_preserve_invalid, p_shaped, ret)) { return ret; } return false; } void TextServerExtension::shaped_text_set_preserve_control(const RID &p_shaped, bool p_enabled) { - GDVIRTUAL_CALL(shaped_text_set_preserve_control, p_shaped, p_enabled); + GDVIRTUAL_CALL(_shaped_text_set_preserve_control, p_shaped, p_enabled); } bool TextServerExtension::shaped_text_get_preserve_control(const RID &p_shaped) const { bool ret; - if (GDVIRTUAL_CALL(shaped_text_get_preserve_control, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_preserve_control, p_shaped, ret)) { return ret; } return false; } void TextServerExtension::shaped_text_set_spacing(const RID &p_shaped, TextServer::SpacingType p_spacing, int64_t p_value) { - GDVIRTUAL_CALL(shaped_text_set_spacing, p_shaped, p_spacing, p_value); + GDVIRTUAL_CALL(_shaped_text_set_spacing, p_shaped, p_spacing, p_value); } int64_t TextServerExtension::shaped_text_get_spacing(const RID &p_shaped, TextServer::SpacingType p_spacing) const { int64_t ret; - if (GDVIRTUAL_CALL(shaped_text_get_spacing, p_shaped, p_spacing, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_spacing, p_shaped, p_spacing, ret)) { return ret; } return 0; @@ -1138,7 +1138,7 @@ 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; - if (GDVIRTUAL_CALL(shaped_text_add_string, p_shaped, p_text, p_fonts, p_size, p_opentype_features, p_language, p_meta, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_add_string, p_shaped, p_text, p_fonts, p_size, p_opentype_features, p_language, p_meta, ret)) { return ret; } return false; @@ -1146,7 +1146,7 @@ bool TextServerExtension::shaped_text_add_string(const RID &p_shaped, const Stri 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) { bool ret; - if (GDVIRTUAL_CALL(shaped_text_add_object, p_shaped, p_key, p_size, p_inline_align, p_length, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_add_object, p_shaped, p_key, p_size, p_inline_align, p_length, ret)) { return ret; } return false; @@ -1154,7 +1154,7 @@ bool TextServerExtension::shaped_text_add_object(const RID &p_shaped, const Vari bool TextServerExtension::shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align) { bool ret; - if (GDVIRTUAL_CALL(shaped_text_resize_object, p_shaped, p_key, p_size, p_inline_align, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_resize_object, p_shaped, p_key, p_size, p_inline_align, ret)) { return ret; } return false; @@ -1162,7 +1162,7 @@ bool TextServerExtension::shaped_text_resize_object(const RID &p_shaped, const V int64_t TextServerExtension::shaped_get_span_count(const RID &p_shaped) const { int64_t ret; - if (GDVIRTUAL_CALL(shaped_get_span_count, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_get_span_count, p_shaped, ret)) { return ret; } return 0; @@ -1170,19 +1170,19 @@ int64_t TextServerExtension::shaped_get_span_count(const RID &p_shaped) const { Variant TextServerExtension::shaped_get_span_meta(const RID &p_shaped, int64_t p_index) const { Variant ret; - if (GDVIRTUAL_CALL(shaped_get_span_meta, p_shaped, p_index, ret)) { + if (GDVIRTUAL_CALL(_shaped_get_span_meta, p_shaped, p_index, ret)) { return ret; } return false; } 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_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; - if (GDVIRTUAL_CALL(shaped_text_substr, p_shaped, p_start, p_length, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_substr, p_shaped, p_start, p_length, ret)) { return ret; } return RID(); @@ -1190,7 +1190,7 @@ RID TextServerExtension::shaped_text_substr(const RID &p_shaped, int64_t p_start RID TextServerExtension::shaped_text_get_parent(const RID &p_shaped) const { RID ret; - if (GDVIRTUAL_CALL(shaped_text_get_parent, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_parent, p_shaped, ret)) { return ret; } return RID(); @@ -1198,7 +1198,7 @@ RID TextServerExtension::shaped_text_get_parent(const RID &p_shaped) const { double TextServerExtension::shaped_text_fit_to_width(const RID &p_shaped, double p_width, BitField<TextServer::JustificationFlag> p_jst_flags) { double ret; - if (GDVIRTUAL_CALL(shaped_text_fit_to_width, p_shaped, p_width, p_jst_flags, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_fit_to_width, p_shaped, p_width, p_jst_flags, ret)) { return ret; } return 0.0; @@ -1206,7 +1206,7 @@ double TextServerExtension::shaped_text_fit_to_width(const RID &p_shaped, double double TextServerExtension::shaped_text_tab_align(const RID &p_shaped, const PackedFloat32Array &p_tab_stops) { double ret; - if (GDVIRTUAL_CALL(shaped_text_tab_align, p_shaped, p_tab_stops, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_tab_align, p_shaped, p_tab_stops, ret)) { return ret; } return 0.0; @@ -1214,7 +1214,7 @@ double TextServerExtension::shaped_text_tab_align(const RID &p_shaped, const Pac bool TextServerExtension::shaped_text_shape(const RID &p_shaped) { bool ret; - if (GDVIRTUAL_CALL(shaped_text_shape, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_shape, p_shaped, ret)) { return ret; } return false; @@ -1222,7 +1222,7 @@ bool TextServerExtension::shaped_text_shape(const RID &p_shaped) { bool TextServerExtension::shaped_text_update_breaks(const RID &p_shaped) { bool ret; - if (GDVIRTUAL_CALL(shaped_text_update_breaks, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_update_breaks, p_shaped, ret)) { return ret; } return false; @@ -1230,7 +1230,7 @@ bool TextServerExtension::shaped_text_update_breaks(const RID &p_shaped) { bool TextServerExtension::shaped_text_update_justification_ops(const RID &p_shaped) { bool ret; - if (GDVIRTUAL_CALL(shaped_text_update_justification_ops, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_update_justification_ops, p_shaped, ret)) { return ret; } return false; @@ -1238,7 +1238,7 @@ bool TextServerExtension::shaped_text_update_justification_ops(const RID &p_shap bool TextServerExtension::shaped_text_is_ready(const RID &p_shaped) const { bool ret; - if (GDVIRTUAL_CALL(shaped_text_is_ready, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_is_ready, p_shaped, ret)) { return ret; } return false; @@ -1246,7 +1246,7 @@ bool TextServerExtension::shaped_text_is_ready(const RID &p_shaped) const { const Glyph *TextServerExtension::shaped_text_get_glyphs(const RID &p_shaped) const { GDNativeConstPtr<const Glyph> ret; - if (GDVIRTUAL_CALL(shaped_text_get_glyphs, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_glyphs, p_shaped, ret)) { return ret; } return nullptr; @@ -1254,7 +1254,7 @@ const Glyph *TextServerExtension::shaped_text_get_glyphs(const RID &p_shaped) co const Glyph *TextServerExtension::shaped_text_sort_logical(const RID &p_shaped) { GDNativeConstPtr<const Glyph> ret; - if (GDVIRTUAL_CALL(shaped_text_sort_logical, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_sort_logical, p_shaped, ret)) { return ret; } return nullptr; @@ -1262,7 +1262,7 @@ const Glyph *TextServerExtension::shaped_text_sort_logical(const RID &p_shaped) int64_t TextServerExtension::shaped_text_get_glyph_count(const RID &p_shaped) const { int64_t ret; - if (GDVIRTUAL_CALL(shaped_text_get_glyph_count, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_glyph_count, p_shaped, ret)) { return ret; } return 0; @@ -1270,7 +1270,7 @@ int64_t TextServerExtension::shaped_text_get_glyph_count(const RID &p_shaped) co Vector2i TextServerExtension::shaped_text_get_range(const RID &p_shaped) const { Vector2i ret; - if (GDVIRTUAL_CALL(shaped_text_get_range, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_range, p_shaped, ret)) { return ret; } return Vector2i(); @@ -1278,7 +1278,7 @@ Vector2i TextServerExtension::shaped_text_get_range(const RID &p_shaped) const { 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 { PackedInt32Array ret; - if (GDVIRTUAL_CALL(shaped_text_get_line_breaks_adv, p_shaped, p_width, p_start, p_once, p_break_flags, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_line_breaks_adv, p_shaped, p_width, p_start, p_once, p_break_flags, ret)) { return ret; } return TextServer::shaped_text_get_line_breaks_adv(p_shaped, p_width, p_start, p_once, p_break_flags); @@ -1286,7 +1286,7 @@ PackedInt32Array TextServerExtension::shaped_text_get_line_breaks_adv(const RID 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 { PackedInt32Array ret; - if (GDVIRTUAL_CALL(shaped_text_get_line_breaks, p_shaped, p_width, p_start, p_break_flags, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_line_breaks, p_shaped, p_width, p_start, p_break_flags, ret)) { return ret; } return TextServer::shaped_text_get_line_breaks(p_shaped, p_width, p_start, p_break_flags); @@ -1294,7 +1294,7 @@ PackedInt32Array TextServerExtension::shaped_text_get_line_breaks(const RID &p_s PackedInt32Array TextServerExtension::shaped_text_get_word_breaks(const RID &p_shaped, BitField<TextServer::GraphemeFlag> p_grapheme_flags) const { PackedInt32Array ret; - if (GDVIRTUAL_CALL(shaped_text_get_word_breaks, p_shaped, p_grapheme_flags, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_word_breaks, p_shaped, p_grapheme_flags, ret)) { return ret; } return TextServer::shaped_text_get_word_breaks(p_shaped, p_grapheme_flags); @@ -1302,7 +1302,7 @@ 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; - if (GDVIRTUAL_CALL(shaped_text_get_trim_pos, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_trim_pos, p_shaped, ret)) { return ret; } return -1; @@ -1310,7 +1310,7 @@ int64_t TextServerExtension::shaped_text_get_trim_pos(const RID &p_shaped) const int64_t TextServerExtension::shaped_text_get_ellipsis_pos(const RID &p_shaped) const { int64_t ret; - if (GDVIRTUAL_CALL(shaped_text_get_ellipsis_pos, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_ellipsis_pos, p_shaped, ret)) { return ret; } return -1; @@ -1318,7 +1318,7 @@ int64_t TextServerExtension::shaped_text_get_ellipsis_pos(const RID &p_shaped) c const Glyph *TextServerExtension::shaped_text_get_ellipsis_glyphs(const RID &p_shaped) const { GDNativeConstPtr<const Glyph> ret; - if (GDVIRTUAL_CALL(shaped_text_get_ellipsis_glyphs, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_ellipsis_glyphs, p_shaped, ret)) { return ret; } return nullptr; @@ -1326,19 +1326,19 @@ const Glyph *TextServerExtension::shaped_text_get_ellipsis_glyphs(const RID &p_s int64_t TextServerExtension::shaped_text_get_ellipsis_glyph_count(const RID &p_shaped) const { int64_t ret; - if (GDVIRTUAL_CALL(shaped_text_get_ellipsis_glyph_count, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_ellipsis_glyph_count, p_shaped, ret)) { return ret; } return -1; } void TextServerExtension::shaped_text_overrun_trim_to_width(const RID &p_shaped_line, double p_width, BitField<TextServer::TextOverrunFlag> p_trim_flags) { - GDVIRTUAL_CALL(shaped_text_overrun_trim_to_width, p_shaped_line, p_width, p_trim_flags); + GDVIRTUAL_CALL(_shaped_text_overrun_trim_to_width, p_shaped_line, p_width, p_trim_flags); } Array TextServerExtension::shaped_text_get_objects(const RID &p_shaped) const { Array ret; - if (GDVIRTUAL_CALL(shaped_text_get_objects, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_objects, p_shaped, ret)) { return ret; } return Array(); @@ -1346,7 +1346,7 @@ Array TextServerExtension::shaped_text_get_objects(const RID &p_shaped) const { Rect2 TextServerExtension::shaped_text_get_object_rect(const RID &p_shaped, const Variant &p_key) const { Rect2 ret; - if (GDVIRTUAL_CALL(shaped_text_get_object_rect, p_shaped, p_key, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_object_rect, p_shaped, p_key, ret)) { return ret; } return Rect2(); @@ -1354,7 +1354,7 @@ Rect2 TextServerExtension::shaped_text_get_object_rect(const RID &p_shaped, cons Size2 TextServerExtension::shaped_text_get_size(const RID &p_shaped) const { Size2 ret; - if (GDVIRTUAL_CALL(shaped_text_get_size, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_size, p_shaped, ret)) { return ret; } return Size2(); @@ -1362,7 +1362,7 @@ Size2 TextServerExtension::shaped_text_get_size(const RID &p_shaped) const { double TextServerExtension::shaped_text_get_ascent(const RID &p_shaped) const { double ret; - if (GDVIRTUAL_CALL(shaped_text_get_ascent, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_ascent, p_shaped, ret)) { return ret; } return 0.0; @@ -1370,7 +1370,7 @@ double TextServerExtension::shaped_text_get_ascent(const RID &p_shaped) const { double TextServerExtension::shaped_text_get_descent(const RID &p_shaped) const { double ret; - if (GDVIRTUAL_CALL(shaped_text_get_descent, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_descent, p_shaped, ret)) { return ret; } return 0.0; @@ -1378,7 +1378,7 @@ double TextServerExtension::shaped_text_get_descent(const RID &p_shaped) const { double TextServerExtension::shaped_text_get_width(const RID &p_shaped) const { double ret; - if (GDVIRTUAL_CALL(shaped_text_get_width, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_width, p_shaped, ret)) { return ret; } return 0.0; @@ -1386,7 +1386,7 @@ double TextServerExtension::shaped_text_get_width(const RID &p_shaped) const { double TextServerExtension::shaped_text_get_underline_position(const RID &p_shaped) const { double ret; - if (GDVIRTUAL_CALL(shaped_text_get_underline_position, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_underline_position, p_shaped, ret)) { return ret; } return 0.0; @@ -1394,7 +1394,7 @@ double TextServerExtension::shaped_text_get_underline_position(const RID &p_shap double TextServerExtension::shaped_text_get_underline_thickness(const RID &p_shaped) const { double ret; - if (GDVIRTUAL_CALL(shaped_text_get_underline_thickness, p_shaped, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_underline_thickness, p_shaped, ret)) { return ret; } return 0.0; @@ -1402,7 +1402,7 @@ double TextServerExtension::shaped_text_get_underline_thickness(const RID &p_sha TextServer::Direction TextServerExtension::shaped_text_get_dominant_direction_in_range(const RID &p_shaped, int64_t p_start, int64_t p_end) const { int64_t ret; - if (GDVIRTUAL_CALL(shaped_text_get_dominant_direction_in_range, p_shaped, p_start, p_end, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_dominant_direction_in_range, p_shaped, p_start, p_end, ret)) { return (TextServer::Direction)ret; } return TextServer::shaped_text_get_dominant_direction_in_range(p_shaped, p_start, p_end); @@ -1410,7 +1410,7 @@ TextServer::Direction TextServerExtension::shaped_text_get_dominant_direction_in CaretInfo TextServerExtension::shaped_text_get_carets(const RID &p_shaped, int64_t p_position) const { CaretInfo ret; - if (GDVIRTUAL_CALL(shaped_text_get_carets, p_shaped, p_position, &ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_carets, p_shaped, p_position, &ret)) { return ret; } return TextServer::shaped_text_get_carets(p_shaped, p_position); @@ -1418,7 +1418,7 @@ CaretInfo TextServerExtension::shaped_text_get_carets(const RID &p_shaped, int64 Vector<Vector2> TextServerExtension::shaped_text_get_selection(const RID &p_shaped, int64_t p_start, int64_t p_end) const { Vector<Vector2> ret; - if (GDVIRTUAL_CALL(shaped_text_get_selection, p_shaped, p_start, p_end, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_selection, p_shaped, p_start, p_end, ret)) { return ret; } return TextServer::shaped_text_get_selection(p_shaped, p_start, p_end); @@ -1426,7 +1426,7 @@ Vector<Vector2> TextServerExtension::shaped_text_get_selection(const RID &p_shap int64_t TextServerExtension::shaped_text_hit_test_grapheme(const RID &p_shaped, double p_coords) const { int64_t ret; - if (GDVIRTUAL_CALL(shaped_text_hit_test_grapheme, p_shaped, p_coords, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_hit_test_grapheme, p_shaped, p_coords, ret)) { return ret; } return TextServer::shaped_text_hit_test_grapheme(p_shaped, p_coords); @@ -1434,21 +1434,21 @@ int64_t TextServerExtension::shaped_text_hit_test_grapheme(const RID &p_shaped, int64_t TextServerExtension::shaped_text_hit_test_position(const RID &p_shaped, double p_coords) const { int64_t ret; - if (GDVIRTUAL_CALL(shaped_text_hit_test_position, p_shaped, p_coords, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_hit_test_position, p_shaped, p_coords, ret)) { return ret; } return TextServer::shaped_text_hit_test_position(p_shaped, p_coords); } 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 { - if (GDVIRTUAL_CALL(shaped_text_draw, p_shaped, p_canvas, p_pos, p_clip_l, p_clip_r, p_color)) { + if (GDVIRTUAL_CALL(_shaped_text_draw, p_shaped, p_canvas, p_pos, p_clip_l, p_clip_r, p_color)) { return; } TextServer::shaped_text_draw(p_shaped, p_canvas, p_pos, p_clip_l, p_clip_r, p_color); } 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 { - if (GDVIRTUAL_CALL(shaped_text_draw_outline, p_shaped, p_canvas, p_pos, p_clip_l, p_clip_r, p_outline_size, p_color)) { + if (GDVIRTUAL_CALL(_shaped_text_draw_outline, p_shaped, p_canvas, p_pos, p_clip_l, p_clip_r, p_outline_size, p_color)) { return; } TextServer::shaped_text_draw_outline(p_shaped, p_canvas, p_pos, p_clip_l, p_clip_r, p_outline_size, p_color); @@ -1456,7 +1456,7 @@ void TextServerExtension::shaped_text_draw_outline(const RID &p_shaped, const RI Vector2 TextServerExtension::shaped_text_get_grapheme_bounds(const RID &p_shaped, int64_t p_pos) const { Vector2 ret; - if (GDVIRTUAL_CALL(shaped_text_get_grapheme_bounds, p_shaped, p_pos, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_get_grapheme_bounds, p_shaped, p_pos, ret)) { return ret; } return TextServer::shaped_text_get_grapheme_bounds(p_shaped, p_pos); @@ -1464,7 +1464,7 @@ Vector2 TextServerExtension::shaped_text_get_grapheme_bounds(const RID &p_shaped int64_t TextServerExtension::shaped_text_next_grapheme_pos(const RID &p_shaped, int64_t p_pos) const { int64_t ret; - if (GDVIRTUAL_CALL(shaped_text_next_grapheme_pos, p_shaped, p_pos, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_next_grapheme_pos, p_shaped, p_pos, ret)) { return ret; } return TextServer::shaped_text_next_grapheme_pos(p_shaped, p_pos); @@ -1472,7 +1472,7 @@ int64_t TextServerExtension::shaped_text_next_grapheme_pos(const RID &p_shaped, int64_t TextServerExtension::shaped_text_prev_grapheme_pos(const RID &p_shaped, int64_t p_pos) const { int64_t ret; - if (GDVIRTUAL_CALL(shaped_text_prev_grapheme_pos, p_shaped, p_pos, ret)) { + if (GDVIRTUAL_CALL(_shaped_text_prev_grapheme_pos, p_shaped, p_pos, ret)) { return ret; } return TextServer::shaped_text_prev_grapheme_pos(p_shaped, p_pos); @@ -1480,7 +1480,7 @@ int64_t TextServerExtension::shaped_text_prev_grapheme_pos(const RID &p_shaped, String TextServerExtension::format_number(const String &p_string, const String &p_language) const { String ret; - if (GDVIRTUAL_CALL(format_number, p_string, p_language, ret)) { + if (GDVIRTUAL_CALL(_format_number, p_string, p_language, ret)) { return ret; } return p_string; @@ -1488,7 +1488,7 @@ String TextServerExtension::format_number(const String &p_string, const String & String TextServerExtension::parse_number(const String &p_string, const String &p_language) const { String ret; - if (GDVIRTUAL_CALL(parse_number, p_string, p_language, ret)) { + if (GDVIRTUAL_CALL(_parse_number, p_string, p_language, ret)) { return ret; } return p_string; @@ -1496,7 +1496,7 @@ String TextServerExtension::parse_number(const String &p_string, const String &p String TextServerExtension::percent_sign(const String &p_language) const { String ret; - if (GDVIRTUAL_CALL(percent_sign, p_language, ret)) { + if (GDVIRTUAL_CALL(_percent_sign, p_language, ret)) { return ret; } return "%"; @@ -1504,7 +1504,7 @@ String TextServerExtension::percent_sign(const String &p_language) const { bool TextServerExtension::is_valid_identifier(const String &p_string) const { bool ret; - if (GDVIRTUAL_CALL(is_valid_identifier, p_string, ret)) { + if (GDVIRTUAL_CALL(_is_valid_identifier, p_string, ret)) { return ret; } return TextServer::is_valid_identifier(p_string); @@ -1512,7 +1512,7 @@ bool TextServerExtension::is_valid_identifier(const String &p_string) const { String TextServerExtension::strip_diacritics(const String &p_string) const { String ret; - if (GDVIRTUAL_CALL(strip_diacritics, p_string, ret)) { + if (GDVIRTUAL_CALL(_strip_diacritics, p_string, ret)) { return ret; } return TextServer::strip_diacritics(p_string); @@ -1520,7 +1520,7 @@ String TextServerExtension::strip_diacritics(const String &p_string) const { String TextServerExtension::string_to_upper(const String &p_string, const String &p_language) const { String ret; - if (GDVIRTUAL_CALL(string_to_upper, p_string, p_language, ret)) { + if (GDVIRTUAL_CALL(_string_to_upper, p_string, p_language, ret)) { return ret; } return p_string; @@ -1528,7 +1528,7 @@ String TextServerExtension::string_to_upper(const String &p_string, const String String TextServerExtension::string_to_lower(const String &p_string, const String &p_language) const { String ret; - if (GDVIRTUAL_CALL(string_to_lower, p_string, p_language, ret)) { + if (GDVIRTUAL_CALL(_string_to_lower, p_string, p_language, ret)) { return ret; } return p_string; @@ -1536,7 +1536,7 @@ String TextServerExtension::string_to_lower(const String &p_string, const String TypedArray<Vector2i> TextServerExtension::parse_structured_text(StructuredTextParser p_parser_type, const Array &p_args, const String &p_text) const { TypedArray<Vector2i> ret; - if (GDVIRTUAL_CALL(parse_structured_text, p_parser_type, p_args, p_text, ret)) { + if (GDVIRTUAL_CALL(_parse_structured_text, p_parser_type, p_args, p_text, ret)) { return ret; } return TypedArray<Vector2i>(); @@ -1544,7 +1544,7 @@ TypedArray<Vector2i> TextServerExtension::parse_structured_text(StructuredTextPa PackedInt32Array TextServerExtension::string_get_word_breaks(const String &p_string, const String &p_language) const { PackedInt32Array ret; - if (GDVIRTUAL_CALL(string_get_word_breaks, p_string, p_language, ret)) { + if (GDVIRTUAL_CALL(_string_get_word_breaks, p_string, p_language, ret)) { return ret; } return PackedInt32Array(); @@ -1552,7 +1552,7 @@ PackedInt32Array TextServerExtension::string_get_word_breaks(const String &p_str int64_t TextServerExtension::is_confusable(const String &p_string, const PackedStringArray &p_dict) const { int64_t ret; - if (GDVIRTUAL_CALL(is_confusable, p_string, p_dict, ret)) { + if (GDVIRTUAL_CALL(_is_confusable, p_string, p_dict, ret)) { return ret; } return TextServer::is_confusable(p_string, p_dict); @@ -1560,7 +1560,7 @@ int64_t TextServerExtension::is_confusable(const String &p_string, const PackedS bool TextServerExtension::spoof_check(const String &p_string) const { bool ret; - if (GDVIRTUAL_CALL(spoof_check, p_string, ret)) { + if (GDVIRTUAL_CALL(_spoof_check, p_string, ret)) { return ret; } return TextServer::spoof_check(p_string); diff --git a/servers/text/text_server_extension.h b/servers/text/text_server_extension.h index fbaa4961e1..992b708045 100644 --- a/servers/text/text_server_extension.h +++ b/servers/text/text_server_extension.h @@ -50,401 +50,402 @@ public: virtual bool has_feature(Feature p_feature) const override; virtual String get_name() const override; virtual int64_t get_features() const override; - GDVIRTUAL1RC(bool, has_feature, Feature); - GDVIRTUAL0RC(String, get_name); - GDVIRTUAL0RC(int64_t, get_features); + GDVIRTUAL1RC(bool, _has_feature, Feature); + GDVIRTUAL0RC(String, _get_name); + GDVIRTUAL0RC(int64_t, _get_features); virtual void free_rid(const RID &p_rid) override; virtual bool has(const RID &p_rid) override; virtual bool load_support_data(const String &p_filename) override; - GDVIRTUAL1(free_rid, RID); - GDVIRTUAL1R(bool, has, RID); - GDVIRTUAL1R(bool, load_support_data, const String &); + GDVIRTUAL1(_free_rid, RID); + GDVIRTUAL1R(bool, _has, RID); + GDVIRTUAL1R(bool, _load_support_data, const String &); virtual String get_support_data_filename() const override; virtual String get_support_data_info() const override; virtual bool save_support_data(const String &p_filename) const override; - GDVIRTUAL0RC(String, get_support_data_filename); - GDVIRTUAL0RC(String, get_support_data_info); - GDVIRTUAL1RC(bool, save_support_data, const String &); + GDVIRTUAL0RC(String, _get_support_data_filename); + GDVIRTUAL0RC(String, _get_support_data_info); + GDVIRTUAL1RC(bool, _save_support_data, const String &); virtual bool is_locale_right_to_left(const String &p_locale) const override; - GDVIRTUAL1RC(bool, is_locale_right_to_left, const String &); + GDVIRTUAL1RC(bool, _is_locale_right_to_left, const String &); virtual int64_t name_to_tag(const String &p_name) const override; virtual String tag_to_name(int64_t p_tag) const override; - GDVIRTUAL1RC(int64_t, name_to_tag, const String &); - GDVIRTUAL1RC(String, tag_to_name, int64_t); + GDVIRTUAL1RC(int64_t, _name_to_tag, const String &); + GDVIRTUAL1RC(String, _tag_to_name, int64_t); /* Font interface */ + virtual RID create_font() override; - GDVIRTUAL0R(RID, create_font); + GDVIRTUAL0R(RID, _create_font); virtual void font_set_data(const RID &p_font_rid, const PackedByteArray &p_data) override; virtual void font_set_data_ptr(const RID &p_font_rid, const uint8_t *p_data_ptr, int64_t p_data_size) override; - GDVIRTUAL2(font_set_data, RID, const PackedByteArray &); - GDVIRTUAL3(font_set_data_ptr, RID, GDNativeConstPtr<const uint8_t>, int64_t); + GDVIRTUAL2(_font_set_data, RID, const PackedByteArray &); + GDVIRTUAL3(_font_set_data_ptr, RID, GDNativeConstPtr<const uint8_t>, int64_t); virtual void font_set_face_index(const RID &p_font_rid, int64_t p_index) override; virtual int64_t font_get_face_index(const RID &p_font_rid) const override; - GDVIRTUAL2(font_set_face_index, RID, int64_t); - GDVIRTUAL1RC(int64_t, font_get_face_index, RID); + GDVIRTUAL2(_font_set_face_index, RID, int64_t); + GDVIRTUAL1RC(int64_t, _font_get_face_index, RID); virtual int64_t font_get_face_count(const RID &p_font_rid) const override; - GDVIRTUAL1RC(int64_t, font_get_face_count, RID); + GDVIRTUAL1RC(int64_t, _font_get_face_count, RID); virtual void font_set_style(const RID &p_font_rid, BitField<FontStyle> p_style) override; virtual BitField<FontStyle> font_get_style(const RID &p_font_rid) const override; - GDVIRTUAL2(font_set_style, RID, BitField<FontStyle>); - GDVIRTUAL1RC(BitField<FontStyle>, font_get_style, RID); + GDVIRTUAL2(_font_set_style, RID, BitField<FontStyle>); + GDVIRTUAL1RC(BitField<FontStyle>, _font_get_style, RID); virtual void font_set_name(const RID &p_font_rid, const String &p_name) override; virtual String font_get_name(const RID &p_font_rid) const override; - GDVIRTUAL2(font_set_name, RID, const String &); - GDVIRTUAL1RC(String, font_get_name, RID); + GDVIRTUAL2(_font_set_name, RID, const String &); + GDVIRTUAL1RC(String, _font_get_name, RID); virtual void font_set_style_name(const RID &p_font_rid, const String &p_name) override; virtual String font_get_style_name(const RID &p_font_rid) const override; - GDVIRTUAL2(font_set_style_name, RID, const String &); - GDVIRTUAL1RC(String, font_get_style_name, RID); + GDVIRTUAL2(_font_set_style_name, RID, const String &); + GDVIRTUAL1RC(String, _font_get_style_name, RID); - virtual void font_set_antialiasing(RID p_font_rid, TextServer::FontAntialiasing p_antialiasing) override; - virtual TextServer::FontAntialiasing font_get_antialiasing(RID p_font_rid) const override; - GDVIRTUAL2(font_set_antialiasing, RID, TextServer::FontAntialiasing); - GDVIRTUAL1RC(TextServer::FontAntialiasing, font_get_antialiasing, RID); + virtual void font_set_antialiasing(const RID &p_font_rid, TextServer::FontAntialiasing p_antialiasing) override; + virtual TextServer::FontAntialiasing font_get_antialiasing(const RID &p_font_rid) const override; + GDVIRTUAL2(_font_set_antialiasing, RID, TextServer::FontAntialiasing); + GDVIRTUAL1RC(TextServer::FontAntialiasing, _font_get_antialiasing, RID); virtual void font_set_generate_mipmaps(const RID &p_font_rid, bool p_generate_mipmaps) override; virtual bool font_get_generate_mipmaps(const RID &p_font_rid) const override; - GDVIRTUAL2(font_set_generate_mipmaps, RID, bool); - GDVIRTUAL1RC(bool, font_get_generate_mipmaps, RID); + GDVIRTUAL2(_font_set_generate_mipmaps, RID, bool); + GDVIRTUAL1RC(bool, _font_get_generate_mipmaps, RID); virtual void font_set_multichannel_signed_distance_field(const RID &p_font_rid, bool p_msdf) override; virtual bool font_is_multichannel_signed_distance_field(const RID &p_font_rid) const override; - GDVIRTUAL2(font_set_multichannel_signed_distance_field, RID, bool); - GDVIRTUAL1RC(bool, font_is_multichannel_signed_distance_field, RID); + GDVIRTUAL2(_font_set_multichannel_signed_distance_field, RID, bool); + GDVIRTUAL1RC(bool, _font_is_multichannel_signed_distance_field, RID); virtual void font_set_msdf_pixel_range(const RID &p_font_rid, int64_t p_msdf_pixel_range) override; virtual int64_t font_get_msdf_pixel_range(const RID &p_font_rid) const override; - GDVIRTUAL2(font_set_msdf_pixel_range, RID, int64_t); - GDVIRTUAL1RC(int64_t, font_get_msdf_pixel_range, RID); + GDVIRTUAL2(_font_set_msdf_pixel_range, RID, int64_t); + GDVIRTUAL1RC(int64_t, _font_get_msdf_pixel_range, RID); virtual void font_set_msdf_size(const RID &p_font_rid, int64_t p_msdf_size) override; virtual int64_t font_get_msdf_size(const RID &p_font_rid) const override; - GDVIRTUAL2(font_set_msdf_size, RID, int64_t); - GDVIRTUAL1RC(int64_t, font_get_msdf_size, RID); + GDVIRTUAL2(_font_set_msdf_size, RID, int64_t); + GDVIRTUAL1RC(int64_t, _font_get_msdf_size, RID); virtual void font_set_fixed_size(const RID &p_font_rid, int64_t p_fixed_size) override; virtual int64_t font_get_fixed_size(const RID &p_font_rid) const override; - GDVIRTUAL2(font_set_fixed_size, RID, int64_t); - GDVIRTUAL1RC(int64_t, font_get_fixed_size, RID); + GDVIRTUAL2(_font_set_fixed_size, RID, int64_t); + GDVIRTUAL1RC(int64_t, _font_get_fixed_size, RID); virtual void font_set_subpixel_positioning(const RID &p_font_rid, SubpixelPositioning p_subpixel) override; virtual SubpixelPositioning font_get_subpixel_positioning(const RID &p_font_rid) const override; - GDVIRTUAL2(font_set_subpixel_positioning, RID, SubpixelPositioning); - GDVIRTUAL1RC(SubpixelPositioning, font_get_subpixel_positioning, RID); + GDVIRTUAL2(_font_set_subpixel_positioning, RID, SubpixelPositioning); + GDVIRTUAL1RC(SubpixelPositioning, _font_get_subpixel_positioning, RID); virtual void font_set_embolden(const RID &p_font_rid, double p_strength) override; virtual double font_get_embolden(const RID &p_font_rid) const override; - GDVIRTUAL2(font_set_embolden, RID, double); - GDVIRTUAL1RC(double, font_get_embolden, RID); + GDVIRTUAL2(_font_set_embolden, RID, double); + GDVIRTUAL1RC(double, _font_get_embolden, RID); virtual void font_set_transform(const RID &p_font_rid, const Transform2D &p_transform) override; virtual Transform2D font_get_transform(const RID &p_font_rid) const override; - GDVIRTUAL2(font_set_transform, RID, Transform2D); - GDVIRTUAL1RC(Transform2D, font_get_transform, RID); + GDVIRTUAL2(_font_set_transform, RID, Transform2D); + GDVIRTUAL1RC(Transform2D, _font_get_transform, RID); virtual void font_set_force_autohinter(const RID &p_font_rid, bool p_force_autohinter) override; virtual bool font_is_force_autohinter(const RID &p_font_rid) const override; - GDVIRTUAL2(font_set_force_autohinter, RID, bool); - GDVIRTUAL1RC(bool, font_is_force_autohinter, RID); + GDVIRTUAL2(_font_set_force_autohinter, RID, bool); + GDVIRTUAL1RC(bool, _font_is_force_autohinter, RID); virtual void font_set_hinting(const RID &p_font_rid, Hinting p_hinting) override; virtual Hinting font_get_hinting(const RID &p_font_rid) const override; - GDVIRTUAL2(font_set_hinting, RID, Hinting); - GDVIRTUAL1RC(Hinting, font_get_hinting, RID); + GDVIRTUAL2(_font_set_hinting, RID, Hinting); + GDVIRTUAL1RC(Hinting, _font_get_hinting, RID); virtual void font_set_variation_coordinates(const RID &p_font_rid, const Dictionary &p_variation_coordinates) override; virtual Dictionary font_get_variation_coordinates(const RID &p_font_rid) const override; - GDVIRTUAL2(font_set_variation_coordinates, RID, Dictionary); - GDVIRTUAL1RC(Dictionary, font_get_variation_coordinates, RID); + GDVIRTUAL2(_font_set_variation_coordinates, RID, Dictionary); + GDVIRTUAL1RC(Dictionary, _font_get_variation_coordinates, RID); virtual void font_set_oversampling(const RID &p_font_rid, double p_oversampling) override; virtual double font_get_oversampling(const RID &p_font_rid) const override; - GDVIRTUAL2(font_set_oversampling, RID, double); - GDVIRTUAL1RC(double, font_get_oversampling, RID); + GDVIRTUAL2(_font_set_oversampling, RID, double); + GDVIRTUAL1RC(double, _font_get_oversampling, RID); virtual TypedArray<Vector2i> font_get_size_cache_list(const RID &p_font_rid) const override; virtual void font_clear_size_cache(const RID &p_font_rid) override; virtual void font_remove_size_cache(const RID &p_font_rid, const Vector2i &p_size) override; - GDVIRTUAL1RC(TypedArray<Vector2i>, font_get_size_cache_list, RID); - GDVIRTUAL1(font_clear_size_cache, RID); - GDVIRTUAL2(font_remove_size_cache, RID, const Vector2i &); + GDVIRTUAL1RC(TypedArray<Vector2i>, _font_get_size_cache_list, RID); + GDVIRTUAL1(_font_clear_size_cache, RID); + GDVIRTUAL2(_font_remove_size_cache, RID, const Vector2i &); virtual void font_set_ascent(const RID &p_font_rid, int64_t p_size, double p_ascent) override; virtual double font_get_ascent(const RID &p_font_rid, int64_t p_size) const override; - GDVIRTUAL3(font_set_ascent, RID, int64_t, double); - GDVIRTUAL2RC(double, font_get_ascent, RID, int64_t); + GDVIRTUAL3(_font_set_ascent, RID, int64_t, double); + GDVIRTUAL2RC(double, _font_get_ascent, RID, int64_t); virtual void font_set_descent(const RID &p_font_rid, int64_t p_size, double p_descent) override; virtual double font_get_descent(const RID &p_font_rid, int64_t p_size) const override; - GDVIRTUAL3(font_set_descent, RID, int64_t, double); - GDVIRTUAL2RC(double, font_get_descent, RID, int64_t); + GDVIRTUAL3(_font_set_descent, RID, int64_t, double); + GDVIRTUAL2RC(double, _font_get_descent, RID, int64_t); virtual void font_set_underline_position(const RID &p_font_rid, int64_t p_size, double p_underline_position) override; virtual double font_get_underline_position(const RID &p_font_rid, int64_t p_size) const override; - GDVIRTUAL3(font_set_underline_position, RID, int64_t, double); - GDVIRTUAL2RC(double, font_get_underline_position, RID, int64_t); + GDVIRTUAL3(_font_set_underline_position, RID, int64_t, double); + GDVIRTUAL2RC(double, _font_get_underline_position, RID, int64_t); virtual void font_set_underline_thickness(const RID &p_font_rid, int64_t p_size, double p_underline_thickness) override; virtual double font_get_underline_thickness(const RID &p_font_rid, int64_t p_size) const override; - GDVIRTUAL3(font_set_underline_thickness, RID, int64_t, double); - GDVIRTUAL2RC(double, font_get_underline_thickness, RID, int64_t); + GDVIRTUAL3(_font_set_underline_thickness, RID, int64_t, double); + GDVIRTUAL2RC(double, _font_get_underline_thickness, RID, int64_t); virtual void font_set_scale(const RID &p_font_rid, int64_t p_size, double p_scale) override; virtual double font_get_scale(const RID &p_font_rid, int64_t p_size) const override; - GDVIRTUAL3(font_set_scale, RID, int64_t, double); - GDVIRTUAL2RC(double, font_get_scale, RID, int64_t); + GDVIRTUAL3(_font_set_scale, RID, int64_t, double); + GDVIRTUAL2RC(double, _font_get_scale, RID, int64_t); virtual int64_t font_get_texture_count(const RID &p_font_rid, const Vector2i &p_size) const override; virtual void font_clear_textures(const RID &p_font_rid, const Vector2i &p_size) override; virtual void font_remove_texture(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) override; - GDVIRTUAL2RC(int64_t, font_get_texture_count, RID, const Vector2i &); - GDVIRTUAL2(font_clear_textures, RID, const Vector2i &); - GDVIRTUAL3(font_remove_texture, RID, const Vector2i &, int64_t); + GDVIRTUAL2RC(int64_t, _font_get_texture_count, RID, const Vector2i &); + GDVIRTUAL2(_font_clear_textures, RID, const Vector2i &); + GDVIRTUAL3(_font_remove_texture, RID, const Vector2i &, int64_t); virtual void font_set_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const Ref<Image> &p_image) override; virtual Ref<Image> font_get_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const override; - GDVIRTUAL4(font_set_texture_image, RID, const Vector2i &, int64_t, const Ref<Image> &); - GDVIRTUAL3RC(Ref<Image>, font_get_texture_image, RID, const Vector2i &, int64_t); + GDVIRTUAL4(_font_set_texture_image, RID, const Vector2i &, int64_t, const Ref<Image> &); + GDVIRTUAL3RC(Ref<Image>, _font_get_texture_image, RID, const Vector2i &, int64_t); virtual void font_set_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const PackedInt32Array &p_offset) override; virtual PackedInt32Array font_get_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const override; - GDVIRTUAL4(font_set_texture_offsets, RID, const Vector2i &, int64_t, const PackedInt32Array &); - GDVIRTUAL3RC(PackedInt32Array, font_get_texture_offsets, RID, const Vector2i &, int64_t); + GDVIRTUAL4(_font_set_texture_offsets, RID, const Vector2i &, int64_t, const PackedInt32Array &); + GDVIRTUAL3RC(PackedInt32Array, _font_get_texture_offsets, RID, const Vector2i &, int64_t); virtual PackedInt32Array font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const override; virtual void font_clear_glyphs(const RID &p_font_rid, const Vector2i &p_size) override; virtual void font_remove_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) override; - GDVIRTUAL2RC(PackedInt32Array, font_get_glyph_list, RID, const Vector2i &); - GDVIRTUAL2(font_clear_glyphs, RID, const Vector2i &); - GDVIRTUAL3(font_remove_glyph, RID, const Vector2i &, int64_t); + GDVIRTUAL2RC(PackedInt32Array, _font_get_glyph_list, RID, const Vector2i &); + GDVIRTUAL2(_font_clear_glyphs, RID, const Vector2i &); + GDVIRTUAL3(_font_remove_glyph, RID, const Vector2i &, int64_t); virtual Vector2 font_get_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph) const override; virtual void font_set_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph, const Vector2 &p_advance) override; - GDVIRTUAL3RC(Vector2, font_get_glyph_advance, RID, int64_t, int64_t); - GDVIRTUAL4(font_set_glyph_advance, RID, int64_t, int64_t, const Vector2 &); + GDVIRTUAL3RC(Vector2, _font_get_glyph_advance, RID, int64_t, int64_t); + GDVIRTUAL4(_font_set_glyph_advance, RID, int64_t, int64_t, const Vector2 &); virtual Vector2 font_get_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; virtual void font_set_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_offset) override; - GDVIRTUAL3RC(Vector2, font_get_glyph_offset, RID, const Vector2i &, int64_t); - GDVIRTUAL4(font_set_glyph_offset, RID, const Vector2i &, int64_t, const Vector2 &); + GDVIRTUAL3RC(Vector2, _font_get_glyph_offset, RID, const Vector2i &, int64_t); + GDVIRTUAL4(_font_set_glyph_offset, RID, const Vector2i &, int64_t, const Vector2 &); virtual Vector2 font_get_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; virtual void font_set_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_gl_size) override; - GDVIRTUAL3RC(Vector2, font_get_glyph_size, RID, const Vector2i &, int64_t); - GDVIRTUAL4(font_set_glyph_size, RID, const Vector2i &, int64_t, const Vector2 &); + GDVIRTUAL3RC(Vector2, _font_get_glyph_size, RID, const Vector2i &, int64_t); + GDVIRTUAL4(_font_set_glyph_size, RID, const Vector2i &, int64_t, const Vector2 &); virtual Rect2 font_get_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; virtual void font_set_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Rect2 &p_uv_rect) override; - GDVIRTUAL3RC(Rect2, font_get_glyph_uv_rect, RID, const Vector2i &, int64_t); - GDVIRTUAL4(font_set_glyph_uv_rect, RID, const Vector2i &, int64_t, const Rect2 &); + GDVIRTUAL3RC(Rect2, _font_get_glyph_uv_rect, RID, const Vector2i &, int64_t); + GDVIRTUAL4(_font_set_glyph_uv_rect, RID, const Vector2i &, int64_t, const Rect2 &); virtual int64_t font_get_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; virtual void font_set_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, int64_t p_texture_idx) override; - GDVIRTUAL3RC(int64_t, font_get_glyph_texture_idx, RID, const Vector2i &, int64_t); - GDVIRTUAL4(font_set_glyph_texture_idx, RID, const Vector2i &, int64_t, int64_t); + GDVIRTUAL3RC(int64_t, _font_get_glyph_texture_idx, RID, const Vector2i &, int64_t); + GDVIRTUAL4(_font_set_glyph_texture_idx, RID, const Vector2i &, int64_t, int64_t); virtual RID font_get_glyph_texture_rid(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; - GDVIRTUAL3RC(RID, font_get_glyph_texture_rid, RID, const Vector2i &, int64_t); + GDVIRTUAL3RC(RID, _font_get_glyph_texture_rid, RID, const Vector2i &, int64_t); virtual Size2 font_get_glyph_texture_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; - GDVIRTUAL3RC(Size2, font_get_glyph_texture_size, RID, const Vector2i &, int64_t); + GDVIRTUAL3RC(Size2, _font_get_glyph_texture_size, RID, const Vector2i &, int64_t); virtual Dictionary font_get_glyph_contours(const RID &p_font, int64_t p_size, int64_t p_index) const override; - GDVIRTUAL3RC(Dictionary, font_get_glyph_contours, RID, int64_t, int64_t); + GDVIRTUAL3RC(Dictionary, _font_get_glyph_contours, RID, int64_t, int64_t); virtual TypedArray<Vector2i> font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const override; virtual void font_clear_kerning_map(const RID &p_font_rid, int64_t p_size) override; virtual void font_remove_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) override; - GDVIRTUAL2RC(TypedArray<Vector2i>, font_get_kerning_list, RID, int64_t); - GDVIRTUAL2(font_clear_kerning_map, RID, int64_t); - GDVIRTUAL3(font_remove_kerning, RID, int64_t, const Vector2i &); + GDVIRTUAL2RC(TypedArray<Vector2i>, _font_get_kerning_list, RID, int64_t); + GDVIRTUAL2(_font_clear_kerning_map, RID, int64_t); + GDVIRTUAL3(_font_remove_kerning, RID, int64_t, const Vector2i &); virtual void font_set_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair, const Vector2 &p_kerning) override; virtual Vector2 font_get_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) const override; - GDVIRTUAL4(font_set_kerning, RID, int64_t, const Vector2i &, const Vector2 &); - GDVIRTUAL3RC(Vector2, font_get_kerning, RID, int64_t, const Vector2i &); + GDVIRTUAL4(_font_set_kerning, RID, int64_t, const Vector2i &, const Vector2 &); + GDVIRTUAL3RC(Vector2, _font_get_kerning, RID, int64_t, const Vector2i &); virtual int64_t font_get_glyph_index(const RID &p_font_rid, int64_t p_size, int64_t p_char, int64_t p_variation_selector = 0) const override; - GDVIRTUAL4RC(int64_t, font_get_glyph_index, RID, int64_t, int64_t, int64_t); + GDVIRTUAL4RC(int64_t, _font_get_glyph_index, RID, int64_t, int64_t, int64_t); virtual bool font_has_char(const RID &p_font_rid, int64_t p_char) const override; virtual String font_get_supported_chars(const RID &p_font_rid) const override; - GDVIRTUAL2RC(bool, font_has_char, RID, int64_t); - GDVIRTUAL1RC(String, font_get_supported_chars, RID); + GDVIRTUAL2RC(bool, _font_has_char, RID, int64_t); + GDVIRTUAL1RC(String, _font_get_supported_chars, RID); virtual void font_render_range(const RID &p_font, const Vector2i &p_size, int64_t p_start, int64_t p_end) override; virtual void font_render_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_index) override; - GDVIRTUAL4(font_render_range, RID, const Vector2i &, int64_t, int64_t); - GDVIRTUAL3(font_render_glyph, RID, const Vector2i &, int64_t); + GDVIRTUAL4(_font_render_range, RID, const Vector2i &, int64_t, int64_t); + GDVIRTUAL3(_font_render_glyph, RID, const Vector2i &, int64_t); virtual void font_draw_glyph(const RID &p_font, const RID &p_canvas, int64_t p_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color = Color(1, 1, 1)) const override; virtual void font_draw_glyph_outline(const RID &p_font, 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 = Color(1, 1, 1)) const override; - GDVIRTUAL6C(font_draw_glyph, RID, RID, int64_t, const Vector2 &, int64_t, const Color &); - GDVIRTUAL7C(font_draw_glyph_outline, RID, RID, int64_t, int64_t, const Vector2 &, int64_t, const Color &); + GDVIRTUAL6C(_font_draw_glyph, RID, RID, int64_t, const Vector2 &, int64_t, const Color &); + GDVIRTUAL7C(_font_draw_glyph_outline, RID, RID, int64_t, int64_t, const Vector2 &, int64_t, const Color &); virtual bool font_is_language_supported(const RID &p_font_rid, const String &p_language) const override; virtual void font_set_language_support_override(const RID &p_font_rid, const String &p_language, bool p_supported) override; virtual bool font_get_language_support_override(const RID &p_font_rid, const String &p_language) override; virtual void font_remove_language_support_override(const RID &p_font_rid, const String &p_language) override; virtual PackedStringArray font_get_language_support_overrides(const RID &p_font_rid) override; - GDVIRTUAL2RC(bool, font_is_language_supported, RID, const String &); - GDVIRTUAL3(font_set_language_support_override, RID, const String &, bool); - GDVIRTUAL2R(bool, font_get_language_support_override, RID, const String &); - GDVIRTUAL2(font_remove_language_support_override, RID, const String &); - GDVIRTUAL1R(PackedStringArray, font_get_language_support_overrides, RID); + GDVIRTUAL2RC(bool, _font_is_language_supported, RID, const String &); + GDVIRTUAL3(_font_set_language_support_override, RID, const String &, bool); + GDVIRTUAL2R(bool, _font_get_language_support_override, RID, const String &); + GDVIRTUAL2(_font_remove_language_support_override, RID, const String &); + GDVIRTUAL1R(PackedStringArray, _font_get_language_support_overrides, RID); virtual bool font_is_script_supported(const RID &p_font_rid, const String &p_script) const override; virtual void font_set_script_support_override(const RID &p_font_rid, const String &p_script, bool p_supported) override; virtual bool font_get_script_support_override(const RID &p_font_rid, const String &p_script) override; virtual void font_remove_script_support_override(const RID &p_font_rid, const String &p_script) override; virtual PackedStringArray font_get_script_support_overrides(const RID &p_font_rid) override; - GDVIRTUAL2RC(bool, font_is_script_supported, RID, const String &); - GDVIRTUAL3(font_set_script_support_override, RID, const String &, bool); - GDVIRTUAL2R(bool, font_get_script_support_override, RID, const String &); - GDVIRTUAL2(font_remove_script_support_override, RID, const String &); - GDVIRTUAL1R(PackedStringArray, font_get_script_support_overrides, RID); + GDVIRTUAL2RC(bool, _font_is_script_supported, RID, const String &); + GDVIRTUAL3(_font_set_script_support_override, RID, const String &, bool); + GDVIRTUAL2R(bool, _font_get_script_support_override, RID, const String &); + GDVIRTUAL2(_font_remove_script_support_override, RID, const String &); + GDVIRTUAL1R(PackedStringArray, _font_get_script_support_overrides, RID); virtual void font_set_opentype_feature_overrides(const RID &p_font_rid, const Dictionary &p_overrides) override; virtual Dictionary font_get_opentype_feature_overrides(const RID &p_font_rid) const override; - GDVIRTUAL2(font_set_opentype_feature_overrides, RID, const Dictionary &); - GDVIRTUAL1RC(Dictionary, font_get_opentype_feature_overrides, RID); + GDVIRTUAL2(_font_set_opentype_feature_overrides, RID, const Dictionary &); + GDVIRTUAL1RC(Dictionary, _font_get_opentype_feature_overrides, RID); virtual Dictionary font_supported_feature_list(const RID &p_font_rid) const override; virtual Dictionary font_supported_variation_list(const RID &p_font_rid) const override; - GDVIRTUAL1RC(Dictionary, font_supported_feature_list, RID); - GDVIRTUAL1RC(Dictionary, font_supported_variation_list, RID); + GDVIRTUAL1RC(Dictionary, _font_supported_feature_list, RID); + GDVIRTUAL1RC(Dictionary, _font_supported_variation_list, RID); virtual double font_get_global_oversampling() const override; virtual void font_set_global_oversampling(double p_oversampling) override; - GDVIRTUAL0RC(double, font_get_global_oversampling); - GDVIRTUAL1(font_set_global_oversampling, double); + GDVIRTUAL0RC(double, _font_get_global_oversampling); + GDVIRTUAL1(_font_set_global_oversampling, double); virtual Vector2 get_hex_code_box_size(int64_t p_size, int64_t p_index) const override; virtual void 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 override; - GDVIRTUAL2RC(Vector2, get_hex_code_box_size, int64_t, int64_t); - GDVIRTUAL5C(draw_hex_code_box, RID, int64_t, const Vector2 &, int64_t, const Color &); + GDVIRTUAL2RC(Vector2, _get_hex_code_box_size, int64_t, int64_t); + GDVIRTUAL5C(_draw_hex_code_box, RID, int64_t, const Vector2 &, int64_t, const Color &); /* Shaped text buffer interface */ virtual RID create_shaped_text(Direction p_direction = DIRECTION_AUTO, Orientation p_orientation = ORIENTATION_HORIZONTAL) override; - GDVIRTUAL2R(RID, create_shaped_text, Direction, Orientation); + GDVIRTUAL2R(RID, _create_shaped_text, Direction, Orientation); virtual void shaped_text_clear(const RID &p_shaped) override; - GDVIRTUAL1(shaped_text_clear, RID); + GDVIRTUAL1(_shaped_text_clear, RID); virtual void shaped_text_set_direction(const RID &p_shaped, Direction p_direction = DIRECTION_AUTO) override; virtual Direction shaped_text_get_direction(const RID &p_shaped) const override; virtual Direction shaped_text_get_inferred_direction(const RID &p_shaped) const override; - GDVIRTUAL2(shaped_text_set_direction, RID, Direction); - GDVIRTUAL1RC(Direction, shaped_text_get_direction, RID); - GDVIRTUAL1RC(Direction, shaped_text_get_inferred_direction, RID); + GDVIRTUAL2(_shaped_text_set_direction, RID, Direction); + GDVIRTUAL1RC(Direction, _shaped_text_get_direction, RID); + GDVIRTUAL1RC(Direction, _shaped_text_get_inferred_direction, RID); virtual void shaped_text_set_bidi_override(const RID &p_shaped, const Array &p_override) override; - GDVIRTUAL2(shaped_text_set_bidi_override, RID, const Array &); + GDVIRTUAL2(_shaped_text_set_bidi_override, RID, const Array &); virtual void shaped_text_set_custom_punctuation(const RID &p_shaped, const String &p_punct) override; virtual String shaped_text_get_custom_punctuation(const RID &p_shaped) const override; - GDVIRTUAL2(shaped_text_set_custom_punctuation, RID, String); - GDVIRTUAL1RC(String, shaped_text_get_custom_punctuation, RID); + GDVIRTUAL2(_shaped_text_set_custom_punctuation, RID, String); + GDVIRTUAL1RC(String, _shaped_text_get_custom_punctuation, RID); virtual void shaped_text_set_orientation(const RID &p_shaped, Orientation p_orientation = ORIENTATION_HORIZONTAL) override; virtual Orientation shaped_text_get_orientation(const RID &p_shaped) const override; - GDVIRTUAL2(shaped_text_set_orientation, RID, Orientation); - GDVIRTUAL1RC(Orientation, shaped_text_get_orientation, RID); + GDVIRTUAL2(_shaped_text_set_orientation, RID, Orientation); + GDVIRTUAL1RC(Orientation, _shaped_text_get_orientation, RID); virtual void shaped_text_set_preserve_invalid(const RID &p_shaped, bool p_enabled) override; virtual bool shaped_text_get_preserve_invalid(const RID &p_shaped) const override; - GDVIRTUAL2(shaped_text_set_preserve_invalid, RID, bool); - GDVIRTUAL1RC(bool, shaped_text_get_preserve_invalid, RID); + GDVIRTUAL2(_shaped_text_set_preserve_invalid, RID, bool); + GDVIRTUAL1RC(bool, _shaped_text_get_preserve_invalid, RID); virtual void shaped_text_set_preserve_control(const RID &p_shaped, bool p_enabled) override; virtual bool shaped_text_get_preserve_control(const RID &p_shaped) const override; - GDVIRTUAL2(shaped_text_set_preserve_control, RID, bool); - GDVIRTUAL1RC(bool, shaped_text_get_preserve_control, RID); + GDVIRTUAL2(_shaped_text_set_preserve_control, RID, bool); + GDVIRTUAL1RC(bool, _shaped_text_get_preserve_control, RID); virtual void shaped_text_set_spacing(const RID &p_shaped, SpacingType p_spacing, int64_t p_value) override; virtual int64_t shaped_text_get_spacing(const RID &p_shaped, SpacingType p_spacing) const override; - GDVIRTUAL3(shaped_text_set_spacing, RID, SpacingType, int64_t); - GDVIRTUAL2RC(int64_t, shaped_text_get_spacing, RID, SpacingType); + GDVIRTUAL3(_shaped_text_set_spacing, RID, SpacingType, int64_t); + GDVIRTUAL2RC(int64_t, _shaped_text_get_spacing, RID, SpacingType); virtual bool 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 = Dictionary(), const String &p_language = "", const Variant &p_meta = Variant()) override; virtual bool shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, int64_t p_length = 1) override; virtual bool shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER) override; - GDVIRTUAL7R(bool, shaped_text_add_string, RID, const String &, const TypedArray<RID> &, int64_t, const Dictionary &, const String &, const Variant &); - GDVIRTUAL5R(bool, shaped_text_add_object, RID, const Variant &, const Size2 &, InlineAlignment, int64_t); - GDVIRTUAL4R(bool, shaped_text_resize_object, RID, const Variant &, const Size2 &, InlineAlignment); + GDVIRTUAL7R(bool, _shaped_text_add_string, RID, const String &, const TypedArray<RID> &, int64_t, const Dictionary &, const String &, const Variant &); + GDVIRTUAL5R(bool, _shaped_text_add_object, RID, const Variant &, const Size2 &, InlineAlignment, int64_t); + GDVIRTUAL4R(bool, _shaped_text_resize_object, RID, const Variant &, const Size2 &, InlineAlignment); virtual int64_t shaped_get_span_count(const RID &p_shaped) const override; virtual Variant shaped_get_span_meta(const RID &p_shaped, int64_t p_index) const override; virtual void 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 = Dictionary()) override; - GDVIRTUAL1RC(int64_t, shaped_get_span_count, RID); - GDVIRTUAL2RC(Variant, shaped_get_span_meta, RID, int64_t); - GDVIRTUAL5(shaped_set_span_update_font, RID, int64_t, const TypedArray<RID> &, int64_t, const Dictionary &); + GDVIRTUAL1RC(int64_t, _shaped_get_span_count, RID); + GDVIRTUAL2RC(Variant, _shaped_get_span_meta, RID, int64_t); + GDVIRTUAL5(_shaped_set_span_update_font, RID, int64_t, const TypedArray<RID> &, int64_t, const Dictionary &); virtual RID shaped_text_substr(const RID &p_shaped, int64_t p_start, int64_t p_length) const override; virtual RID shaped_text_get_parent(const RID &p_shaped) const override; - GDVIRTUAL3RC(RID, shaped_text_substr, RID, int64_t, int64_t); - GDVIRTUAL1RC(RID, shaped_text_get_parent, RID); + GDVIRTUAL3RC(RID, _shaped_text_substr, RID, int64_t, int64_t); + GDVIRTUAL1RC(RID, _shaped_text_get_parent, RID); virtual double shaped_text_fit_to_width(const RID &p_shaped, double p_width, BitField<TextServer::JustificationFlag> p_jst_flags = JUSTIFICATION_WORD_BOUND | JUSTIFICATION_KASHIDA) override; virtual double shaped_text_tab_align(const RID &p_shaped, const PackedFloat32Array &p_tab_stops) override; - GDVIRTUAL3R(double, shaped_text_fit_to_width, RID, double, BitField<TextServer::JustificationFlag>); - GDVIRTUAL2R(double, shaped_text_tab_align, RID, const PackedFloat32Array &); + GDVIRTUAL3R(double, _shaped_text_fit_to_width, RID, double, BitField<TextServer::JustificationFlag>); + GDVIRTUAL2R(double, _shaped_text_tab_align, RID, const PackedFloat32Array &); virtual bool shaped_text_shape(const RID &p_shaped) override; virtual bool shaped_text_update_breaks(const RID &p_shaped) override; virtual bool shaped_text_update_justification_ops(const RID &p_shaped) override; - GDVIRTUAL1R(bool, shaped_text_shape, RID); - GDVIRTUAL1R(bool, shaped_text_update_breaks, RID); - GDVIRTUAL1R(bool, shaped_text_update_justification_ops, RID); + GDVIRTUAL1R(bool, _shaped_text_shape, RID); + GDVIRTUAL1R(bool, _shaped_text_update_breaks, RID); + GDVIRTUAL1R(bool, _shaped_text_update_justification_ops, RID); virtual bool shaped_text_is_ready(const RID &p_shaped) const override; - GDVIRTUAL1RC(bool, shaped_text_is_ready, RID); + GDVIRTUAL1RC(bool, _shaped_text_is_ready, RID); virtual const Glyph *shaped_text_get_glyphs(const RID &p_shaped) const override; virtual const Glyph *shaped_text_sort_logical(const RID &p_shaped) override; virtual int64_t shaped_text_get_glyph_count(const RID &p_shaped) const override; - GDVIRTUAL1RC(GDNativeConstPtr<const Glyph>, shaped_text_get_glyphs, RID); - GDVIRTUAL1R(GDNativeConstPtr<const Glyph>, shaped_text_sort_logical, RID); - GDVIRTUAL1RC(int64_t, shaped_text_get_glyph_count, RID); + GDVIRTUAL1RC(GDNativeConstPtr<const Glyph>, _shaped_text_get_glyphs, RID); + GDVIRTUAL1R(GDNativeConstPtr<const Glyph>, _shaped_text_sort_logical, RID); + GDVIRTUAL1RC(int64_t, _shaped_text_get_glyph_count, RID); virtual Vector2i shaped_text_get_range(const RID &p_shaped) const override; - GDVIRTUAL1RC(Vector2i, shaped_text_get_range, RID); + GDVIRTUAL1RC(Vector2i, _shaped_text_get_range, RID); virtual PackedInt32Array shaped_text_get_line_breaks_adv(const RID &p_shaped, const PackedFloat32Array &p_width, int64_t p_start = 0, bool p_once = true, BitField<TextServer::LineBreakFlag> p_break_flags = BREAK_MANDATORY | BREAK_WORD_BOUND) const override; virtual PackedInt32Array shaped_text_get_line_breaks(const RID &p_shaped, double p_width, int64_t p_start = 0, BitField<TextServer::LineBreakFlag> p_break_flags = BREAK_MANDATORY | BREAK_WORD_BOUND) const override; virtual PackedInt32Array shaped_text_get_word_breaks(const RID &p_shaped, BitField<TextServer::GraphemeFlag> p_grapheme_flags = GRAPHEME_IS_SPACE | GRAPHEME_IS_PUNCTUATION) const override; - GDVIRTUAL5RC(PackedInt32Array, shaped_text_get_line_breaks_adv, RID, const PackedFloat32Array &, int64_t, bool, BitField<TextServer::LineBreakFlag>); - GDVIRTUAL4RC(PackedInt32Array, shaped_text_get_line_breaks, RID, double, int64_t, BitField<TextServer::LineBreakFlag>); - GDVIRTUAL2RC(PackedInt32Array, shaped_text_get_word_breaks, RID, BitField<TextServer::GraphemeFlag>); + GDVIRTUAL5RC(PackedInt32Array, _shaped_text_get_line_breaks_adv, RID, const PackedFloat32Array &, int64_t, bool, BitField<TextServer::LineBreakFlag>); + GDVIRTUAL4RC(PackedInt32Array, _shaped_text_get_line_breaks, RID, double, int64_t, BitField<TextServer::LineBreakFlag>); + GDVIRTUAL2RC(PackedInt32Array, _shaped_text_get_word_breaks, RID, BitField<TextServer::GraphemeFlag>); virtual int64_t shaped_text_get_trim_pos(const RID &p_shaped) const override; virtual int64_t shaped_text_get_ellipsis_pos(const RID &p_shaped) const override; virtual const Glyph *shaped_text_get_ellipsis_glyphs(const RID &p_shaped) const override; virtual int64_t shaped_text_get_ellipsis_glyph_count(const RID &p_shaped) const override; - GDVIRTUAL1RC(int64_t, shaped_text_get_trim_pos, RID); - GDVIRTUAL1RC(int64_t, shaped_text_get_ellipsis_pos, RID); - GDVIRTUAL1RC(GDNativeConstPtr<const Glyph>, shaped_text_get_ellipsis_glyphs, RID); - GDVIRTUAL1RC(int64_t, shaped_text_get_ellipsis_glyph_count, RID); + GDVIRTUAL1RC(int64_t, _shaped_text_get_trim_pos, RID); + GDVIRTUAL1RC(int64_t, _shaped_text_get_ellipsis_pos, RID); + GDVIRTUAL1RC(GDNativeConstPtr<const Glyph>, _shaped_text_get_ellipsis_glyphs, RID); + GDVIRTUAL1RC(int64_t, _shaped_text_get_ellipsis_glyph_count, RID); virtual void shaped_text_overrun_trim_to_width(const RID &p_shaped, double p_width, BitField<TextServer::TextOverrunFlag> p_trim_flags) override; - GDVIRTUAL3(shaped_text_overrun_trim_to_width, RID, double, BitField<TextServer::TextOverrunFlag>); + GDVIRTUAL3(_shaped_text_overrun_trim_to_width, RID, double, BitField<TextServer::TextOverrunFlag>); virtual Array shaped_text_get_objects(const RID &p_shaped) const override; virtual Rect2 shaped_text_get_object_rect(const RID &p_shaped, const Variant &p_key) const override; - GDVIRTUAL1RC(Array, shaped_text_get_objects, RID); - GDVIRTUAL2RC(Rect2, shaped_text_get_object_rect, RID, const Variant &); + GDVIRTUAL1RC(Array, _shaped_text_get_objects, RID); + GDVIRTUAL2RC(Rect2, _shaped_text_get_object_rect, RID, const Variant &); virtual Size2 shaped_text_get_size(const RID &p_shaped) const override; virtual double shaped_text_get_ascent(const RID &p_shaped) const override; @@ -452,66 +453,66 @@ public: virtual double shaped_text_get_width(const RID &p_shaped) const override; virtual double shaped_text_get_underline_position(const RID &p_shaped) const override; virtual double shaped_text_get_underline_thickness(const RID &p_shaped) const override; - GDVIRTUAL1RC(Size2, shaped_text_get_size, RID); - GDVIRTUAL1RC(double, shaped_text_get_ascent, RID); - GDVIRTUAL1RC(double, shaped_text_get_descent, RID); - GDVIRTUAL1RC(double, shaped_text_get_width, RID); - GDVIRTUAL1RC(double, shaped_text_get_underline_position, RID); - GDVIRTUAL1RC(double, shaped_text_get_underline_thickness, RID); + GDVIRTUAL1RC(Size2, _shaped_text_get_size, RID); + GDVIRTUAL1RC(double, _shaped_text_get_ascent, RID); + GDVIRTUAL1RC(double, _shaped_text_get_descent, RID); + GDVIRTUAL1RC(double, _shaped_text_get_width, RID); + GDVIRTUAL1RC(double, _shaped_text_get_underline_position, RID); + GDVIRTUAL1RC(double, _shaped_text_get_underline_thickness, RID); virtual Direction shaped_text_get_dominant_direction_in_range(const RID &p_shaped, int64_t p_start, int64_t p_end) const override; - GDVIRTUAL3RC(int64_t, shaped_text_get_dominant_direction_in_range, RID, int64_t, int64_t); + GDVIRTUAL3RC(int64_t, _shaped_text_get_dominant_direction_in_range, RID, int64_t, int64_t); virtual CaretInfo shaped_text_get_carets(const RID &p_shaped, int64_t p_position) const override; virtual Vector<Vector2> shaped_text_get_selection(const RID &p_shaped, int64_t p_start, int64_t p_end) const override; - GDVIRTUAL3C(shaped_text_get_carets, RID, int64_t, GDNativePtr<CaretInfo>); - GDVIRTUAL3RC(Vector<Vector2>, shaped_text_get_selection, RID, int64_t, int64_t); + GDVIRTUAL3C(_shaped_text_get_carets, RID, int64_t, GDNativePtr<CaretInfo>); + GDVIRTUAL3RC(Vector<Vector2>, _shaped_text_get_selection, RID, int64_t, int64_t); virtual int64_t shaped_text_hit_test_grapheme(const RID &p_shaped, double p_coords) const override; virtual int64_t shaped_text_hit_test_position(const RID &p_shaped, double p_coords) const override; - GDVIRTUAL2RC(int64_t, shaped_text_hit_test_grapheme, RID, double); - GDVIRTUAL2RC(int64_t, shaped_text_hit_test_position, RID, double); + GDVIRTUAL2RC(int64_t, _shaped_text_hit_test_grapheme, RID, double); + GDVIRTUAL2RC(int64_t, _shaped_text_hit_test_position, RID, double); virtual void shaped_text_draw(const RID &p_shaped, const RID &p_canvas, const Vector2 &p_pos, double p_clip_l = -1.0, double p_clip_r = -1.0, const Color &p_color = Color(1, 1, 1)) const override; virtual void shaped_text_draw_outline(const RID &p_shaped, const RID &p_canvas, const Vector2 &p_pos, double p_clip_l = -1.0, double p_clip_r = -1.0, int64_t p_outline_size = 1, const Color &p_color = Color(1, 1, 1)) const override; - GDVIRTUAL6C(shaped_text_draw, RID, RID, const Vector2 &, double, double, const Color &); - GDVIRTUAL7C(shaped_text_draw_outline, RID, RID, const Vector2 &, double, double, int64_t, const Color &); + GDVIRTUAL6C(_shaped_text_draw, RID, RID, const Vector2 &, double, double, const Color &); + GDVIRTUAL7C(_shaped_text_draw_outline, RID, RID, const Vector2 &, double, double, int64_t, const Color &); virtual Vector2 shaped_text_get_grapheme_bounds(const RID &p_shaped, int64_t p_pos) const override; virtual int64_t shaped_text_next_grapheme_pos(const RID &p_shaped, int64_t p_pos) const override; virtual int64_t shaped_text_prev_grapheme_pos(const RID &p_shaped, int64_t p_pos) const override; - GDVIRTUAL2RC(Vector2, shaped_text_get_grapheme_bounds, RID, int64_t); - GDVIRTUAL2RC(int64_t, shaped_text_next_grapheme_pos, RID, int64_t); - GDVIRTUAL2RC(int64_t, shaped_text_prev_grapheme_pos, RID, int64_t); + GDVIRTUAL2RC(Vector2, _shaped_text_get_grapheme_bounds, RID, int64_t); + GDVIRTUAL2RC(int64_t, _shaped_text_next_grapheme_pos, RID, int64_t); + GDVIRTUAL2RC(int64_t, _shaped_text_prev_grapheme_pos, RID, int64_t); virtual String format_number(const String &p_string, const String &p_language = "") const override; virtual String parse_number(const String &p_string, const String &p_language = "") const override; virtual String percent_sign(const String &p_language = "") const override; - GDVIRTUAL2RC(String, format_number, const String &, const String &); - GDVIRTUAL2RC(String, parse_number, const String &, const String &); - GDVIRTUAL1RC(String, percent_sign, const String &); + GDVIRTUAL2RC(String, _format_number, const String &, const String &); + GDVIRTUAL2RC(String, _parse_number, const String &, const String &); + GDVIRTUAL1RC(String, _percent_sign, const String &); virtual String strip_diacritics(const String &p_string) const override; - GDVIRTUAL1RC(String, strip_diacritics, const String &); + GDVIRTUAL1RC(String, _strip_diacritics, const String &); virtual PackedInt32Array string_get_word_breaks(const String &p_string, const String &p_language = "") const override; - GDVIRTUAL2RC(PackedInt32Array, string_get_word_breaks, const String &, const String &); + GDVIRTUAL2RC(PackedInt32Array, _string_get_word_breaks, const String &, const String &); virtual bool is_valid_identifier(const String &p_string) const override; - GDVIRTUAL1RC(bool, is_valid_identifier, const String &); + GDVIRTUAL1RC(bool, _is_valid_identifier, const String &); virtual String string_to_upper(const String &p_string, const String &p_language = "") const override; virtual String string_to_lower(const String &p_string, const String &p_language = "") const override; - GDVIRTUAL2RC(String, string_to_upper, const String &, const String &); - GDVIRTUAL2RC(String, string_to_lower, const String &, const String &); + GDVIRTUAL2RC(String, _string_to_upper, const String &, const String &); + GDVIRTUAL2RC(String, _string_to_lower, const String &, const String &); TypedArray<Vector2i> parse_structured_text(StructuredTextParser p_parser_type, const Array &p_args, const String &p_text) const; - GDVIRTUAL3RC(TypedArray<Vector2i>, parse_structured_text, StructuredTextParser, const Array &, const String &); + GDVIRTUAL3RC(TypedArray<Vector2i>, _parse_structured_text, StructuredTextParser, const Array &, const String &); virtual int64_t is_confusable(const String &p_string, const PackedStringArray &p_dict) const override; virtual bool spoof_check(const String &p_string) const override; - GDVIRTUAL2RC(int64_t, is_confusable, const String &, const PackedStringArray &); - GDVIRTUAL1RC(bool, spoof_check, const String &); + GDVIRTUAL2RC(int64_t, _is_confusable, const String &, const PackedStringArray &); + GDVIRTUAL1RC(bool, _spoof_check, const String &); TextServerExtension(); ~TextServerExtension(); diff --git a/servers/text_server.cpp b/servers/text_server.cpp index 660247839c..588c837a40 100644 --- a/servers/text_server.cpp +++ b/servers/text_server.cpp @@ -468,6 +468,7 @@ void TextServer::_bind_methods() { BIND_ENUM_CONSTANT(FONT_LCD_SUBPIXEL_LAYOUT_HBGR); BIND_ENUM_CONSTANT(FONT_LCD_SUBPIXEL_LAYOUT_VRGB); BIND_ENUM_CONSTANT(FONT_LCD_SUBPIXEL_LAYOUT_VBGR); + BIND_ENUM_CONSTANT(FONT_LCD_SUBPIXEL_LAYOUT_MAX); /* Direction */ BIND_ENUM_CONSTANT(DIRECTION_AUTO); diff --git a/servers/text_server.h b/servers/text_server.h index a0624c2c05..a4e6080fd0 100644 --- a/servers/text_server.h +++ b/servers/text_server.h @@ -230,6 +230,7 @@ public: virtual String tag_to_name(int64_t p_tag) const { return ""; }; /* Font interface */ + virtual RID create_font() = 0; virtual void font_set_data(const RID &p_font_rid, const PackedByteArray &p_data) = 0; @@ -249,8 +250,8 @@ public: virtual void font_set_style_name(const RID &p_font_rid, const String &p_name) = 0; virtual String font_get_style_name(const RID &p_font_rid) const = 0; - virtual void font_set_antialiasing(RID p_font_rid, FontAntialiasing p_antialiasing) = 0; - virtual FontAntialiasing font_get_antialiasing(RID p_font_rid) const = 0; + virtual void font_set_antialiasing(const RID &p_font_rid, FontAntialiasing p_antialiasing) = 0; + virtual FontAntialiasing font_get_antialiasing(const RID &p_font_rid) const = 0; virtual void font_set_generate_mipmaps(const RID &p_font_rid, bool p_generate_mipmaps) = 0; virtual bool font_get_generate_mipmaps(const RID &p_font_rid) const = 0; diff --git a/servers/xr/xr_interface.cpp b/servers/xr/xr_interface.cpp index 4b9ea40223..430a5bfd16 100644 --- a/servers/xr/xr_interface.cpp +++ b/servers/xr/xr_interface.cpp @@ -68,6 +68,11 @@ void XRInterface::_bind_methods() { ClassDB::bind_method(D_METHOD("set_anchor_detection_is_enabled", "enable"), &XRInterface::set_anchor_detection_is_enabled); ClassDB::bind_method(D_METHOD("get_camera_feed_id"), &XRInterface::get_camera_feed_id); + ClassDB::bind_method(D_METHOD("is_passthrough_supported"), &XRInterface::is_passthrough_supported); + ClassDB::bind_method(D_METHOD("is_passthrough_enabled"), &XRInterface::is_passthrough_enabled); + ClassDB::bind_method(D_METHOD("start_passthrough"), &XRInterface::start_passthrough); + ClassDB::bind_method(D_METHOD("stop_passthrough"), &XRInterface::stop_passthrough); + ADD_GROUP("AR", "ar_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ar_is_anchor_detection_enabled"), "set_anchor_detection_is_enabled", "get_anchor_detection_is_enabled"); diff --git a/servers/xr/xr_interface.h b/servers/xr/xr_interface.h index f11458f1cc..17ff5f8add 100644 --- a/servers/xr/xr_interface.h +++ b/servers/xr/xr_interface.h @@ -130,6 +130,13 @@ public: virtual Vector<BlitToScreen> post_draw_viewport(RID p_render_target, const Rect2 &p_screen_rect) = 0; /* inform XR interface we finished our viewport draw process */ virtual void end_frame(){}; + /** passthrough **/ + + virtual bool is_passthrough_supported() { return false; } + virtual bool is_passthrough_enabled() { return false; } + virtual bool start_passthrough() { return false; } + virtual void stop_passthrough() {} + virtual void notification(int p_what){}; XRInterface(); diff --git a/tests/core/object/test_class_db.h b/tests/core/object/test_class_db.h index 208923edb9..b0375c63b9 100644 --- a/tests/core/object/test_class_db.h +++ b/tests/core/object/test_class_db.h @@ -666,6 +666,10 @@ void add_exposed_classes(Context &r_context) { } else { exposed_class.methods.push_back(method); } + + if (method.is_virtual) { + TEST_COND(String(method.name)[0] != '_', "Virtual method ", String(method.name), " does not start with underscore."); + } } // Add signals |