Class reference
TextServerExtension
Inherits TextServer
Base class for custom TextServer implementations (plugins).
Description
External TextServer implementations should inherit from this class.
Methods
void _cleanup() virtual
This method is called before text server is unregistered.
RID _create_font() virtual required
RID _create_font() virtual requiredCreates a new, empty font cache entry resource.
RID _create_font_linked_variation(RID font_rid) virtual
RID _create_font_linked_variation(RID font_rid) virtualOptional, implement if font supports extra spacing or baseline offset. Creates a new variation existing font which is reusing the same glyph cache and font data.
RID _create_shaped_text(int direction, int orientation) virtual required
RID _create_shaped_text(int direction, int orientation) virtual requiredCreates a new buffer for complex text layout, with the given direction and orientation.
void _draw_hex_code_box(RID canvas, int size, Vector2 pos, int index, Color color) virtual const
RID canvas, int size, Vector2 pos, int index, Color color) virtual constDraws box displaying character hexadecimal code.
void _font_clear_glyphs(RID font_rid, Vector2i size) virtual required
RID font_rid, Vector2i size) virtual requiredRemoves all rendered glyph information from the cache entry.
void _font_clear_kerning_map(RID font_rid, int size) virtual
RID font_rid, int size) virtualRemoves all kerning overrides.
void _font_clear_size_cache(RID font_rid) virtual required
RID font_rid) virtual requiredRemoves all font sizes from the cache entry.
void _font_clear_system_fallback_cache() virtual
Frees all automatically loaded system fonts.
void _font_clear_textures(RID font_rid, Vector2i size) virtual required
RID font_rid, Vector2i size) virtual requiredRemoves all textures from font cache entry.
void _font_draw_glyph(RID font_rid, RID canvas, int size, Vector2 pos, int index, Color color, float oversampling) virtual required const
RID font_rid, RID canvas, int size, Vector2 pos, int index, Color color, float oversampling) virtual required constDraws single glyph into a canvas item at the position, using font_rid at the size size. If oversampling is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.
void _font_draw_glyph_outline(RID font_rid, RID canvas, int size, int outline_size, Vector2 pos, int index, Color color, float oversampling) virtual required const
RID font_rid, RID canvas, int size, int outline_size, Vector2 pos, int index, Color color, float oversampling) virtual required constDraws single glyph outline of size outline_size into a canvas item at the position, using font_rid at the size size. If oversampling is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.
int _font_get_antialiasing(RID font_rid) virtual const
int _font_get_antialiasing(RID font_rid) virtual constReturns font anti-aliasing mode.
float _font_get_ascent(RID font_rid, int size) virtual required const
float _font_get_ascent(RID font_rid, int size) virtual required constReturns the font ascent (number of pixels above the baseline).
float _font_get_baseline_offset(RID font_rid) virtual const
float _font_get_baseline_offset(RID font_rid) virtual constReturns extra baseline offset (as a fraction of font height).
int _font_get_char_from_glyph_index(RID font_rid, int size, int glyph_index) virtual required const
int _font_get_char_from_glyph_index(RID font_rid, int size, int glyph_index) virtual required constReturns character code associated with glyph_index, or 0 if glyph_index is invalid.
float _font_get_descent(RID font_rid, int size) virtual required const
float _font_get_descent(RID font_rid, int size) virtual required constReturns the font descent (number of pixels below the baseline).
bool _font_get_disable_embedded_bitmaps(RID font_rid) virtual const
bool _font_get_disable_embedded_bitmaps(RID font_rid) virtual constReturns whether the font's embedded bitmap loading is disabled.
float _font_get_embolden(RID font_rid) virtual const
float _font_get_embolden(RID font_rid) virtual constReturns font embolden strength.
int _font_get_face_count(RID font_rid) virtual const
int _font_get_face_count(RID font_rid) virtual constReturns number of faces in the TrueType / OpenType collection.
int _font_get_face_index(RID font_rid) virtual const
int _font_get_face_index(RID font_rid) virtual constReturns an active face index in the TrueType / OpenType collection.
int _font_get_fixed_size(RID font_rid) virtual required const
int _font_get_fixed_size(RID font_rid) virtual required constReturns bitmap font fixed size.
int _font_get_fixed_size_scale_mode(RID font_rid) virtual required const
int _font_get_fixed_size_scale_mode(RID font_rid) virtual required constReturns bitmap font scaling mode.
bool _font_get_generate_mipmaps(RID font_rid) virtual const
bool _font_get_generate_mipmaps(RID font_rid) virtual constReturns true if font texture mipmap generation is enabled.
float _font_get_global_oversampling() virtual const
float _font_get_global_oversampling() virtual constReturns the font oversampling factor, shared by all fonts in the TextServer.
Vector2 _font_get_glyph_advance(RID font_rid, int size, int glyph) virtual required const
Vector2 _font_get_glyph_advance(RID font_rid, int size, int glyph) virtual required constReturns glyph advance (offset of the next glyph).
Dictionary _font_get_glyph_contours(RID font_rid, int size, int index) virtual const
Dictionary _font_get_glyph_contours(RID font_rid, int size, int index) virtual constReturns outline contours of the glyph.
int _font_get_glyph_index(RID font_rid, int size, int char, int variation_selector) virtual required const
int _font_get_glyph_index(RID font_rid, int size, int char, int variation_selector) virtual required constReturns the glyph index of a char, optionally modified by the variation_selector.
PackedInt32Array _font_get_glyph_list(RID font_rid, Vector2i size) virtual required const
PackedInt32Array _font_get_glyph_list(RID font_rid, Vector2i size) virtual required constReturns list of rendered glyphs in the cache entry.
Vector2 _font_get_glyph_offset(RID font_rid, Vector2i size, int glyph) virtual required const
Vector2 _font_get_glyph_offset(RID font_rid, Vector2i size, int glyph) virtual required constReturns glyph offset from the baseline.
Vector2 _font_get_glyph_size(RID font_rid, Vector2i size, int glyph) virtual required const
Vector2 _font_get_glyph_size(RID font_rid, Vector2i size, int glyph) virtual required constReturns size of the glyph.
int _font_get_glyph_texture_idx(RID font_rid, Vector2i size, int glyph) virtual required const
int _font_get_glyph_texture_idx(RID font_rid, Vector2i size, int glyph) virtual required constReturns index of the cache texture containing the glyph.
RID _font_get_glyph_texture_rid(RID font_rid, Vector2i size, int glyph) virtual required const
RID _font_get_glyph_texture_rid(RID font_rid, Vector2i size, int glyph) virtual required constReturns resource ID of the cache texture containing the glyph.
Vector2 _font_get_glyph_texture_size(RID font_rid, Vector2i size, int glyph) virtual required const
Vector2 _font_get_glyph_texture_size(RID font_rid, Vector2i size, int glyph) virtual required constReturns size of the cache texture containing the glyph.
Rect2 _font_get_glyph_uv_rect(RID font_rid, Vector2i size, int glyph) virtual required const
Rect2 _font_get_glyph_uv_rect(RID font_rid, Vector2i size, int glyph) virtual required constReturns rectangle in the cache texture containing the glyph.
int _font_get_hinting(RID font_rid) virtual const
int _font_get_hinting(RID font_rid) virtual constReturns the font hinting mode. Used by dynamic fonts only.
bool _font_get_keep_rounding_remainders(RID font_rid) virtual const
bool _font_get_keep_rounding_remainders(RID font_rid) virtual constReturns glyph position rounding behavior. If set to true, when aligning glyphs to the pixel boundaries rounding remainders are accumulated to ensure more uniform glyph distribution. This setting has no effect if subpixel positioning is enabled.
Vector2 _font_get_kerning(RID font_rid, int size, Vector2i glyph_pair) virtual const
Vector2 _font_get_kerning(RID font_rid, int size, Vector2i glyph_pair) virtual constReturns kerning for the pair of glyphs.
Vector2i[] _font_get_kerning_list(RID font_rid, int size) virtual const
RID font_rid, int size) virtual constReturns list of the kerning overrides.
bool _font_get_language_support_override(RID font_rid, String language) virtual
bool _font_get_language_support_override(RID font_rid, String language) virtualReturns true if support override is enabled for the language.
PackedStringArray _font_get_language_support_overrides(RID font_rid) virtual
PackedStringArray _font_get_language_support_overrides(RID font_rid) virtualReturns list of language support overrides.
int _font_get_msdf_pixel_range(RID font_rid) virtual const
int _font_get_msdf_pixel_range(RID font_rid) virtual constReturns the width of the range around the shape between the minimum and maximum representable signed distance.
int _font_get_msdf_size(RID font_rid) virtual const
int _font_get_msdf_size(RID font_rid) virtual constReturns source font size used to generate MSDF textures.
String _font_get_name(RID font_rid) virtual const
String _font_get_name(RID font_rid) virtual constReturns font family name.
Dictionary _font_get_opentype_feature_overrides(RID font_rid) virtual const
Dictionary _font_get_opentype_feature_overrides(RID font_rid) virtual constReturns font OpenType feature set override.
Dictionary _font_get_ot_name_strings(RID font_rid) virtual const
Dictionary _font_get_ot_name_strings(RID font_rid) virtual constReturns Dictionary with OpenType font name strings (localized font names, version, description, license information, sample text, etc.).
float _font_get_oversampling(RID font_rid) virtual const
float _font_get_oversampling(RID font_rid) virtual constReturns oversampling factor override. If set to a positive value, overrides the oversampling factor of the viewport this font is used in. See Viewport.oversampling. This value doesn't override the [code skip-lint]oversampling[/code] parameter of [code skip-lint]draw_*[/code] methods. Used by dynamic fonts only.
float _font_get_scale(RID font_rid, int size) virtual required const
float _font_get_scale(RID font_rid, int size) virtual required constReturns scaling factor of the color bitmap font.
bool _font_get_script_support_override(RID font_rid, String script) virtual
bool _font_get_script_support_override(RID font_rid, String script) virtualReturns true if support override is enabled for the script.
PackedStringArray _font_get_script_support_overrides(RID font_rid) virtual
PackedStringArray _font_get_script_support_overrides(RID font_rid) virtualReturns list of script support overrides.
Dictionary[] _font_get_size_cache_info(RID font_rid) virtual const
RID font_rid) virtual constReturns font cache information, each entry contains the following fields: Vector2i size_px - font size in pixels, float viewport_oversampling - viewport oversampling factor, int glyphs - number of rendered glyphs, int textures - number of used textures, int textures_size - size of texture data in bytes.
Vector2i[] _font_get_size_cache_list(RID font_rid) virtual required const
RID font_rid) virtual required constReturns list of the font sizes in the cache. Each size is Vector2i with font size and outline size.
int _font_get_spacing(RID font_rid, int spacing) virtual const
int _font_get_spacing(RID font_rid, int spacing) virtual constReturns the spacing for spacing in pixels (not relative to the font size).
int _font_get_stretch(RID font_rid) virtual const
int _font_get_stretch(RID font_rid) virtual constReturns font stretch amount, compared to a normal width. A percentage value between 50% and 200%.
int _font_get_style(RID font_rid) virtual const
int _font_get_style(RID font_rid) virtual constReturns font style flags.
String _font_get_style_name(RID font_rid) virtual const
String _font_get_style_name(RID font_rid) virtual constReturns font style name.
int _font_get_subpixel_positioning(RID font_rid) virtual const
int _font_get_subpixel_positioning(RID font_rid) virtual constReturns font subpixel glyph positioning mode.
String _font_get_supported_chars(RID font_rid) virtual required const
String _font_get_supported_chars(RID font_rid) virtual required constReturns a string containing all the characters available in the font.
PackedInt32Array _font_get_supported_glyphs(RID font_rid) virtual required const
PackedInt32Array _font_get_supported_glyphs(RID font_rid) virtual required constReturns an array containing all glyph indices in the font.
int _font_get_texture_count(RID font_rid, Vector2i size) virtual required const
int _font_get_texture_count(RID font_rid, Vector2i size) virtual required constReturns number of textures used by font cache entry.
Image _font_get_texture_image(RID font_rid, Vector2i size, int texture_index) virtual required const
Image _font_get_texture_image(RID font_rid, Vector2i size, int texture_index) virtual required constReturns font cache texture image data.
PackedInt32Array _font_get_texture_offsets(RID font_rid, Vector2i size, int texture_index) virtual const
PackedInt32Array _font_get_texture_offsets(RID font_rid, Vector2i size, int texture_index) virtual constReturns array containing glyph packing data.
Transform2D _font_get_transform(RID font_rid) virtual const
Transform2D _font_get_transform(RID font_rid) virtual constReturns 2D transform applied to the font outlines.
float _font_get_underline_position(RID font_rid, int size) virtual required const
float _font_get_underline_position(RID font_rid, int size) virtual required constReturns pixel offset of the underline below the baseline.
float _font_get_underline_thickness(RID font_rid, int size) virtual required const
float _font_get_underline_thickness(RID font_rid, int size) virtual required constReturns thickness of the underline in pixels.
Dictionary _font_get_variation_coordinates(RID font_rid) virtual const
Dictionary _font_get_variation_coordinates(RID font_rid) virtual constReturns variation coordinates for the specified font cache entry.
int _font_get_weight(RID font_rid) virtual const
int _font_get_weight(RID font_rid) virtual constReturns weight (boldness) of the font. A value in the 100...999 range, normal font weight is 400, bold font weight is 700.
bool _font_has_char(RID font_rid, int char) virtual required const
bool _font_has_char(RID font_rid, int char) virtual required constReturns true if a Unicode char is available in the font.
bool _font_is_allow_system_fallback(RID font_rid) virtual const
bool _font_is_allow_system_fallback(RID font_rid) virtual constReturns true if system fonts can be automatically used as fallbacks.
bool _font_is_force_autohinter(RID font_rid) virtual const
bool _font_is_force_autohinter(RID font_rid) virtual constReturns true if auto-hinting is supported and preferred over font built-in hinting.
bool _font_is_language_supported(RID font_rid, String language) virtual const
bool _font_is_language_supported(RID font_rid, String language) virtual constReturns true, if font supports given language (ISO 639 code).
bool _font_is_modulate_color_glyphs(RID font_rid) virtual const
bool _font_is_modulate_color_glyphs(RID font_rid) virtual constReturns true, if color modulation is applied when drawing colored glyphs.
bool _font_is_multichannel_signed_distance_field(RID font_rid) virtual const
bool _font_is_multichannel_signed_distance_field(RID font_rid) virtual constReturns true if glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data.
bool _font_is_script_supported(RID font_rid, String script) virtual const
bool _font_is_script_supported(RID font_rid, String script) virtual constReturns true, if font supports given script (ISO 15924 code).
void _font_remove_glyph(RID font_rid, Vector2i size, int glyph) virtual required
RID font_rid, Vector2i size, int glyph) virtual requiredRemoves specified rendered glyph information from the cache entry.
void _font_remove_kerning(RID font_rid, int size, Vector2i glyph_pair) virtual
RID font_rid, int size, Vector2i glyph_pair) virtualRemoves kerning override for the pair of glyphs.
void _font_remove_language_support_override(RID font_rid, String language) virtual
RID font_rid, String language) virtualRemove language support override.
void _font_remove_script_support_override(RID font_rid, String script) virtual
RID font_rid, String script) virtualRemoves script support override.
void _font_remove_size_cache(RID font_rid, Vector2i size) virtual required
RID font_rid, Vector2i size) virtual requiredRemoves specified font size from the cache entry.
void _font_remove_texture(RID font_rid, Vector2i size, int texture_index) virtual required
RID font_rid, Vector2i size, int texture_index) virtual requiredRemoves specified texture from the cache entry.
void _font_render_glyph(RID font_rid, Vector2i size, int index) virtual
RID font_rid, Vector2i size, int index) virtualRenders specified glyph to the font cache texture.
void _font_render_range(RID font_rid, Vector2i size, int start, int end) virtual
RID font_rid, Vector2i size, int start, int end) virtualRenders the range of characters to the font cache texture.
void _font_set_allow_system_fallback(RID font_rid, bool allow_system_fallback) virtual
RID font_rid, bool allow_system_fallback) virtualIf set to true, system fonts can be automatically used as fallbacks.
void _font_set_antialiasing(RID font_rid, int antialiasing) virtual
RID font_rid, int antialiasing) virtualSets font anti-aliasing mode.
void _font_set_ascent(RID font_rid, int size, float ascent) virtual required
RID font_rid, int size, float ascent) virtual requiredSets the font ascent (number of pixels above the baseline).
void _font_set_baseline_offset(RID font_rid, float baseline_offset) virtual
RID font_rid, float baseline_offset) virtualSets extra baseline offset (as a fraction of font height).
void _font_set_data(RID font_rid, PackedByteArray data) virtual
RID font_rid, PackedByteArray data) virtualSets font source data, e.g contents of the dynamic font source file.
void _font_set_data_ptr(RID font_rid, const uint8_t* data_ptr, int data_size) virtual
RID font_rid, const uint8_t* data_ptr, int data_size) virtualSets pointer to the font source data, e.g contents of the dynamic font source file.
void _font_set_descent(RID font_rid, int size, float descent) virtual required
RID font_rid, int size, float descent) virtual requiredSets the font descent (number of pixels below the baseline).
void _font_set_disable_embedded_bitmaps(RID font_rid, bool disable_embedded_bitmaps) virtual
RID font_rid, bool disable_embedded_bitmaps) virtualIf set to true, embedded font bitmap loading is disabled.
void _font_set_embolden(RID font_rid, float strength) virtual
RID font_rid, float strength) virtualSets font embolden strength. If strength is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness.
void _font_set_face_index(RID font_rid, int face_index) virtual
RID font_rid, int face_index) virtualSets an active face index in the TrueType / OpenType collection.
void _font_set_fixed_size(RID font_rid, int fixed_size) virtual required
RID font_rid, int fixed_size) virtual requiredSets bitmap font fixed size. If set to value greater than zero, same cache entry will be used for all font sizes.
void _font_set_fixed_size_scale_mode(RID font_rid, int fixed_size_scale_mode) virtual required
RID font_rid, int fixed_size_scale_mode) virtual requiredSets bitmap font scaling mode. This property is used only if fixed_size is greater than zero.
void _font_set_force_autohinter(RID font_rid, bool force_autohinter) virtual
RID font_rid, bool force_autohinter) virtualIf set to true auto-hinting is preferred over font built-in hinting.
void _font_set_generate_mipmaps(RID font_rid, bool generate_mipmaps) virtual
RID font_rid, bool generate_mipmaps) virtualIf set to true font texture mipmap generation is enabled.
void _font_set_global_oversampling(float oversampling) virtual
float oversampling) virtualSets oversampling factor, shared by all font in the TextServer.
void _font_set_glyph_advance(RID font_rid, int size, int glyph, Vector2 advance) virtual required
RID font_rid, int size, int glyph, Vector2 advance) virtual requiredSets glyph advance (offset of the next glyph).
void _font_set_glyph_offset(RID font_rid, Vector2i size, int glyph, Vector2 offset) virtual required
RID font_rid, Vector2i size, int glyph, Vector2 offset) virtual requiredSets glyph offset from the baseline.
void _font_set_glyph_size(RID font_rid, Vector2i size, int glyph, Vector2 gl_size) virtual required
RID font_rid, Vector2i size, int glyph, Vector2 gl_size) virtual requiredSets size of the glyph.
void _font_set_glyph_texture_idx(RID font_rid, Vector2i size, int glyph, int texture_idx) virtual required
RID font_rid, Vector2i size, int glyph, int texture_idx) virtual requiredSets index of the cache texture containing the glyph.
void _font_set_glyph_uv_rect(RID font_rid, Vector2i size, int glyph, Rect2 uv_rect) virtual required
RID font_rid, Vector2i size, int glyph, Rect2 uv_rect) virtual requiredSets rectangle in the cache texture containing the glyph.
void _font_set_hinting(RID font_rid, int hinting) virtual
RID font_rid, int hinting) virtualSets font hinting mode. Used by dynamic fonts only.
void _font_set_keep_rounding_remainders(RID font_rid, bool keep_rounding_remainders) virtual
RID font_rid, bool keep_rounding_remainders) virtualSets glyph position rounding behavior. If set to true, when aligning glyphs to the pixel boundaries rounding remainders are accumulated to ensure more uniform glyph distribution. This setting has no effect if subpixel positioning is enabled.
void _font_set_kerning(RID font_rid, int size, Vector2i glyph_pair, Vector2 kerning) virtual
RID font_rid, int size, Vector2i glyph_pair, Vector2 kerning) virtualSets kerning for the pair of glyphs.
void _font_set_language_support_override(RID font_rid, String language, bool supported) virtual
RID font_rid, String language, bool supported) virtualAdds override for _font_is_language_supported().
void _font_set_modulate_color_glyphs(RID font_rid, bool modulate) virtual
RID font_rid, bool modulate) virtualIf set to true, color modulation is applied when drawing colored glyphs, otherwise it's applied to the monochrome glyphs only.
void _font_set_msdf_pixel_range(RID font_rid, int msdf_pixel_range) virtual
RID font_rid, int msdf_pixel_range) virtualSets the width of the range around the shape between the minimum and maximum representable signed distance.
void _font_set_msdf_size(RID font_rid, int msdf_size) virtual
RID font_rid, int msdf_size) virtualSets source font size used to generate MSDF textures.
void _font_set_multichannel_signed_distance_field(RID font_rid, bool msdf) virtual
RID font_rid, bool msdf) virtualIf set to true, 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.
void _font_set_name(RID font_rid, String name) virtual
RID font_rid, String name) virtualSets the font family name.
void _font_set_opentype_feature_overrides(RID font_rid, Dictionary overrides) virtual
RID font_rid, Dictionary overrides) virtualSets font OpenType feature set override.
void _font_set_oversampling(RID font_rid, float oversampling) virtual
RID font_rid, float oversampling) virtualIf set to a positive value, overrides the oversampling factor of the viewport this font is used in. See Viewport.oversampling. This value doesn't override the [code skip-lint]oversampling[/code] parameter of [code skip-lint]draw_*[/code] methods. Used by dynamic fonts only.
void _font_set_scale(RID font_rid, int size, float scale) virtual required
RID font_rid, int size, float scale) virtual requiredSets scaling factor of the color bitmap font.
void _font_set_script_support_override(RID font_rid, String script, bool supported) virtual
RID font_rid, String script, bool supported) virtualAdds override for _font_is_script_supported().
void _font_set_spacing(RID font_rid, int spacing, int value) virtual
RID font_rid, int spacing, int value) virtualSets the spacing for spacing to value in pixels (not relative to the font size).
void _font_set_stretch(RID font_rid, int stretch) virtual
RID font_rid, int stretch) virtualSets font stretch amount, compared to a normal width. A percentage value between 50% and 200%.
void _font_set_style(RID font_rid, int style) virtual
RID font_rid, int style) virtualSets the font style flags.
void _font_set_style_name(RID font_rid, String name_style) virtual
RID font_rid, String name_style) virtualSets the font style name.
void _font_set_subpixel_positioning(RID font_rid, int subpixel_positioning) virtual
RID font_rid, int subpixel_positioning) virtualSets font subpixel glyph positioning mode.
void _font_set_texture_image(RID font_rid, Vector2i size, int texture_index, Image image) virtual required
RID font_rid, Vector2i size, int texture_index, Image image) virtual requiredSets font cache texture image data.
void _font_set_texture_offsets(RID font_rid, Vector2i size, int texture_index, PackedInt32Array offset) virtual
RID font_rid, Vector2i size, int texture_index, PackedInt32Array offset) virtualSets array containing glyph packing data.
void _font_set_transform(RID font_rid, Transform2D transform) virtual
RID font_rid, Transform2D transform) virtualSets 2D transform, applied to the font outlines, can be used for slanting, flipping, and rotating glyphs.
void _font_set_underline_position(RID font_rid, int size, float underline_position) virtual required
RID font_rid, int size, float underline_position) virtual requiredSets pixel offset of the underline below the baseline.
void _font_set_underline_thickness(RID font_rid, int size, float underline_thickness) virtual required
RID font_rid, int size, float underline_thickness) virtual requiredSets thickness of the underline in pixels.
void _font_set_variation_coordinates(RID font_rid, Dictionary variation_coordinates) virtual
RID font_rid, Dictionary variation_coordinates) virtualSets variation coordinates for the specified font cache entry.
void _font_set_weight(RID font_rid, int weight) virtual
RID font_rid, int weight) virtualSets weight (boldness) of the font. A value in the 100...999 range, normal font weight is 400, bold font weight is 700.
Dictionary _font_supported_feature_list(RID font_rid) virtual const
Dictionary _font_supported_feature_list(RID font_rid) virtual constReturns the dictionary of the supported OpenType features.
Dictionary _font_supported_variation_list(RID font_rid) virtual const
Dictionary _font_supported_variation_list(RID font_rid) virtual constReturns the dictionary of the supported OpenType variation coordinates.
String _format_number(String number, String language) virtual const
String _format_number(String number, String language) virtual constConverts a number from the Western Arabic (0..9) to the numeral systems used in language.
void _free_rid(RID rid) virtual required
RID rid) virtual requiredFrees an object created by this TextServer.
int _get_features() virtual required const
int _get_features() virtual required constReturns text server features, see TextServer.Feature.
Vector2 _get_hex_code_box_size(int size, int index) virtual const
Vector2 _get_hex_code_box_size(int size, int index) virtual constReturns size of the replacement character (box with character hexadecimal code that is drawn in place of invalid characters).
String _get_name() virtual required const
String _get_name() virtual required constReturns the name of the server interface.
PackedByteArray _get_support_data() virtual const
PackedByteArray _get_support_data() virtual constReturns default TextServer database (e.g. ICU break iterators and dictionaries).
String _get_support_data_filename() virtual const
String _get_support_data_filename() virtual constReturns default TextServer database (e.g. ICU break iterators and dictionaries) filename.
String _get_support_data_info() virtual const
String _get_support_data_info() virtual constReturns TextServer database (e.g. ICU break iterators and dictionaries) description.
bool _has(RID rid) virtual required
bool _has(RID rid) virtual requiredReturns true if rid is valid resource owned by this text server.
bool _has_feature(int feature) virtual required const
bool _has_feature(int feature) virtual required constReturns true if the server supports a feature.
int _is_confusable(String string, PackedStringArray dict) virtual const
int _is_confusable(String string, PackedStringArray dict) virtual constReturns index of the first string in dict which is visually confusable with the string, or -1 if none is found.
bool _is_locale_right_to_left(String locale) virtual const
bool _is_locale_right_to_left(String locale) virtual constReturns true if locale is right-to-left.
bool _is_valid_identifier(String string) virtual const
bool _is_valid_identifier(String string) virtual constReturns true if string is a valid identifier.
bool _is_valid_letter(int unicode) virtual const
bool _is_valid_letter(int unicode) virtual constbool _load_support_data(String filename) virtual
bool _load_support_data(String filename) virtualLoads optional TextServer database (e.g. ICU break iterators and dictionaries).
int _name_to_tag(String name) virtual const
int _name_to_tag(String name) virtual constConverts readable feature, variation, script, or language name to OpenType tag.
String _parse_number(String number, String language) virtual const
String _parse_number(String number, String language) virtual constConverts number from the numeral systems used in language to Western Arabic (0..9).
Vector3i[] _parse_structured_text(int parser_type, Array args, String text) virtual const
int parser_type, Array args, String text) virtual constDefault implementation of the BiDi algorithm override function.
String _percent_sign(String language) virtual const
String _percent_sign(String language) virtual constReturns percent sign used in the language.
void _reference_oversampling_level(float oversampling) virtual
float oversampling) virtualIncreases the reference count of the specified oversampling level. This method is called by Viewport, and should not be used directly.
bool _save_support_data(String filename) virtual const
bool _save_support_data(String filename) virtual constSaves optional TextServer database (e.g. ICU break iterators and dictionaries) to the file.
int _shaped_get_run_count(RID shaped) virtual const
int _shaped_get_run_count(RID shaped) virtual constReturns the number of uniform text runs in the buffer.
int _shaped_get_run_direction(RID shaped, int index) virtual const
int _shaped_get_run_direction(RID shaped, int index) virtual constReturns the direction of the index text run (in visual order).
RID _shaped_get_run_font_rid(RID shaped, int index) virtual const
RID _shaped_get_run_font_rid(RID shaped, int index) virtual constReturns the font RID of the index text run (in visual order).
int _shaped_get_run_font_size(RID shaped, int index) virtual const
int _shaped_get_run_font_size(RID shaped, int index) virtual constReturns the font size of the index text run (in visual order).
String _shaped_get_run_language(RID shaped, int index) virtual const
String _shaped_get_run_language(RID shaped, int index) virtual constReturns the language of the index text run (in visual order).
Variant _shaped_get_run_object(RID shaped, int index) virtual const
Variant _shaped_get_run_object(RID shaped, int index) virtual constReturns the embedded object of the index text run (in visual order).
Vector2i _shaped_get_run_range(RID shaped, int index) virtual const
Vector2i _shaped_get_run_range(RID shaped, int index) virtual constReturns the source text range of the index text run (in visual order).
String _shaped_get_run_text(RID shaped, int index) virtual const
String _shaped_get_run_text(RID shaped, int index) virtual constReturns the source text of the index text run (in visual order).
int _shaped_get_span_count(RID shaped) virtual required const
int _shaped_get_span_count(RID shaped) virtual required constReturns number of text spans added using _shaped_text_add_string() or _shaped_text_add_object().
Variant _shaped_get_span_embedded_object(RID shaped, int index) virtual required const
Variant _shaped_get_span_embedded_object(RID shaped, int index) virtual required constReturns text embedded object key.
Variant _shaped_get_span_meta(RID shaped, int index) virtual required const
Variant _shaped_get_span_meta(RID shaped, int index) virtual required constReturns text span metadata.
Variant _shaped_get_span_object(RID shaped, int index) virtual required const
Variant _shaped_get_span_object(RID shaped, int index) virtual required constReturns the text span embedded object key.
String _shaped_get_span_text(RID shaped, int index) virtual required const
String _shaped_get_span_text(RID shaped, int index) virtual required constReturns the text span source text.
String _shaped_get_text(RID shaped) virtual required const
String _shaped_get_text(RID shaped) virtual required constReturns the text buffer source text, including object replacement characters.
void _shaped_set_span_update_font(RID shaped, int index, RID[] fonts, int size, Dictionary opentype_features) virtual required
RID shaped, int index, RID[] fonts, int size, Dictionary opentype_features) virtual requiredChanges text span font, font size, and OpenType features, without changing the text.
bool _shaped_text_add_object(RID shaped, Variant key, Vector2 size, int inline_align, int length, float baseline) virtual required
bool _shaped_text_add_object(RID shaped, Variant key, Vector2 size, int inline_align, int length, float baseline) virtual requiredAdds inline object to the text buffer, key must be unique. In the text, object is represented as length object replacement characters.
bool _shaped_text_add_string(RID shaped, String text, RID[] fonts, int size, Dictionary opentype_features, String language, Variant meta) virtual required
bool _shaped_text_add_string(RID shaped, String text, RID[] fonts, int size, Dictionary opentype_features, String language, Variant meta) virtual requiredAdds text span and font to draw it to the text buffer.
void _shaped_text_clear(RID shaped) virtual required
RID shaped) virtual requiredClears text buffer (removes text and inline objects).
int _shaped_text_closest_character_pos(RID shaped, int pos) virtual const
int _shaped_text_closest_character_pos(RID shaped, int pos) virtual constReturns composite character position closest to the pos.
void _shaped_text_draw(RID shaped, RID canvas, Vector2 pos, float clip_l, float clip_r, Color color, float oversampling) virtual const
RID shaped, RID canvas, Vector2 pos, float clip_l, float clip_r, Color color, float oversampling) virtual constDraw shaped text into a canvas item at a given position, with color. pos specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout). If oversampling is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.
void _shaped_text_draw_outline(RID shaped, RID canvas, Vector2 pos, float clip_l, float clip_r, int outline_size, Color color, float oversampling) virtual const
RID shaped, RID canvas, Vector2 pos, float clip_l, float clip_r, int outline_size, Color color, float oversampling) virtual constDraw the outline of the shaped text into a canvas item at a given position, with color. pos specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout). If oversampling is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.
float _shaped_text_fit_to_width(RID shaped, float width, int justification_flags) virtual
float _shaped_text_fit_to_width(RID shaped, float width, int justification_flags) virtualAdjusts text width to fit to specified width, returns new text width.
float _shaped_text_get_ascent(RID shaped) virtual required const
float _shaped_text_get_ascent(RID shaped) virtual required constReturns the text ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical).
void _shaped_text_get_carets(RID shaped, int position, CaretInfo* caret) virtual const
RID shaped, int position, CaretInfo* caret) virtual constReturns shapes of the carets corresponding to the character offset position in the text. Returned caret shape is 1 pixel wide rectangle.
PackedInt32Array _shaped_text_get_character_breaks(RID shaped) virtual const
PackedInt32Array _shaped_text_get_character_breaks(RID shaped) virtual constReturns array of the composite character boundaries.
int _shaped_text_get_custom_ellipsis(RID shaped) virtual const
int _shaped_text_get_custom_ellipsis(RID shaped) virtual constReturns ellipsis character used for text clipping.
String _shaped_text_get_custom_punctuation(RID shaped) virtual const
String _shaped_text_get_custom_punctuation(RID shaped) virtual constReturns custom punctuation character list, used for word breaking. If set to empty string, server defaults are used.
float _shaped_text_get_descent(RID shaped) virtual required const
float _shaped_text_get_descent(RID shaped) virtual required constReturns the text descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical).
int _shaped_text_get_direction(RID shaped) virtual const
int _shaped_text_get_direction(RID shaped) virtual constReturns direction of the text.
int _shaped_text_get_dominant_direction_in_range(RID shaped, int start, int end) virtual const
int _shaped_text_get_dominant_direction_in_range(RID shaped, int start, int end) virtual constReturns dominant direction of in the range of text.
int _shaped_text_get_ellipsis_glyph_count(RID shaped) virtual required const
int _shaped_text_get_ellipsis_glyph_count(RID shaped) virtual required constReturns number of glyphs in the ellipsis.
const Glyph* _shaped_text_get_ellipsis_glyphs(RID shaped) virtual required const
RID shaped) virtual required constReturns array of the glyphs in the ellipsis.
int _shaped_text_get_ellipsis_pos(RID shaped) virtual required const
int _shaped_text_get_ellipsis_pos(RID shaped) virtual required constReturns position of the ellipsis.
int _shaped_text_get_glyph_count(RID shaped) virtual required const
int _shaped_text_get_glyph_count(RID shaped) virtual required constReturns number of glyphs in the buffer.
const Glyph* _shaped_text_get_glyphs(RID shaped) virtual required const
RID shaped) virtual required constReturns an array of glyphs in the visual order.
Vector2 _shaped_text_get_grapheme_bounds(RID shaped, int pos) virtual const
Vector2 _shaped_text_get_grapheme_bounds(RID shaped, int pos) virtual constReturns composite character's bounds as offsets from the start of the line.
int _shaped_text_get_inferred_direction(RID shaped) virtual const
int _shaped_text_get_inferred_direction(RID shaped) virtual constReturns direction of the text, inferred by the BiDi algorithm.
PackedInt32Array _shaped_text_get_line_breaks(RID shaped, float width, int start, int break_flags) virtual const
PackedInt32Array _shaped_text_get_line_breaks(RID shaped, float width, int start, int break_flags) virtual constBreaks text to the lines and returns character ranges for each line.
PackedInt32Array _shaped_text_get_line_breaks_adv(RID shaped, PackedFloat32Array width, int start, bool once, int break_flags) virtual const
PackedInt32Array _shaped_text_get_line_breaks_adv(RID shaped, PackedFloat32Array width, int start, bool once, int break_flags) virtual constBreaks text to the lines and columns. Returns character ranges for each segment.
int _shaped_text_get_object_glyph(RID shaped, Variant key) virtual required const
int _shaped_text_get_object_glyph(RID shaped, Variant key) virtual required constReturns the glyph index of the inline object.
Vector2i _shaped_text_get_object_range(RID shaped, Variant key) virtual required const
Vector2i _shaped_text_get_object_range(RID shaped, Variant key) virtual required constReturns the character range of the inline object.
Rect2 _shaped_text_get_object_rect(RID shaped, Variant key) virtual required const
Rect2 _shaped_text_get_object_rect(RID shaped, Variant key) virtual required constReturns bounding rectangle of the inline object.
Array _shaped_text_get_objects(RID shaped) virtual required const
Array _shaped_text_get_objects(RID shaped) virtual required constReturns array of inline objects.
int _shaped_text_get_orientation(RID shaped) virtual const
int _shaped_text_get_orientation(RID shaped) virtual constReturns text orientation.
RID _shaped_text_get_parent(RID shaped) virtual required const
RID _shaped_text_get_parent(RID shaped) virtual required constReturns the parent buffer from which the substring originates.
bool _shaped_text_get_preserve_control(RID shaped) virtual const
bool _shaped_text_get_preserve_control(RID shaped) virtual constReturns true if text buffer is configured to display control characters.
bool _shaped_text_get_preserve_invalid(RID shaped) virtual const
bool _shaped_text_get_preserve_invalid(RID shaped) virtual constReturns true if text buffer is configured to display hexadecimal codes in place of invalid characters.
Vector2i _shaped_text_get_range(RID shaped) virtual required const
Vector2i _shaped_text_get_range(RID shaped) virtual required constReturns substring buffer character range in the parent buffer.
PackedVector2Array _shaped_text_get_selection(RID shaped, int start, int end) virtual const
PackedVector2Array _shaped_text_get_selection(RID shaped, int start, int end) virtual constReturns selection rectangles for the specified character range.
Vector2 _shaped_text_get_size(RID shaped) virtual required const
Vector2 _shaped_text_get_size(RID shaped) virtual required constReturns size of the text.
int _shaped_text_get_spacing(RID shaped, int spacing) virtual const
int _shaped_text_get_spacing(RID shaped, int spacing) virtual constReturns extra spacing added between glyphs or lines in pixels.
int _shaped_text_get_trim_pos(RID shaped) virtual required const
int _shaped_text_get_trim_pos(RID shaped) virtual required constReturns the position of the overrun trim.
float _shaped_text_get_underline_position(RID shaped) virtual required const
float _shaped_text_get_underline_position(RID shaped) virtual required constReturns pixel offset of the underline below the baseline.
float _shaped_text_get_underline_thickness(RID shaped) virtual required const
float _shaped_text_get_underline_thickness(RID shaped) virtual required constReturns thickness of the underline.
float _shaped_text_get_width(RID shaped) virtual required const
float _shaped_text_get_width(RID shaped) virtual required constReturns width (for horizontal layout) or height (for vertical) of the text.
PackedInt32Array _shaped_text_get_word_breaks(RID shaped, int grapheme_flags, int skip_grapheme_flags) virtual const
PackedInt32Array _shaped_text_get_word_breaks(RID shaped, int grapheme_flags, int skip_grapheme_flags) virtual constBreaks text into words and returns array of character ranges. Use grapheme_flags to set what characters are used for breaking.
int _shaped_text_hit_test_grapheme(RID shaped, float coord) virtual const
int _shaped_text_hit_test_grapheme(RID shaped, float coord) virtual constReturns grapheme index at the specified pixel offset at the baseline, or -1 if none is found.
int _shaped_text_hit_test_position(RID shaped, float coord) virtual const
int _shaped_text_hit_test_position(RID shaped, float coord) virtual constReturns caret character offset at the specified pixel offset at the baseline. This function always returns a valid position.
bool _shaped_text_is_ready(RID shaped) virtual required const
bool _shaped_text_is_ready(RID shaped) virtual required constReturns true if buffer is successfully shaped.
int _shaped_text_next_character_pos(RID shaped, int pos) virtual const
int _shaped_text_next_character_pos(RID shaped, int pos) virtual constReturns composite character end position closest to the pos.
int _shaped_text_next_grapheme_pos(RID shaped, int pos) virtual const
int _shaped_text_next_grapheme_pos(RID shaped, int pos) virtual constReturns grapheme end position closest to the pos.
void _shaped_text_overrun_trim_to_width(RID shaped, float width, int trim_flags) virtual
RID shaped, float width, int trim_flags) virtualTrims text if it exceeds the given width.
int _shaped_text_prev_character_pos(RID shaped, int pos) virtual const
int _shaped_text_prev_character_pos(RID shaped, int pos) virtual constReturns composite character start position closest to the pos.
int _shaped_text_prev_grapheme_pos(RID shaped, int pos) virtual const
int _shaped_text_prev_grapheme_pos(RID shaped, int pos) virtual constReturns grapheme start position closest to the pos.
bool _shaped_text_resize_object(RID shaped, Variant key, Vector2 size, int inline_align, float baseline) virtual required
bool _shaped_text_resize_object(RID shaped, Variant key, Vector2 size, int inline_align, float baseline) virtual requiredSets new size and alignment of embedded object.
void _shaped_text_set_bidi_override(RID shaped, Array override) virtual
RID shaped, Array override) virtualOverrides BiDi for the structured text.
void _shaped_text_set_custom_ellipsis(RID shaped, int char) virtual
RID shaped, int char) virtualSets ellipsis character used for text clipping.
void _shaped_text_set_custom_punctuation(RID shaped, String punct) virtual
RID shaped, String punct) virtualSets custom punctuation character list, used for word breaking. If set to empty string, server defaults are used.
void _shaped_text_set_direction(RID shaped, int direction) virtual
RID shaped, int direction) virtualSets desired text direction. If set to TextServer.DIRECTION_AUTO, direction will be detected based on the buffer contents and current locale.
void _shaped_text_set_orientation(RID shaped, int orientation) virtual
RID shaped, int orientation) virtualSets desired text orientation.
void _shaped_text_set_preserve_control(RID shaped, bool enabled) virtual
RID shaped, bool enabled) virtualIf set to true text buffer will display control characters.
void _shaped_text_set_preserve_invalid(RID shaped, bool enabled) virtual
RID shaped, bool enabled) virtualIf set to true text buffer will display invalid characters as hexadecimal codes, otherwise nothing is displayed.
void _shaped_text_set_spacing(RID shaped, int spacing, int value) virtual
RID shaped, int spacing, int value) virtualSets extra spacing added between glyphs or lines in pixels.
bool _shaped_text_shape(RID shaped) virtual required
bool _shaped_text_shape(RID shaped) virtual requiredShapes buffer if it's not shaped. Returns true if the string is shaped successfully.
const Glyph* _shaped_text_sort_logical(RID shaped) virtual required
RID shaped) virtual requiredReturns text glyphs in the logical order.
RID _shaped_text_substr(RID shaped, int start, int length) virtual required const
RID _shaped_text_substr(RID shaped, int start, int length) virtual required constReturns text buffer for the substring of the text in the shaped text buffer (including inline objects).
float _shaped_text_tab_align(RID shaped, PackedFloat32Array tab_stops) virtual
float _shaped_text_tab_align(RID shaped, PackedFloat32Array tab_stops) virtualAligns shaped text to the given tab-stops.
bool _shaped_text_update_breaks(RID shaped) virtual
bool _shaped_text_update_breaks(RID shaped) virtualUpdates break points in the shaped text. This method is called by default implementation of text breaking functions.
bool _shaped_text_update_justification_ops(RID shaped) virtual
bool _shaped_text_update_justification_ops(RID shaped) virtualUpdates justification points in the shaped text. This method is called by default implementation of text justification functions.
bool _spoof_check(String string) virtual const
bool _spoof_check(String string) virtual constReturns true if string is likely to be an attempt at confusing the reader.
PackedInt32Array _string_get_character_breaks(String string, String language) virtual const
PackedInt32Array _string_get_character_breaks(String string, String language) virtual constReturns array of the composite character boundaries.
PackedInt32Array _string_get_word_breaks(String string, String language, int chars_per_line) virtual const
PackedInt32Array _string_get_word_breaks(String string, String language, int chars_per_line) virtual constReturns an array of the word break boundaries. Elements in the returned array are the offsets of the start and end of words. Therefore the length of the array is always even.
String _string_to_lower(String string, String language) virtual const
String _string_to_lower(String string, String language) virtual constReturns the string converted to lowercase.
String _string_to_title(String string, String language) virtual const
String _string_to_title(String string, String language) virtual constReturns the string converted to title case.
String _string_to_upper(String string, String language) virtual const
String _string_to_upper(String string, String language) virtual constReturns the string converted to uppercase.
String _strip_diacritics(String string) virtual const
String _strip_diacritics(String string) virtual constStrips diacritics from the string.
String _tag_to_name(int tag) virtual const
String _tag_to_name(int tag) virtual constConverts OpenType tag to readable feature, variation, script, or language name.
void _unreference_oversampling_level(float oversampling) virtual
float oversampling) virtualDecreases the reference count of the specified oversampling level, and frees the font cache for oversampling level when the reference count reaches zero. This method is called by Viewport, and should not be used directly.