TextServerExtension
继承: TextServer
< RefCounted
< Object
派生: TextServerAdvanced
, TextServerDummy
, TextServerFallback
Base class for custom TextServer
implementations (plugins).
描述
External TextServer
implementations should inherit from this class.
方法
void | _cleanup ( ) virtual1 |
RID | _create_font ( ) virtual1 |
RID | _create_font_linked_variation ( font_rid: RID ) virtual1 |
RID | _create_shaped_text ( direction: Direction, orientation: Orientation ) virtual1 |
void | _draw_hex_code_box ( canvas: RID , size: int , pos: Vector2 , index: int , color: Color ) virtual1 const2 |
void | _font_clear_glyphs ( font_rid: RID , size: Vector2i ) virtual1 |
void | _font_clear_kerning_map ( font_rid: RID , size: int ) virtual1 |
void | _font_clear_size_cache ( font_rid: RID ) virtual1 |
void | _font_clear_textures ( font_rid: RID , size: Vector2i ) virtual1 |
void | _font_draw_glyph ( font_rid: RID , canvas: RID , size: int , pos: Vector2 , index: int , color: Color ) virtual1 const2 |
void | _font_draw_glyph_outline ( font_rid: RID , canvas: RID , size: int , outline_size: int , pos: Vector2 , index: int , color: Color ) virtual1 const2 |
FontAntialiasing | _font_get_antialiasing ( font_rid: RID ) virtual1 const2 |
float | _font_get_ascent ( font_rid: RID , size: int ) virtual1 const2 |
float | _font_get_baseline_offset ( font_rid: RID ) virtual1 const2 |
int | _font_get_char_from_glyph_index ( font_rid: RID , size: int , glyph_index: int ) virtual1 const2 |
float | _font_get_descent ( font_rid: RID , size: int ) virtual1 const2 |
bool | _font_get_disable_embedded_bitmaps ( font_rid: RID ) virtual1 const2 |
float | _font_get_embolden ( font_rid: RID ) virtual1 const2 |
int | _font_get_face_count ( font_rid: RID ) virtual1 const2 |
int | _font_get_face_index ( font_rid: RID ) virtual1 const2 |
int | _font_get_fixed_size ( font_rid: RID ) virtual1 const2 |
FixedSizeScaleMode | _font_get_fixed_size_scale_mode ( font_rid: RID ) virtual1 const2 |
bool | _font_get_generate_mipmaps ( font_rid: RID ) virtual1 const2 |
float | _font_get_global_oversampling ( ) virtual1 const2 |
Vector2 | _font_get_glyph_advance ( font_rid: RID , size: int , glyph: int ) virtual1 const2 |
Dictionary | _font_get_glyph_contours ( font_rid: RID , size: int , index: int ) virtual1 const2 |
int | _font_get_glyph_index ( font_rid: RID , size: int , char: int , variation_selector: int ) virtual1 const2 |
PackedInt32Array | _font_get_glyph_list ( font_rid: RID , size: Vector2i ) virtual1 const2 |
Vector2 | _font_get_glyph_offset ( font_rid: RID , size: Vector2i , glyph: int ) virtual1 const2 |
Vector2 | _font_get_glyph_size ( font_rid: RID , size: Vector2i , glyph: int ) virtual1 const2 |
int | _font_get_glyph_texture_idx ( font_rid: RID , size: Vector2i , glyph: int ) virtual1 const2 |
RID | _font_get_glyph_texture_rid ( font_rid: RID , size: Vector2i , glyph: int ) virtual1 const2 |
Vector2 | _font_get_glyph_texture_size ( font_rid: RID , size: Vector2i , glyph: int ) virtual1 const2 |
Rect2 | _font_get_glyph_uv_rect ( font_rid: RID , size: Vector2i , glyph: int ) virtual1 const2 |
Hinting | _font_get_hinting ( font_rid: RID ) virtual1 const2 |
Vector2 | _font_get_kerning ( font_rid: RID , size: int , glyph_pair: Vector2i ) virtual1 const2 |
Array Vector2i | _font_get_kerning_list ( font_rid: RID , size: int ) virtual1 const2 |
bool | _font_get_language_support_override ( font_rid: RID , language: String ) virtual1 |
PackedStringArray | _font_get_language_support_overrides ( font_rid: RID ) virtual1 |
int | _font_get_msdf_pixel_range ( font_rid: RID ) virtual1 const2 |
int | _font_get_msdf_size ( font_rid: RID ) virtual1 const2 |
String | _font_get_name ( font_rid: RID ) virtual1 const2 |
Dictionary | _font_get_opentype_feature_overrides ( font_rid: RID ) virtual1 const2 |
Dictionary | _font_get_ot_name_strings ( font_rid: RID ) virtual1 const2 |
float | _font_get_oversampling ( font_rid: RID ) virtual1 const2 |
float | _font_get_scale ( font_rid: RID , size: int ) virtual1 const2 |
bool | _font_get_script_support_override ( font_rid: RID , script: String ) virtual1 |
PackedStringArray | _font_get_script_support_overrides ( font_rid: RID ) virtual1 |
Array Vector2i | _font_get_size_cache_list ( font_rid: RID ) virtual1 const2 |
int | _font_get_spacing ( font_rid: RID , spacing: SpacingType ) virtual1 const2 |
int | _font_get_stretch ( font_rid: RID ) virtual1 const2 |
FontStyle | _font_get_style ( font_rid: RID ) virtual1 const2 |
String | _font_get_style_name ( font_rid: RID ) virtual1 const2 |
SubpixelPositioning | _font_get_subpixel_positioning ( font_rid: RID ) virtual1 const2 |
String | _font_get_supported_chars ( font_rid: RID ) virtual1 const2 |
PackedInt32Array | _font_get_supported_glyphs ( font_rid: RID ) virtual1 const2 |
int | _font_get_texture_count ( font_rid: RID , size: Vector2i ) virtual1 const2 |
Image | _font_get_texture_image ( font_rid: RID , size: Vector2i , texture_index: int ) virtual1 const2 |
PackedInt32Array | _font_get_texture_offsets ( font_rid: RID , size: Vector2i , texture_index: int ) virtual1 const2 |
Transform2D | _font_get_transform ( font_rid: RID ) virtual1 const2 |
float | _font_get_underline_position ( font_rid: RID , size: int ) virtual1 const2 |
float | _font_get_underline_thickness ( font_rid: RID , size: int ) virtual1 const2 |
Dictionary | _font_get_variation_coordinates ( font_rid: RID ) virtual1 const2 |
int | _font_get_weight ( font_rid: RID ) virtual1 const2 |
bool | _font_has_char ( font_rid: RID , char: int ) virtual1 const2 |
bool | _font_is_allow_system_fallback ( font_rid: RID ) virtual1 const2 |
bool | _font_is_force_autohinter ( font_rid: RID ) virtual1 const2 |
bool | _font_is_language_supported ( font_rid: RID , language: String ) virtual1 const2 |
bool | _font_is_multichannel_signed_distance_field ( font_rid: RID ) virtual1 const2 |
bool | _font_is_script_supported ( font_rid: RID , script: String ) virtual1 const2 |
void | _font_remove_glyph ( font_rid: RID , size: Vector2i , glyph: int ) virtual1 |
void | _font_remove_kerning ( font_rid: RID , size: int , glyph_pair: Vector2i ) virtual1 |
void | _font_remove_language_support_override ( font_rid: RID , language: String ) virtual1 |
void | _font_remove_script_support_override ( font_rid: RID , script: String ) virtual1 |
void | _font_remove_size_cache ( font_rid: RID , size: Vector2i ) virtual1 |
void | _font_remove_texture ( font_rid: RID , size: Vector2i , texture_index: int ) virtual1 |
void | _font_render_glyph ( font_rid: RID , size: Vector2i , index: int ) virtual1 |
void | _font_render_range ( font_rid: RID , size: Vector2i , start: int , end: int ) virtual1 |
void | _font_set_allow_system_fallback ( font_rid: RID , allow_system_fallback: bool ) virtual1 |
void | _font_set_antialiasing ( font_rid: RID , antialiasing: FontAntialiasing ) virtual1 |
void | _font_set_ascent ( font_rid: RID , size: int , ascent: float ) virtual1 |
void | _font_set_baseline_offset ( font_rid: RID , baseline_offset: float ) virtual1 |
void | _font_set_data ( font_rid: RID , data: PackedByteArray ) virtual1 |
void | _font_set_data_ptr ( font_rid: RID , data_ptr: const uint8_t* , data_size: int ) virtual1 |
void | _font_set_descent ( font_rid: RID , size: int , descent: float ) virtual1 |
void | _font_set_disable_embedded_bitmaps ( font_rid: RID , disable_embedded_bitmaps: bool ) virtual1 |
void | _font_set_embolden ( font_rid: RID , strength: float ) virtual1 |
void | _font_set_face_index ( font_rid: RID , face_index: int ) virtual1 |
void | _font_set_fixed_size ( font_rid: RID , fixed_size: int ) virtual1 |
void | _font_set_fixed_size_scale_mode ( font_rid: RID , fixed_size_scale_mode: FixedSizeScaleMode ) virtual1 |
void | _font_set_force_autohinter ( font_rid: RID , force_autohinter: bool ) virtual1 |
void | _font_set_generate_mipmaps ( font_rid: RID , generate_mipmaps: bool ) virtual1 |
void | _font_set_global_oversampling ( oversampling: float ) virtual1 |
void | _font_set_glyph_advance ( font_rid: RID , size: int , glyph: int , advance: Vector2 ) virtual1 |
void | _font_set_glyph_offset ( font_rid: RID , size: Vector2i , glyph: int , offset: Vector2 ) virtual1 |
void | _font_set_glyph_size ( font_rid: RID , size: Vector2i , glyph: int , gl_size: Vector2 ) virtual1 |
void | _font_set_glyph_texture_idx ( font_rid: RID , size: Vector2i , glyph: int , texture_idx: int ) virtual1 |
void | _font_set_glyph_uv_rect ( font_rid: RID , size: Vector2i , glyph: int , uv_rect: Rect2 ) virtual1 |
void | _font_set_hinting ( font_rid: RID , hinting: Hinting ) virtual1 |
void | _font_set_kerning ( font_rid: RID , size: int , glyph_pair: Vector2i , kerning: Vector2 ) virtual1 |
void | _font_set_language_support_override ( font_rid: RID , language: String , supported: bool ) virtual1 |
void | _font_set_msdf_pixel_range ( font_rid: RID , msdf_pixel_range: int ) virtual1 |
void | _font_set_msdf_size ( font_rid: RID , msdf_size: int ) virtual1 |
void | _font_set_multichannel_signed_distance_field ( font_rid: RID , msdf: bool ) virtual1 |
void | _font_set_name ( font_rid: RID , name: String ) virtual1 |
void | _font_set_opentype_feature_overrides ( font_rid: RID , overrides: Dictionary ) virtual1 |
void | _font_set_oversampling ( font_rid: RID , oversampling: float ) virtual1 |
void | _font_set_scale ( font_rid: RID , size: int , scale: float ) virtual1 |
void | _font_set_script_support_override ( font_rid: RID , script: String , supported: bool ) virtual1 |
void | _font_set_spacing ( font_rid: RID , spacing: SpacingType, value: int ) virtual1 |
void | _font_set_stretch ( font_rid: RID , stretch: int ) virtual1 |
void | _font_set_style ( font_rid: RID , style: FontStyle ) virtual1 |
void | _font_set_style_name ( font_rid: RID , name_style: String ) virtual1 |
void | _font_set_subpixel_positioning ( font_rid: RID , subpixel_positioning: SubpixelPositioning ) virtual1 |
void | _font_set_texture_image ( font_rid: RID , size: Vector2i , texture_index: int , image: Image ) virtual1 |
void | _font_set_texture_offsets ( font_rid: RID , size: Vector2i , texture_index: int , offset: PackedInt32Array ) virtual1 |
void | _font_set_transform ( font_rid: RID , transform: Transform2D ) virtual1 |
void | _font_set_underline_position ( font_rid: RID , size: int , underline_position: float ) virtual1 |
void | _font_set_underline_thickness ( font_rid: RID , size: int , underline_thickness: float ) virtual1 |
void | _font_set_variation_coordinates ( font_rid: RID , variation_coordinates: Dictionary ) virtual1 |
void | _font_set_weight ( font_rid: RID , weight: int ) virtual1 |
Dictionary | _font_supported_feature_list ( font_rid: RID ) virtual1 const2 |
Dictionary | _font_supported_variation_list ( font_rid: RID ) virtual1 const2 |
String | _format_number ( number: String , language: String ) virtual1 const2 |
void | _free_rid ( rid: RID ) virtual1 |
int | _get_features ( ) virtual1 const2 |
Vector2 | _get_hex_code_box_size ( size: int , index: int ) virtual1 const2 |
String | _get_name ( ) virtual1 const2 |
String | _get_support_data_filename ( ) virtual1 const2 |
String | _get_support_data_info ( ) virtual1 const2 |
bool | _has ( rid: RID ) virtual1 |
bool | _has_feature ( feature: Feature ) virtual1 const2 |
int | _is_confusable ( string: String , dict: PackedStringArray ) virtual1 const2 |
bool | _is_locale_right_to_left ( locale: String ) virtual1 const2 |
bool | _is_valid_identifier ( string: String ) virtual1 const2 |
bool | _is_valid_letter ( unicode: int ) virtual1 const2 |
bool | _load_support_data ( filename: String ) virtual1 |
int | _name_to_tag ( name: String ) virtual1 const2 |
String | _parse_number ( number: String , language: String ) virtual1 const2 |
Array Vector3i | _parse_structured_text ( parser_type: StructuredTextParser, args: Array , text: String ) virtual1 const2 |
String | _percent_sign ( language: String ) virtual1 const2 |
bool | _save_support_data ( filename: String ) virtual1 const2 |
int | _shaped_get_span_count ( shaped: RID ) virtual1 const2 |
Variant | _shaped_get_span_meta ( shaped: RID , index: int ) virtual1 const2 |
void | _shaped_set_span_update_font ( shaped: RID , index: int , fonts: Array RID , size: int , opentype_features: Dictionary ) virtual1 |
bool | _shaped_text_add_object ( shaped: RID , key: Variant , size: Vector2 , inline_align: InlineAlignment, length: int , baseline: float ) virtual1 |
bool | _shaped_text_add_string ( shaped: RID , text: String , fonts: Array RID , size: int , opentype_features: Dictionary , language: String , meta: Variant ) virtual1 |
void | _shaped_text_clear ( shaped: RID ) virtual1 |
int | _shaped_text_closest_character_pos ( shaped: RID , pos: int ) virtual1 const2 |
void | _shaped_text_draw ( shaped: RID , canvas: RID , pos: Vector2 , clip_l: float , clip_r: float , color: Color ) virtual1 const2 |
void | _shaped_text_draw_outline ( shaped: RID , canvas: RID , pos: Vector2 , clip_l: float , clip_r: float , outline_size: int , color: Color ) virtual1 const2 |
float | _shaped_text_fit_to_width ( shaped: RID , width: float , justification_flags: JustificationFlag ) virtual1 |
float | _shaped_text_get_ascent ( shaped: RID ) virtual1 const2 |
void | _shaped_text_get_carets ( shaped: RID , position: int , caret: CaretInfo* ) virtual1 const2 |
PackedInt32Array | _shaped_text_get_character_breaks ( shaped: RID ) virtual1 const2 |
int | _shaped_text_get_custom_ellipsis ( shaped: RID ) virtual1 const2 |
String | _shaped_text_get_custom_punctuation ( shaped: RID ) virtual1 const2 |
float | _shaped_text_get_descent ( shaped: RID ) virtual1 const2 |
Direction | _shaped_text_get_direction ( shaped: RID ) virtual1 const2 |
int | _shaped_text_get_dominant_direction_in_range ( shaped: RID , start: int , end: int ) virtual1 const2 |
int | _shaped_text_get_ellipsis_glyph_count ( shaped: RID ) virtual1 const2 |
const Glyph* | _shaped_text_get_ellipsis_glyphs ( shaped: RID ) virtual1 const2 |
int | _shaped_text_get_ellipsis_pos ( shaped: RID ) virtual1 const2 |
int | _shaped_text_get_glyph_count ( shaped: RID ) virtual1 const2 |
const Glyph* | _shaped_text_get_glyphs ( shaped: RID ) virtual1 const2 |
Vector2 | _shaped_text_get_grapheme_bounds ( shaped: RID , pos: int ) virtual1 const2 |
Direction | _shaped_text_get_inferred_direction ( shaped: RID ) virtual1 const2 |
PackedInt32Array | _shaped_text_get_line_breaks ( shaped: RID , width: float , start: int , break_flags: LineBreakFlag ) virtual1 const2 |
PackedInt32Array | _shaped_text_get_line_breaks_adv ( shaped: RID , width: PackedFloat32Array , start: int , once: bool , break_flags: LineBreakFlag ) virtual1 const2 |
int | _shaped_text_get_object_glyph ( shaped: RID , key: Variant ) virtual1 const2 |
Vector2i | _shaped_text_get_object_range ( shaped: RID , key: Variant ) virtual1 const2 |
Rect2 | _shaped_text_get_object_rect ( shaped: RID , key: Variant ) virtual1 const2 |
Array | _shaped_text_get_objects ( shaped: RID ) virtual1 const2 |
Orientation | _shaped_text_get_orientation ( shaped: RID ) virtual1 const2 |
RID | _shaped_text_get_parent ( shaped: RID ) virtual1 const2 |
bool | _shaped_text_get_preserve_control ( shaped: RID ) virtual1 const2 |
bool | _shaped_text_get_preserve_invalid ( shaped: RID ) virtual1 const2 |
Vector2i | _shaped_text_get_range ( shaped: RID ) virtual1 const2 |
PackedVector2Array | _shaped_text_get_selection ( shaped: RID , start: int , end: int ) virtual1 const2 |
Vector2 | _shaped_text_get_size ( shaped: RID ) virtual1 const2 |
int | _shaped_text_get_spacing ( shaped: RID , spacing: SpacingType ) virtual1 const2 |
int | _shaped_text_get_trim_pos ( shaped: RID ) virtual1 const2 |
float | _shaped_text_get_underline_position ( shaped: RID ) virtual1 const2 |
float | _shaped_text_get_underline_thickness ( shaped: RID ) virtual1 const2 |
float | _shaped_text_get_width ( shaped: RID ) virtual1 const2 |
PackedInt32Array | _shaped_text_get_word_breaks ( shaped: RID , grapheme_flags: GraphemeFlag, skip_grapheme_flags: GraphemeFlag ) virtual1 const2 |
int | _shaped_text_hit_test_grapheme ( shaped: RID , coord: float ) virtual1 const2 |
int | _shaped_text_hit_test_position ( shaped: RID , coord: float ) virtual1 const2 |
bool | _shaped_text_is_ready ( shaped: RID ) virtual1 const2 |
int | _shaped_text_next_character_pos ( shaped: RID , pos: int ) virtual1 const2 |
int | _shaped_text_next_grapheme_pos ( shaped: RID , pos: int ) virtual1 const2 |
void | _shaped_text_overrun_trim_to_width ( shaped: RID , width: float , trim_flags: TextOverrunFlag ) virtual1 |
int | _shaped_text_prev_character_pos ( shaped: RID , pos: int ) virtual1 const2 |
int | _shaped_text_prev_grapheme_pos ( shaped: RID , pos: int ) virtual1 const2 |
bool | _shaped_text_resize_object ( shaped: RID , key: Variant , size: Vector2 , inline_align: InlineAlignment, baseline: float ) virtual1 |
void | _shaped_text_set_bidi_override ( shaped: RID , override: Array ) virtual1 |
void | _shaped_text_set_custom_ellipsis ( shaped: RID , char: int ) virtual1 |
void | _shaped_text_set_custom_punctuation ( shaped: RID , punct: String ) virtual1 |
void | _shaped_text_set_direction ( shaped: RID , direction: Direction ) virtual1 |
void | _shaped_text_set_orientation ( shaped: RID , orientation: Orientation ) virtual1 |
void | _shaped_text_set_preserve_control ( shaped: RID , enabled: bool ) virtual1 |
void | _shaped_text_set_preserve_invalid ( shaped: RID , enabled: bool ) virtual1 |
void | _shaped_text_set_spacing ( shaped: RID , spacing: SpacingType, value: int ) virtual1 |
bool | _shaped_text_shape ( shaped: RID ) virtual1 |
const Glyph* | _shaped_text_sort_logical ( shaped: RID ) virtual1 |
RID | _shaped_text_substr ( shaped: RID , start: int , length: int ) virtual1 const2 |
float | _shaped_text_tab_align ( shaped: RID , tab_stops: PackedFloat32Array ) virtual1 |
bool | _shaped_text_update_breaks ( shaped: RID ) virtual1 |
bool | _shaped_text_update_justification_ops ( shaped: RID ) virtual1 |
bool | _spoof_check ( string: String ) virtual1 const2 |
PackedInt32Array | _string_get_character_breaks ( string: String , language: String ) virtual1 const2 |
PackedInt32Array | _string_get_word_breaks ( string: String , language: String , chars_per_line: int ) virtual1 const2 |
String | _string_to_lower ( string: String , language: String ) virtual1 const2 |
String | _string_to_title ( string: String , language: String ) virtual1 const2 |
String | _string_to_upper ( string: String , language: String ) virtual1 const2 |
String | _strip_diacritics ( string: String ) virtual1 const2 |
String | _tag_to_name ( tag: int ) virtual1 const2 |
方法说明
void
_cleanup ( ) virtual1
Optional.
This method is called before text server is unregistered.
Required.
Creates a new, empty font cache entry resource.
RID
_create_font_linked_variation ( font_rid: RID
) virtual1
Optional, 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 ( direction: Direction, orientation: Orientation ) virtual1
Required.
Creates a new buffer for complex text layout, with the given direction
and orientation
.
void
_draw_hex_code_box ( canvas: RID
, size: int
, pos: Vector2
, index: int
, color: Color
) virtual1 const2
Optional.
Draws box displaying character hexadecimal code.
void
_font_clear_glyphs ( font_rid: RID
, size: Vector2i
) virtual1
Required.
Removes all rendered glyph information from the cache entry.
void
_font_clear_kerning_map ( font_rid: RID
, size: int
) virtual1
Optional.
Removes all kerning overrides.
void
_font_clear_size_cache ( font_rid: RID
) virtual1
Required.
Removes all font sizes from the cache entry.
void
_font_clear_textures ( font_rid: RID
, size: Vector2i
) virtual1
Required.
Removes all textures from font cache entry.
void
_font_draw_glyph ( font_rid: RID
, canvas: RID
, size: int
, pos: Vector2
, index: int
, color: Color
) virtual1 const2
Required.
Draws single glyph into a canvas item at the position, using font_rid
at the size size
.
void
_font_draw_glyph_outline ( font_rid: RID
, canvas: RID
, size: int
, outline_size: int
, pos: Vector2
, index: int
, color: Color
) virtual1 const2
Required.
Draws single glyph outline of size outline_size
into a canvas item at the position, using font_rid
at the size size
.
FontAntialiasing _font_get_antialiasing ( font_rid: RID
) virtual1 const2
Optional.
Returns font anti-aliasing mode.
float
_font_get_ascent ( font_rid: RID
, size: int
) virtual1 const2
Required.
Returns the font ascent (number of pixels above the baseline).
float
_font_get_baseline_offset ( font_rid: RID
) virtual1 const2
Optional.
Returns extra baseline offset (as a fraction of font height).
int
_font_get_char_from_glyph_index ( font_rid: RID
, size: int
, glyph_index: int
) virtual1 const2
Required.
Returns character code associated with glyph_index
, or 0
if glyph_index
is invalid.
float
_font_get_descent ( font_rid: RID
, size: int
) virtual1 const2
Required.
Returns the font descent (number of pixels below the baseline).
bool
_font_get_disable_embedded_bitmaps ( font_rid: RID
) virtual1 const2
Optional.
Returns whether the font's embedded bitmap loading is disabled.
float
_font_get_embolden ( font_rid: RID
) virtual1 const2
Optional.
Returns font embolden strength.
int
_font_get_face_count ( font_rid: RID
) virtual1 const2
Optional.
Returns number of faces in the TrueType / OpenType collection.
int
_font_get_face_index ( font_rid: RID
) virtual1 const2
Optional.
Returns an active face index in the TrueType / OpenType collection.
int
_font_get_fixed_size ( font_rid: RID
) virtual1 const2
Required.
Returns bitmap font fixed size.
FixedSizeScaleMode _font_get_fixed_size_scale_mode ( font_rid: RID
) virtual1 const2
Required.
Returns bitmap font scaling mode.
bool
_font_get_generate_mipmaps ( font_rid: RID
) virtual1 const2
Optional.
Returns true
if font texture mipmap generation is enabled.
float
_font_get_global_oversampling ( ) virtual1 const2
Optional.
Returns the font oversampling factor, shared by all fonts in the TextServer.
Vector2
_font_get_glyph_advance ( font_rid: RID
, size: int
, glyph: int
) virtual1 const2
Required.
Returns glyph advance (offset of the next glyph).
Dictionary
_font_get_glyph_contours ( font_rid: RID
, size: int
, index: int
) virtual1 const2
Optional.
Returns outline contours of the glyph.
int
_font_get_glyph_index ( font_rid: RID
, size: int
, char: int
, variation_selector: int
) virtual1 const2
Required.
Returns the glyph index of a char
, optionally modified by the variation_selector
.
PackedInt32Array
_font_get_glyph_list ( font_rid: RID
, size: Vector2i
) virtual1 const2
Required.
Returns list of rendered glyphs in the cache entry.
Vector2
_font_get_glyph_offset ( font_rid: RID
, size: Vector2i
, glyph: int
) virtual1 const2
Required.
Returns glyph offset from the baseline.
Vector2
_font_get_glyph_size ( font_rid: RID
, size: Vector2i
, glyph: int
) virtual1 const2
Required.
Returns size of the glyph.
int
_font_get_glyph_texture_idx ( font_rid: RID
, size: Vector2i
, glyph: int
) virtual1 const2
Required.
Returns index of the cache texture containing the glyph.
RID
_font_get_glyph_texture_rid ( font_rid: RID
, size: Vector2i
, glyph: int
) virtual1 const2
Required.
Returns resource ID of the cache texture containing the glyph.
Vector2
_font_get_glyph_texture_size ( font_rid: RID
, size: Vector2i
, glyph: int
) virtual1 const2
Required.
Returns size of the cache texture containing the glyph.
Rect2
_font_get_glyph_uv_rect ( font_rid: RID
, size: Vector2i
, glyph: int
) virtual1 const2
Required.
Returns rectangle in the cache texture containing the glyph.
Hinting _font_get_hinting ( font_rid: RID
) virtual1 const2
Optional.
Returns the font hinting mode. Used by dynamic fonts only.
Vector2
_font_get_kerning ( font_rid: RID
, size: int
, glyph_pair: Vector2i
) virtual1 const2
Optional.
Returns kerning for the pair of glyphs.
Array Vector2i
_font_get_kerning_list ( font_rid: RID
, size: int
) virtual1 const2
Optional.
Returns list of the kerning overrides.
bool
_font_get_language_support_override ( font_rid: RID
, language: String
) virtual1
Optional.
Returns true
if support override is enabled for the language
.
PackedStringArray
_font_get_language_support_overrides ( font_rid: RID
) virtual1
Optional.
Returns list of language support overrides.
int
_font_get_msdf_pixel_range ( font_rid: RID
) virtual1 const2
Optional.
Returns the width of the range around the shape between the minimum and maximum representable signed distance.
int
_font_get_msdf_size ( font_rid: RID
) virtual1 const2
Optional.
Returns source font size used to generate MSDF textures.
String
_font_get_name ( font_rid: RID
) virtual1 const2
Optional.
Returns font family name.
Dictionary
_font_get_opentype_feature_overrides ( font_rid: RID
) virtual1 const2
Optional.
Returns font OpenType feature set override.
Dictionary
_font_get_ot_name_strings ( font_rid: RID
) virtual1 const2
Optional.
Returns Dictionary
with OpenType font name strings (localized font names, version, description, license information, sample text, etc.).
float
_font_get_oversampling ( font_rid: RID
) virtual1 const2
Optional.
Returns font oversampling factor, if set to 0.0
global oversampling factor is used instead. Used by dynamic fonts only.
float
_font_get_scale ( font_rid: RID
, size: int
) virtual1 const2
Required.
Returns scaling factor of the color bitmap font.
bool
_font_get_script_support_override ( font_rid: RID
, script: String
) virtual1
Optional.
Returns true
if support override is enabled for the script
.
PackedStringArray
_font_get_script_support_overrides ( font_rid: RID
) virtual1
Optional.
Returns list of script support overrides.
Array Vector2i
_font_get_size_cache_list ( font_rid: RID
) virtual1 const2
Required.
Returns list of the font sizes in the cache. Each size is Vector2i
with font size and outline size.
int
_font_get_spacing ( font_rid: RID
, spacing: SpacingType ) virtual1 const2
Optional.
Returns the spacing for spacing
(see SpacingType) in pixels (not relative to the font size).
int
_font_get_stretch ( font_rid: RID
) virtual1 const2
Optional.
Returns font stretch amount, compared to a normal width. A percentage value between 50%
and 200%
.
FontStyle _font_get_style ( font_rid: RID
) virtual1 const2
Optional.
Returns font style flags, see FontStyle.
String
_font_get_style_name ( font_rid: RID
) virtual1 const2
Optional.
Returns font style name.
SubpixelPositioning _font_get_subpixel_positioning ( font_rid: RID
) virtual1 const2
Optional.
Returns font subpixel glyph positioning mode.
String
_font_get_supported_chars ( font_rid: RID
) virtual1 const2
Required.
Returns a string containing all the characters available in the font.
PackedInt32Array
_font_get_supported_glyphs ( font_rid: RID
) virtual1 const2
Required.
Returns an array containing all glyph indices in the font.
int
_font_get_texture_count ( font_rid: RID
, size: Vector2i
) virtual1 const2
Required.
Returns number of textures used by font cache entry.
Image
_font_get_texture_image ( font_rid: RID
, size: Vector2i
, texture_index: int
) virtual1 const2
Required.
Returns font cache texture image data.
PackedInt32Array
_font_get_texture_offsets ( font_rid: RID
, size: Vector2i
, texture_index: int
) virtual1 const2
Optional.
Returns array containing glyph packing data.
Transform2D
_font_get_transform ( font_rid: RID
) virtual1 const2
Optional.
Returns 2D transform applied to the font outlines.
float
_font_get_underline_position ( font_rid: RID
, size: int
) virtual1 const2
Required.
Returns pixel offset of the underline below the baseline.
float
_font_get_underline_thickness ( font_rid: RID
, size: int
) virtual1 const2
Required.
Returns thickness of the underline in pixels.
Dictionary
_font_get_variation_coordinates ( font_rid: RID
) virtual1 const2
Optional.
Returns variation coordinates for the specified font cache entry.
int
_font_get_weight ( font_rid: RID
) virtual1 const2
Optional.
Returns 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 ( font_rid: RID
, char: int
) virtual1 const2
Required.
Returns true
if a Unicode char
is available in the font.
bool
_font_is_allow_system_fallback ( font_rid: RID
) virtual1 const2
Optional.
Returns true
if system fonts can be automatically used as fallbacks.
bool
_font_is_force_autohinter ( font_rid: RID
) virtual1 const2
Optional.
Returns true
if auto-hinting is supported and preferred over font built-in hinting.
bool
_font_is_language_supported ( font_rid: RID
, language: String
) virtual1 const2
Optional.
Returns true
, if font supports given language (ISO 639 code).
bool
_font_is_multichannel_signed_distance_field ( font_rid: RID
) virtual1 const2
Optional.
Returns 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 ( font_rid: RID
, script: String
) virtual1 const2
Optional.
Returns true
, if font supports given script (ISO 15924 code).
void
_font_remove_glyph ( font_rid: RID
, size: Vector2i
, glyph: int
) virtual1
Required.
Removes specified rendered glyph information from the cache entry.
void
_font_remove_kerning ( font_rid: RID
, size: int
, glyph_pair: Vector2i
) virtual1
Optional.
Removes kerning override for the pair of glyphs.
void
_font_remove_language_support_override ( font_rid: RID
, language: String
) virtual1
Optional.
Remove language support override.
void
_font_remove_script_support_override ( font_rid: RID
, script: String
) virtual1
Optional.
Removes script support override.
void
_font_remove_size_cache ( font_rid: RID
, size: Vector2i
) virtual1
Required.
Removes specified font size from the cache entry.
void
_font_remove_texture ( font_rid: RID
, size: Vector2i
, texture_index: int
) virtual1
Required.
Removes specified texture from the cache entry.
void
_font_render_glyph ( font_rid: RID
, size: Vector2i
, index: int
) virtual1
Optional.
Renders specified glyph to the font cache texture.
void
_font_render_range ( font_rid: RID
, size: Vector2i
, start: int
, end: int
) virtual1
Optional.
Renders the range of characters to the font cache texture.
void
_font_set_allow_system_fallback ( font_rid: RID
, allow_system_fallback: bool
) virtual1
Optional.
If set to true
, system fonts can be automatically used as fallbacks.
void
_font_set_antialiasing ( font_rid: RID
, antialiasing: FontAntialiasing ) virtual1
Optional.
Sets font anti-aliasing mode.
void
_font_set_ascent ( font_rid: RID
, size: int
, ascent: float
) virtual1
Required.
Sets the font ascent (number of pixels above the baseline).
void
_font_set_baseline_offset ( font_rid: RID
, baseline_offset: float
) virtual1
Optional.
Sets extra baseline offset (as a fraction of font height).
void
_font_set_data ( font_rid: RID
, data: PackedByteArray
) virtual1
Optional.
Sets font source data, e.g contents of the dynamic font source file.
void
_font_set_data_ptr ( font_rid: RID
, data_ptr: const uint8_t*
, data_size: int
) virtual1
Optional.
Sets pointer to the font source data, e.g contents of the dynamic font source file.
void
_font_set_descent ( font_rid: RID
, size: int
, descent: float
) virtual1
Required.
Sets the font descent (number of pixels below the baseline).
void
_font_set_disable_embedded_bitmaps ( font_rid: RID
, disable_embedded_bitmaps: bool
) virtual1
Optional.
If set to true
, embedded font bitmap loading is disabled.
void
_font_set_embolden ( font_rid: RID
, strength: float
) virtual1
Sets 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 ( font_rid: RID
, face_index: int
) virtual1
Optional.
Sets an active face index in the TrueType / OpenType collection.
void
_font_set_fixed_size ( font_rid: RID
, fixed_size: int
) virtual1
Required.
Sets 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 ( font_rid: RID
, fixed_size_scale_mode: FixedSizeScaleMode ) virtual1
Required.
Sets bitmap font scaling mode. This property is used only if fixed_size
is greater than zero.
void
_font_set_force_autohinter ( font_rid: RID
, force_autohinter: bool
) virtual1
Optional.
If set to true
auto-hinting is preferred over font built-in hinting.
void
_font_set_generate_mipmaps ( font_rid: RID
, generate_mipmaps: bool
) virtual1
Optional.
If set to true
font texture mipmap generation is enabled.
void
_font_set_global_oversampling ( oversampling: float
) virtual1
Optional.
Sets oversampling factor, shared by all font in the TextServer.
void
_font_set_glyph_advance ( font_rid: RID
, size: int
, glyph: int
, advance: Vector2
) virtual1
Required.
Sets glyph advance (offset of the next glyph).
void
_font_set_glyph_offset ( font_rid: RID
, size: Vector2i
, glyph: int
, offset: Vector2
) virtual1
Required.
Sets glyph offset from the baseline.
void
_font_set_glyph_size ( font_rid: RID
, size: Vector2i
, glyph: int
, gl_size: Vector2
) virtual1
Required.
Sets size of the glyph.
void
_font_set_glyph_texture_idx ( font_rid: RID
, size: Vector2i
, glyph: int
, texture_idx: int
) virtual1
Required.
Sets index of the cache texture containing the glyph.
void
_font_set_glyph_uv_rect ( font_rid: RID
, size: Vector2i
, glyph: int
, uv_rect: Rect2
) virtual1
Required.
Sets rectangle in the cache texture containing the glyph.
void
_font_set_hinting ( font_rid: RID
, hinting: Hinting ) virtual1
Optional.
Sets font hinting mode. Used by dynamic fonts only.
void
_font_set_kerning ( font_rid: RID
, size: int
, glyph_pair: Vector2i
, kerning: Vector2
) virtual1
Optional.
Sets kerning for the pair of glyphs.
void
_font_set_language_support_override ( font_rid: RID
, language: String
, supported: bool
) virtual1
Optional.
Adds override for _font_is_language_supported
.
void
_font_set_msdf_pixel_range ( font_rid: RID
, msdf_pixel_range: int
) virtual1
Optional.
Sets the width of the range around the shape between the minimum and maximum representable signed distance.
void
_font_set_msdf_size ( font_rid: RID
, msdf_size: int
) virtual1
Optional.
Sets source font size used to generate MSDF textures.
void
_font_set_multichannel_signed_distance_field ( font_rid: RID
, msdf: bool
) virtual1
Optional.
If 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 ( font_rid: RID
, name: String
) virtual1
Optional.
Sets the font family name.
void
_font_set_opentype_feature_overrides ( font_rid: RID
, overrides: Dictionary
) virtual1
Optional.
Sets font OpenType feature set override.
void
_font_set_oversampling ( font_rid: RID
, oversampling: float
) virtual1
Optional.
Sets font oversampling factor, if set to 0.0
global oversampling factor is used instead. Used by dynamic fonts only.
void
_font_set_scale ( font_rid: RID
, size: int
, scale: float
) virtual1
Required.
Sets scaling factor of the color bitmap font.
void
_font_set_script_support_override ( font_rid: RID
, script: String
, supported: bool
) virtual1
Optional.
Adds override for _font_is_script_supported
.
void
_font_set_spacing ( font_rid: RID
, spacing: SpacingType, value: int
) virtual1
Optional.
Sets the spacing for spacing
(see SpacingType) to value
in pixels (not relative to the font size).
void
_font_set_stretch ( font_rid: RID
, stretch: int
) virtual1
Optional.
Sets font stretch amount, compared to a normal width. A percentage value between 50%
and 200%
.
void
_font_set_style ( font_rid: RID
, style: FontStyle ) virtual1
Optional.
Sets the font style flags, see FontStyle.
void
_font_set_style_name ( font_rid: RID
, name_style: String
) virtual1
Optional.
Sets the font style name.
void
_font_set_subpixel_positioning ( font_rid: RID
, subpixel_positioning: SubpixelPositioning ) virtual1
Optional.
Sets font subpixel glyph positioning mode.
void
_font_set_texture_image ( font_rid: RID
, size: Vector2i
, texture_index: int
, image: Image
) virtual1
Required.
Sets font cache texture image data.
void
_font_set_texture_offsets ( font_rid: RID
, size: Vector2i
, texture_index: int
, offset: PackedInt32Array
) virtual1
Optional.
Sets array containing glyph packing data.
void
_font_set_transform ( font_rid: RID
, transform: Transform2D
) virtual1
Optional.
Sets 2D transform, applied to the font outlines, can be used for slanting, flipping, and rotating glyphs.
void
_font_set_underline_position ( font_rid: RID
, size: int
, underline_position: float
) virtual1
Required.
Sets pixel offset of the underline below the baseline.
void
_font_set_underline_thickness ( font_rid: RID
, size: int
, underline_thickness: float
) virtual1
Required.
Sets thickness of the underline in pixels.
void
_font_set_variation_coordinates ( font_rid: RID
, variation_coordinates: Dictionary
) virtual1
Optional.
Sets variation coordinates for the specified font cache entry.
void
_font_set_weight ( font_rid: RID
, weight: int
) virtual1
Optional.
Sets 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 ( font_rid: RID
) virtual1 const2
Optional.
Returns the dictionary of the supported OpenType features.
Dictionary
_font_supported_variation_list ( font_rid: RID
) virtual1 const2
Optional.
Returns the dictionary of the supported OpenType variation coordinates.
String
_format_number ( number: String
, language: String
) virtual1 const2
Optional.
Converts a number from the Western Arabic (0..9) to the numeral systems used in language
.
void
_free_rid ( rid: RID
) virtual1
Required.
Frees an object created by this TextServer
.
int
_get_features ( ) virtual1 const2
Required.
Returns text server features, see Feature.
Vector2
_get_hex_code_box_size ( size: int
, index: int
) virtual1 const2
Optional.
Returns size of the replacement character (box with character hexadecimal code that is drawn in place of invalid characters).
String
_get_name ( ) virtual1 const2
Required.
Returns the name of the server interface.
String
_get_support_data_filename ( ) virtual1 const2
Optional.
Returns default TextServer database (e.g. ICU break iterators and dictionaries) filename.
String
_get_support_data_info ( ) virtual1 const2
Optional.
Returns TextServer database (e.g. ICU break iterators and dictionaries) description.
bool
_has ( rid: RID
) virtual1
Required.
Returns true
if rid
is valid resource owned by this text server.
bool
_has_feature ( feature: Feature ) virtual1 const2
Required.
Returns true
if the server supports a feature.
int
_is_confusable ( string: String
, dict: PackedStringArray
) virtual1 const2
Optional.
Returns 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 ( locale: String
) virtual1 const2
Required.
Returns true
if locale is right-to-left.
bool
_is_valid_identifier ( string: String
) virtual1 const2
Optional.
Returns true
if string
is a valid identifier.
bool
_is_valid_letter ( unicode: int
) virtual1 const2
该方法目前没有描述,请帮我们\ :ref:贡献一个 <doc_updating_the_class_reference>
\ 吧!
bool
_load_support_data ( filename: String
) virtual1
Optional.
Loads optional TextServer database (e.g. ICU break iterators and dictionaries).
int
_name_to_tag ( name: String
) virtual1 const2
Optional.
Converts readable feature, variation, script, or language name to OpenType tag.
String
_parse_number ( number: String
, language: String
) virtual1 const2
Optional.
Converts number
from the numeral systems used in language
to Western Arabic (0..9).
Array Vector3i
_parse_structured_text ( parser_type: StructuredTextParser, args: Array
, text: String
) virtual1 const2
Optional.
Default implementation of the BiDi algorithm override function. See StructuredTextParser for more info.
String
_percent_sign ( language: String
) virtual1 const2
Optional.
Returns percent sign used in the language
.
bool
_save_support_data ( filename: String
) virtual1 const2
Optional.
Saves optional TextServer database (e.g. ICU break iterators and dictionaries) to the file.
int
_shaped_get_span_count ( shaped: RID
) virtual1 const2
Required.
Returns number of text spans added using _shaped_text_add_string
or _shaped_text_add_object
.
Variant
_shaped_get_span_meta ( shaped: RID
, index: int
) virtual1 const2
Required.
Returns text span metadata.
void
_shaped_set_span_update_font ( shaped: RID
, index: int
, fonts: Array RID
, size: int
, opentype_features: Dictionary
) virtual1
Required.
Changes text span font, font size, and OpenType features, without changing the text.
bool
_shaped_text_add_object ( shaped: RID
, key: Variant
, size: Vector2
, inline_align: InlineAlignment, length: int
, baseline: float
) virtual1
Required.
Adds 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 ( shaped: RID
, text: String
, fonts: Array RID
, size: int
, opentype_features: Dictionary
, language: String
, meta: Variant
) virtual1
Required.
Adds text span and font to draw it to the text buffer.
void
_shaped_text_clear ( shaped: RID
) virtual1
Required.
Clears text buffer (removes text and inline objects).
int
_shaped_text_closest_character_pos ( shaped: RID
, pos: int
) virtual1 const2
Optional.
Returns composite character position closest to the pos
.
void
_shaped_text_draw ( shaped: RID
, canvas: RID
, pos: Vector2
, clip_l: float
, clip_r: float
, color: Color
) virtual1 const2
Optional.
Draw 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).
void
_shaped_text_draw_outline ( shaped: RID
, canvas: RID
, pos: Vector2
, clip_l: float
, clip_r: float
, outline_size: int
, color: Color
) virtual1 const2
Optional.
Draw 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).
float
_shaped_text_fit_to_width ( shaped: RID
, width: float
, justification_flags: JustificationFlag ) virtual1
Optional.
Adjusts text width to fit to specified width, returns new text width.
float
_shaped_text_get_ascent ( shaped: RID
) virtual1 const2
Required.
Returns 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 ( shaped: RID
, position: int
, caret: CaretInfo*
) virtual1 const2
Optional.
Returns 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 ( shaped: RID
) virtual1 const2
Optional.
Returns array of the composite character boundaries.
int
_shaped_text_get_custom_ellipsis ( shaped: RID
) virtual1 const2
Optional.
Returns ellipsis character used for text clipping.
String
_shaped_text_get_custom_punctuation ( shaped: RID
) virtual1 const2
Optional.
Returns custom punctuation character list, used for word breaking. If set to empty string, server defaults are used.
float
_shaped_text_get_descent ( shaped: RID
) virtual1 const2
Required.
Returns the text descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical).
Direction _shaped_text_get_direction ( shaped: RID
) virtual1 const2
Optional.
Returns direction of the text.
int
_shaped_text_get_dominant_direction_in_range ( shaped: RID
, start: int
, end: int
) virtual1 const2
Optional.
Returns dominant direction of in the range of text.
int
_shaped_text_get_ellipsis_glyph_count ( shaped: RID
) virtual1 const2
Required.
Returns number of glyphs in the ellipsis.
const Glyph*
_shaped_text_get_ellipsis_glyphs ( shaped: RID
) virtual1 const2
Required.
Returns array of the glyphs in the ellipsis.
int
_shaped_text_get_ellipsis_pos ( shaped: RID
) virtual1 const2
Required.
Returns position of the ellipsis.
int
_shaped_text_get_glyph_count ( shaped: RID
) virtual1 const2
Required.
Returns number of glyphs in the buffer.
const Glyph*
_shaped_text_get_glyphs ( shaped: RID
) virtual1 const2
Required.
Returns an array of glyphs in the visual order.
Vector2
_shaped_text_get_grapheme_bounds ( shaped: RID
, pos: int
) virtual1 const2
Optional.
Returns composite character's bounds as offsets from the start of the line.
Direction _shaped_text_get_inferred_direction ( shaped: RID
) virtual1 const2
Optional.
Returns direction of the text, inferred by the BiDi algorithm.
PackedInt32Array
_shaped_text_get_line_breaks ( shaped: RID
, width: float
, start: int
, break_flags: LineBreakFlag ) virtual1 const2
Optional.
Breaks text to the lines and returns character ranges for each line.
PackedInt32Array
_shaped_text_get_line_breaks_adv ( shaped: RID
, width: PackedFloat32Array
, start: int
, once: bool
, break_flags: LineBreakFlag ) virtual1 const2
Optional.
Breaks text to the lines and columns. Returns character ranges for each segment.
int
_shaped_text_get_object_glyph ( shaped: RID
, key: Variant
) virtual1 const2
Required.
Returns the glyph index of the inline object.
Vector2i
_shaped_text_get_object_range ( shaped: RID
, key: Variant
) virtual1 const2
Required.
Returns the character range of the inline object.
Rect2
_shaped_text_get_object_rect ( shaped: RID
, key: Variant
) virtual1 const2
Required.
Returns bounding rectangle of the inline object.
Array
_shaped_text_get_objects ( shaped: RID
) virtual1 const2
Required.
Returns array of inline objects.
Orientation _shaped_text_get_orientation ( shaped: RID
) virtual1 const2
Optional.
Returns text orientation.
RID
_shaped_text_get_parent ( shaped: RID
) virtual1 const2
Required.
Returns the parent buffer from which the substring originates.
bool
_shaped_text_get_preserve_control ( shaped: RID
) virtual1 const2
Optional.
Returns true
if text buffer is configured to display control characters.
bool
_shaped_text_get_preserve_invalid ( shaped: RID
) virtual1 const2
Optional.
Returns true
if text buffer is configured to display hexadecimal codes in place of invalid characters.
Vector2i
_shaped_text_get_range ( shaped: RID
) virtual1 const2
Required.
Returns substring buffer character range in the parent buffer.
PackedVector2Array
_shaped_text_get_selection ( shaped: RID
, start: int
, end: int
) virtual1 const2
Optional.
Returns selection rectangles for the specified character range.
Vector2
_shaped_text_get_size ( shaped: RID
) virtual1 const2
Required.
Returns size of the text.
int
_shaped_text_get_spacing ( shaped: RID
, spacing: SpacingType ) virtual1 const2
Optional.
Returns extra spacing added between glyphs or lines in pixels.
int
_shaped_text_get_trim_pos ( shaped: RID
) virtual1 const2
Required.
Returns the position of the overrun trim.
float
_shaped_text_get_underline_position ( shaped: RID
) virtual1 const2
Required.
Returns pixel offset of the underline below the baseline.
float
_shaped_text_get_underline_thickness ( shaped: RID
) virtual1 const2
Required.
Returns thickness of the underline.
float
_shaped_text_get_width ( shaped: RID
) virtual1 const2
Required.
Returns width (for horizontal layout) or height (for vertical) of the text.
PackedInt32Array
_shaped_text_get_word_breaks ( shaped: RID
, grapheme_flags: GraphemeFlag, skip_grapheme_flags: GraphemeFlag ) virtual1 const2
Optional.
Breaks text into words and returns array of character ranges. Use grapheme_flags
to set what characters are used for breaking (see GraphemeFlag).
int
_shaped_text_hit_test_grapheme ( shaped: RID
, coord: float
) virtual1 const2
Optional.
Returns grapheme index at the specified pixel offset at the baseline, or -1
if none is found.
int
_shaped_text_hit_test_position ( shaped: RID
, coord: float
) virtual1 const2
Optional.
Returns caret character offset at the specified pixel offset at the baseline. This function always returns a valid position.
bool
_shaped_text_is_ready ( shaped: RID
) virtual1 const2
Required.
Returns true
if buffer is successfully shaped.
int
_shaped_text_next_character_pos ( shaped: RID
, pos: int
) virtual1 const2
Optional.
Returns composite character end position closest to the pos
.
int
_shaped_text_next_grapheme_pos ( shaped: RID
, pos: int
) virtual1 const2
Optional.
Returns grapheme end position closest to the pos
.
void
_shaped_text_overrun_trim_to_width ( shaped: RID
, width: float
, trim_flags: TextOverrunFlag ) virtual1
Optional.
Trims text if it exceeds the given width.
int
_shaped_text_prev_character_pos ( shaped: RID
, pos: int
) virtual1 const2
Optional.
Returns composite character start position closest to the pos
.
int
_shaped_text_prev_grapheme_pos ( shaped: RID
, pos: int
) virtual1 const2
Optional.
Returns grapheme start position closest to the pos
.
bool
_shaped_text_resize_object ( shaped: RID
, key: Variant
, size: Vector2
, inline_align: InlineAlignment, baseline: float
) virtual1
Required.
Sets new size and alignment of embedded object.
void
_shaped_text_set_bidi_override ( shaped: RID
, override: Array
) virtual1
Optional.
Overrides BiDi for the structured text.
void
_shaped_text_set_custom_ellipsis ( shaped: RID
, char: int
) virtual1
Optional.
Sets ellipsis character used for text clipping.
void
_shaped_text_set_custom_punctuation ( shaped: RID
, punct: String
) virtual1
Optional.
Sets custom punctuation character list, used for word breaking. If set to empty string, server defaults are used.
void
_shaped_text_set_direction ( shaped: RID
, direction: Direction ) virtual1
Optional.
Sets 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 ( shaped: RID
, orientation: Orientation ) virtual1
Optional.
Sets desired text orientation.
void
_shaped_text_set_preserve_control ( shaped: RID
, enabled: bool
) virtual1
Optional.
If set to true
text buffer will display control characters.
void
_shaped_text_set_preserve_invalid ( shaped: RID
, enabled: bool
) virtual1
Optional.
If set to true
text buffer will display invalid characters as hexadecimal codes, otherwise nothing is displayed.
void
_shaped_text_set_spacing ( shaped: RID
, spacing: SpacingType, value: int
) virtual1
Optional.
Sets extra spacing added between glyphs or lines in pixels.
bool
_shaped_text_shape ( shaped: RID
) virtual1
Required.
Shapes buffer if it's not shaped. Returns true
if the string is shaped successfully.
const Glyph*
_shaped_text_sort_logical ( shaped: RID
) virtual1
Required.
Returns text glyphs in the logical order.
RID
_shaped_text_substr ( shaped: RID
, start: int
, length: int
) virtual1 const2
Required.
Returns text buffer for the substring of the text in the shaped
text buffer (including inline objects).
float
_shaped_text_tab_align ( shaped: RID
, tab_stops: PackedFloat32Array
) virtual1
Optional.
Aligns shaped text to the given tab-stops.
bool
_shaped_text_update_breaks ( shaped: RID
) virtual1
Optional.
Updates break points in the shaped text. This method is called by default implementation of text breaking functions.
bool
_shaped_text_update_justification_ops ( shaped: RID
) virtual1
Optional.
Updates justification points in the shaped text. This method is called by default implementation of text justification functions.
bool
_spoof_check ( string: String
) virtual1 const2
Optional.
Returns true
if string
is likely to be an attempt at confusing the reader.
PackedInt32Array
_string_get_character_breaks ( string: String
, language: String
) virtual1 const2
Optional.
Returns array of the composite character boundaries.
PackedInt32Array
_string_get_word_breaks ( string: String
, language: String
, chars_per_line: int
) virtual1 const2
Optional.
Returns 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
, language: String
) virtual1 const2
Optional.
Returns the string converted to lowercase.
String
_string_to_title ( string: String
, language: String
) virtual1 const2
Optional.
Returns the string converted to title case.
String
_string_to_upper ( string: String
, language: String
) virtual1 const2
Optional.
Returns the string converted to uppercase.
String
_strip_diacritics ( string: String
) virtual1 const2
Optional.
Strips diacritics from the string.
String
_tag_to_name ( tag: int
) virtual1 const2
Optional.
Converts OpenType tag to readable feature, variation, script, or language name.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。