TextServerExtensionΒΆ
Inherits: TextServer < RefCounted < Object
Base class for TextServer custom implementations (plugins).
DescriptionΒΆ
External TextServer implementations should inherit from this class.
MethodsΒΆ
_create_font ( ) virtual |
|
_create_shaped_text ( Direction direction, Orientation orientation ) virtual |
|
void |
_draw_hex_code_box ( RID canvas, int size, Vector2 pos, int index, Color color ) virtual const |
void |
_font_clear_glyphs ( RID font_rid, Vector2i size ) virtual |
void |
_font_clear_kerning_map ( RID font_rid, int size ) virtual |
void |
_font_clear_size_cache ( RID font_rid ) virtual |
void |
_font_clear_textures ( RID font_rid, Vector2i size ) virtual |
void |
_font_draw_glyph ( RID font_rid, RID canvas, int size, Vector2 pos, int index, Color color ) virtual const |
void |
_font_draw_glyph_outline ( RID font_rid, RID canvas, int size, int outline_size, Vector2 pos, int index, Color color ) virtual const |
_font_get_ascent ( RID font_rid, int size ) virtual const |
|
_font_get_descent ( RID font_rid, int size ) virtual const |
|
_font_get_embolden ( RID font_rid ) virtual const |
|
_font_get_fixed_size ( RID font_rid ) virtual const |
|
_font_get_global_oversampling ( ) virtual const |
|
_font_get_glyph_advance ( RID font_rid, int size, int glyph ) virtual const |
|
_font_get_glyph_contours ( RID font_rid, int size, int index ) virtual const |
|
_font_get_glyph_index ( RID font_rid, int size, int char, int variation_selector ) virtual const |
|
_font_get_glyph_list ( RID font_rid, Vector2i size ) virtual const |
|
_font_get_glyph_offset ( RID font_rid, Vector2i size, int glyph ) virtual const |
|
_font_get_glyph_size ( RID font_rid, Vector2i size, int glyph ) virtual const |
|
_font_get_glyph_texture_idx ( RID font_rid, Vector2i size, int glyph ) virtual const |
|
_font_get_glyph_uv_rect ( RID font_rid, Vector2i size, int glyph ) virtual const |
|
_font_get_hinting ( RID font_rid ) virtual const |
|
_font_get_kerning ( RID font_rid, int size, Vector2i glyph_pair ) virtual const |
|
_font_get_kerning_list ( RID font_rid, int size ) virtual const |
|
_font_get_language_support_override ( RID font_rid, String language ) virtual |
|
_font_get_language_support_overrides ( RID font_rid ) virtual |
|
_font_get_msdf_pixel_range ( RID font_rid ) virtual const |
|
_font_get_msdf_size ( RID font_rid ) virtual const |
|
_font_get_name ( RID font_rid ) virtual const |
|
_font_get_opentype_feature_overrides ( RID font_rid ) virtual const |
|
_font_get_oversampling ( RID font_rid ) virtual const |
|
_font_get_scale ( RID font_rid, int size ) virtual const |
|
_font_get_script_support_override ( RID font_rid, String script ) virtual |
|
_font_get_script_support_overrides ( RID font_rid ) virtual |
|
_font_get_size_cache_list ( RID font_rid ) virtual const |
|
_font_get_spacing ( RID font_rid, int size, SpacingType spacing ) virtual const |
|
_font_get_style ( RID font_rid ) virtual const |
|
_font_get_style_name ( RID font_rid ) virtual const |
|
_font_get_subpixel_positioning ( RID font_rid ) virtual const |
|
_font_get_supported_chars ( RID font_rid ) virtual const |
|
_font_get_texture_count ( RID font_rid, Vector2i size ) virtual const |
|
_font_get_texture_image ( RID font_rid, Vector2i size, int texture_index ) virtual const |
|
_font_get_texture_offsets ( RID font_rid, Vector2i size, int texture_index ) virtual const |
|
_font_get_transform ( RID font_rid ) virtual const |
|
_font_get_underline_position ( RID font_rid, int size ) virtual const |
|
_font_get_underline_thickness ( RID font_rid, int size ) virtual const |
|
_font_get_variation_coordinates ( RID font_rid ) virtual const |
|
_font_has_char ( RID font_rid, int char ) virtual const |
|
_font_is_antialiased ( RID font_rid ) virtual const |
|
_font_is_force_autohinter ( RID font_rid ) virtual const |
|
_font_is_language_supported ( RID font_rid, String language ) virtual const |
|
_font_is_multichannel_signed_distance_field ( RID font_rid ) virtual const |
|
_font_is_script_supported ( RID font_rid, String script ) virtual const |
|
void |
_font_remove_glyph ( RID font_rid, Vector2i size, int glyph ) virtual |
void |
_font_remove_kerning ( RID font_rid, int size, Vector2i glyph_pair ) virtual |
void |
_font_remove_language_support_override ( RID font_rid, String language ) virtual |
void |
_font_remove_script_support_override ( RID font_rid, String script ) virtual |
void |
_font_remove_size_cache ( RID font_rid, Vector2i size ) virtual |
void |
_font_remove_texture ( RID font_rid, Vector2i size, int texture_index ) virtual |
void |
_font_render_glyph ( RID font_rid, Vector2i size, int index ) virtual |
void |
_font_render_range ( RID font_rid, Vector2i size, int start, int end ) virtual |
void |
_font_set_antialiased ( RID font_rid, bool antialiased ) virtual |
void |
_font_set_ascent ( RID font_rid, int size, float ascent ) virtual |
void |
_font_set_data ( RID font_rid, PackedByteArray data ) virtual |
void |
_font_set_data_ptr ( RID font_rid, const uint8_t* data_ptr, int data_size ) virtual |
void |
_font_set_descent ( RID font_rid, int size, float descent ) virtual |
void |
_font_set_embolden ( RID font_rid, float strength ) virtual |
void |
_font_set_fixed_size ( RID font_rid, int fixed_size ) virtual |
void |
_font_set_force_autohinter ( RID font_rid, bool force_autohinter ) virtual |
void |
_font_set_global_oversampling ( float oversampling ) virtual |
void |
_font_set_glyph_advance ( RID font_rid, int size, int glyph, Vector2 advance ) virtual |
void |
_font_set_glyph_offset ( RID font_rid, Vector2i size, int glyph, Vector2 offset ) virtual |
void |
_font_set_glyph_size ( RID font_rid, Vector2i size, int glyph, Vector2 gl_size ) virtual |
void |
_font_set_glyph_texture_idx ( RID font_rid, Vector2i size, int glyph, int texture_idx ) virtual |
void |
_font_set_glyph_uv_rect ( RID font_rid, Vector2i size, int glyph, Rect2 uv_rect ) virtual |
void |
_font_set_hinting ( RID font_rid, Hinting hinting ) virtual |
void |
_font_set_kerning ( RID font_rid, int size, Vector2i glyph_pair, Vector2 kerning ) virtual |
void |
_font_set_language_support_override ( RID font_rid, String language, bool supported ) virtual |
void |
_font_set_msdf_pixel_range ( RID font_rid, int msdf_pixel_range ) virtual |
void |
_font_set_msdf_size ( RID font_rid, int msdf_size ) virtual |
void |
_font_set_multichannel_signed_distance_field ( RID font_rid, bool msdf ) virtual |
void |
_font_set_name ( RID font_rid, String name ) virtual |
void |
_font_set_opentype_feature_overrides ( RID font_rid, Dictionary overrides ) virtual |
void |
_font_set_oversampling ( RID font_rid, float oversampling ) virtual |
void |
_font_set_scale ( RID font_rid, int size, float scale ) virtual |
void |
_font_set_script_support_override ( RID font_rid, String script, bool supported ) virtual |
void |
_font_set_spacing ( RID font_rid, int size, SpacingType spacing, int value ) virtual |
void |
_font_set_style ( RID font_rid, int style ) virtual |
void |
_font_set_style_name ( RID font_rid, String name_style ) virtual |
void |
_font_set_subpixel_positioning ( RID font_rid, SubpixelPositioning subpixel_positioning ) virtual |
void |
_font_set_texture_image ( RID font_rid, Vector2i size, int texture_index, Image image ) virtual |
void |
_font_set_texture_offsets ( RID font_rid, Vector2i size, int texture_index, PackedInt32Array offset ) virtual |
void |
_font_set_transform ( RID font_rid, Transform2D transform ) virtual |
void |
_font_set_underline_position ( RID font_rid, int size, float underline_position ) virtual |
void |
_font_set_underline_thickness ( RID font_rid, int size, float underline_thickness ) virtual |
void |
_font_set_variation_coordinates ( RID font_rid, Dictionary variation_coordinates ) virtual |
_font_supported_feature_list ( RID font_rid ) virtual const |
|
_font_supported_variation_list ( RID font_rid ) virtual const |
|
_format_number ( String string, String language ) virtual const |
|
void |
|
_get_features ( ) virtual const |
|
_get_hex_code_box_size ( int size, int index ) virtual const |
|
_get_name ( ) virtual const |
|
_get_support_data_filename ( ) virtual const |
|
_get_support_data_info ( ) virtual const |
|
_has_feature ( Feature feature ) virtual const |
|
_is_locale_right_to_left ( String locale ) virtual const |
|
_load_support_data ( String filename ) virtual |
|
_name_to_tag ( String name ) virtual const |
|
_parse_number ( String string, String language ) virtual const |
|
_percent_sign ( String language ) virtual const |
|
_save_support_data ( String filename ) virtual const |
|
_shaped_get_span_count ( RID shaped ) virtual const |
|
_shaped_get_span_meta ( RID shaped, int index ) virtual const |
|
void |
_shaped_set_span_update_font ( RID shaped, int index, Array fonts, int size, Dictionary opentype_features ) virtual |
_shaped_text_add_object ( RID shaped, Variant key, Vector2 size, InlineAlignment inline_align, int length ) virtual |
|
_shaped_text_add_string ( RID shaped, String text, Array fonts, int size, Dictionary opentype_features, String language, Variant meta ) virtual |
|
void |
_shaped_text_clear ( RID shaped ) virtual |
void |
_shaped_text_draw ( RID shaped, RID canvas, Vector2 pos, float clip_l, float clip_r, Color color ) virtual const |
void |
_shaped_text_draw_outline ( RID shaped, RID canvas, Vector2 pos, float clip_l, float clip_r, int outline_size, Color color ) virtual const |
_shaped_text_fit_to_width ( RID shaped, float width, int jst_flags ) virtual |
|
_shaped_text_get_ascent ( RID shaped ) virtual const |
|
void |
_shaped_text_get_carets ( RID shaped, int position, CaretInfo* caret ) virtual const |
_shaped_text_get_custom_punctuation ( RID shaped ) virtual const |
|
_shaped_text_get_descent ( RID shaped ) virtual const |
|
_shaped_text_get_direction ( RID shaped ) virtual const |
|
_shaped_text_get_dominant_direction_in_range ( RID shaped, int start, int end ) virtual const |
|
_shaped_text_get_ellipsis_glyph_count ( RID shaped ) virtual const |
|
Glyph* |
_shaped_text_get_ellipsis_glyphs ( RID shaped ) virtual const |
_shaped_text_get_ellipsis_pos ( RID shaped ) virtual const |
|
_shaped_text_get_glyph_count ( RID shaped ) virtual const |
|
Glyph* |
_shaped_text_get_glyphs ( RID shaped ) virtual const |
_shaped_text_get_grapheme_bounds ( RID shaped, int pos ) virtual const |
|
_shaped_text_get_inferred_direction ( RID shaped ) virtual const |
|
_shaped_text_get_line_breaks ( RID shaped, float width, int start, int break_flags ) virtual const |
|
_shaped_text_get_line_breaks_adv ( RID shaped, PackedFloat32Array width, int start, bool once, int break_flags ) virtual const |
|
_shaped_text_get_object_rect ( RID shaped, Variant key ) virtual const |
|
_shaped_text_get_objects ( RID shaped ) virtual const |
|
_shaped_text_get_orientation ( RID shaped ) virtual const |
|
_shaped_text_get_parent ( RID shaped ) virtual const |
|
_shaped_text_get_preserve_control ( RID shaped ) virtual const |
|
_shaped_text_get_preserve_invalid ( RID shaped ) virtual const |
|
_shaped_text_get_range ( RID shaped ) virtual const |
|
_shaped_text_get_selection ( RID shaped, int start, int end ) virtual const |
|
_shaped_text_get_size ( RID shaped ) virtual const |
|
_shaped_text_get_trim_pos ( RID shaped ) virtual const |
|
_shaped_text_get_underline_position ( RID shaped ) virtual const |
|
_shaped_text_get_underline_thickness ( RID shaped ) virtual const |
|
_shaped_text_get_width ( RID shaped ) virtual const |
|
_shaped_text_get_word_breaks ( RID shaped, int grapheme_flags ) virtual const |
|
_shaped_text_hit_test_grapheme ( RID shaped, float coord ) virtual const |
|
_shaped_text_hit_test_position ( RID shaped, float coord ) virtual const |
|
_shaped_text_is_ready ( RID shaped ) virtual const |
|
_shaped_text_next_grapheme_pos ( RID shaped, int pos ) virtual const |
|
void |
_shaped_text_overrun_trim_to_width ( RID shaped, float width, int trim_flags ) virtual |
_shaped_text_prev_grapheme_pos ( RID shaped, int pos ) virtual const |
|
_shaped_text_resize_object ( RID shaped, Variant key, Vector2 size, InlineAlignment inline_align ) virtual |
|
void |
_shaped_text_set_bidi_override ( RID shaped, Array override ) virtual |
void |
_shaped_text_set_custom_punctuation ( RID shaped, String punct ) virtual |
void |
_shaped_text_set_direction ( RID shaped, Direction direction ) virtual |
void |
_shaped_text_set_orientation ( RID shaped, Orientation orientation ) virtual |
void |
_shaped_text_set_preserve_control ( RID shaped, bool enabled ) virtual |
void |
_shaped_text_set_preserve_invalid ( RID shaped, bool enabled ) virtual |
_shaped_text_shape ( RID shaped ) virtual |
|
Glyph* |
_shaped_text_sort_logical ( RID shaped ) virtual |
_shaped_text_substr ( RID shaped, int start, int length ) virtual const |
|
_shaped_text_tab_align ( RID shaped, PackedFloat32Array tab_stops ) virtual |
|
_shaped_text_update_breaks ( RID shaped ) virtual |
|
_shaped_text_update_justification_ops ( RID shaped ) virtual |
|
_string_to_lower ( String string, String language ) virtual const |
|
_string_to_upper ( String string, String language ) virtual const |
|
_tag_to_name ( int tag ) virtual const |
Method DescriptionsΒΆ
RID _create_font ( ) virtual
Creates new, empty font cache entry resource. To free the resulting resourec, use _free method.
RID _create_shaped_text ( Direction direction, Orientation orientation ) virtual
Creates new buffer for complex text layout, with the given direction
and orientation
. To free the resulting buffer, use _free method.
Note: Direction is ignored if server does not support FEATURE_BIDI_LAYOUT
feature.
Note: Orientation is ignored if server does not support FEATURE_VERTICAL_LAYOUT
feature.
Draws box displaying character hexadecimal code. Used for replacing missing characters.
Removes all rendered glyphs information from the cache entry.
Note: This function will not remove textures associated with the glyphs, use _font_remove_texture to remove them manually.
Removes all kerning overrides.
void _font_clear_size_cache ( RID font_rid ) virtual
Removes all font sizes from the cache entry
Removes all textures from font cache entry.
Note: This function will not remove glyphs associated with the texture, use _font_remove_glyph to remove them manually.
void _font_draw_glyph ( RID font_rid, RID canvas, int size, Vector2 pos, int index, Color color ) virtual const
Draws single glyph into a canvas item at the position, using font_rid
at the size size
.
Note: Glyph index is specific to the font, use glyphs indices returned by _shaped_text_get_glyphs or _font_get_glyph_index.
void _font_draw_glyph_outline ( RID font_rid, RID canvas, int size, int outline_size, Vector2 pos, int index, Color color ) virtual const
Draws single glyph outline of size outline_size
into a canvas item at the position, using font_rid
at the size size
.
Note: Glyph index is specific to the font, use glyphs indices returned by _shaped_text_get_glyphs or _font_get_glyph_index.
Returns the font ascent (number of pixels above the baseline).
Returns the font descent (number of pixels below the baseline).
Returns font embolden strength.
Returns bitmap font fixed size.
float _font_get_global_oversampling ( ) virtual const
Returns the font oversampling factor, shared by all fonts in the TextServer.
Returns glyph advance (offset of the next glyph).
Note: Advance for glyphs outlines is the same as the base glyph advance and is not saved.
Dictionary _font_get_glyph_contours ( RID font_rid, int size, int index ) virtual const
Returns outline contours of the glyph as a Dictionary
with the following contents:
points
- PackedVector3Array, containing outline points. x
and y
are point coordinates. z
is the type of the point, using the ContourPointTag values.
contours
- PackedInt32Array, containing indices the end points of each contour.
orientation
- bool, contour orientation. If true
, clockwise contours must be filled.
int _font_get_glyph_index ( RID font_rid, int size, int char, int variation_selector ) virtual const
Returns the glyph index of a char
, optionally modified by the variation_selector
.
Returns list of rendered glyphs in the cache entry.
Returns glyph offset from the baseline.
Returns size of the glyph.
Returns index of the cache texture containing the glyph.
Returns rectangle in the cache texture containing the glyph.
Returns the font hinting mode. Used by dynamic fonts only.
Returns kerning for the pair of glyphs.
Returns list of the kerning overrides.
Returns true
if support override is enabled for the language
.
PackedStringArray _font_get_language_support_overrides ( RID font_rid ) virtual
Returns list of language support overrides.
Return the width of the range around the shape between the minimum and maximum representable signed distance.
Returns source font size used to generate MSDF textures.
Returns font family name.
Dictionary _font_get_opentype_feature_overrides ( RID font_rid ) virtual const
Returns font OpenType feature set override.
Returns font oversampling factor, if set to 0.0
global oversampling factor is used instead. Used by dynamic fonts only.
Returns scaling factor of the color bitmap font.
Returns true
if support override is enabled for the script
.
PackedStringArray _font_get_script_support_overrides ( RID font_rid ) virtual
Returns list of script support overrides.
Return 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 size, SpacingType spacing ) virtual const
Returns extra spacing added between glyphs in pixels.
Returns font style flags, see FontStyle.
Returns font style name.
SubpixelPositioning _font_get_subpixel_positioning ( RID font_rid ) virtual const
Returns font sub-pixel glyph positioning mode.
Returns a string containing all the characters available in the font.
Returns number of textures used by font cache entry.
Returns font cache texture image data.
PackedInt32Array _font_get_texture_offsets ( RID font_rid, Vector2i size, int texture_index ) virtual const
Returns array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty.
Transform2D _font_get_transform ( RID font_rid ) virtual const
Retruns 2D transform applied to the font outlines.
Returns pixel offset of the underline below the baseline.
Returns thickness of the underline in pixels.
Dictionary _font_get_variation_coordinates ( RID font_rid ) virtual const
Returns variation coordinates for the specified font cache entry. See _font_supported_variation_list for more info.
Return true
if a Unicode char
is available in the font.
Returns true
if font 8-bit anitialiased glyph rend