Skip to main content

ITextServerAdvanced

Trait ITextServerAdvanced 

pub trait ITextServerAdvanced: GodotClass<Base = TextServerAdvanced> + You_forgot_the_attribute__godot_api {
Show 249 methods // Required methods fn has_feature(&self, feature: Feature) -> bool; fn get_name(&self) -> GString; fn get_features(&self) -> i64; fn free_rid(&mut self, rid: Rid); fn has(&mut self, rid: Rid) -> bool; fn create_font(&mut self) -> Rid; fn font_set_fixed_size(&mut self, font_rid: Rid, fixed_size: i64); fn font_get_fixed_size(&self, font_rid: Rid) -> i64; fn font_set_fixed_size_scale_mode( &mut self, font_rid: Rid, fixed_size_scale_mode: FixedSizeScaleMode, ); fn font_get_fixed_size_scale_mode( &self, font_rid: Rid, ) -> FixedSizeScaleMode; fn font_get_size_cache_list(&self, font_rid: Rid) -> Array<Vector2i>; fn font_clear_size_cache(&mut self, font_rid: Rid); fn font_remove_size_cache(&mut self, font_rid: Rid, size: Vector2i); fn font_set_ascent(&mut self, font_rid: Rid, size: i64, ascent: f64); fn font_get_ascent(&self, font_rid: Rid, size: i64) -> f64; fn font_set_descent(&mut self, font_rid: Rid, size: i64, descent: f64); fn font_get_descent(&self, font_rid: Rid, size: i64) -> f64; fn font_set_underline_position( &mut self, font_rid: Rid, size: i64, underline_position: f64, ); fn font_get_underline_position(&self, font_rid: Rid, size: i64) -> f64; fn font_set_underline_thickness( &mut self, font_rid: Rid, size: i64, underline_thickness: f64, ); fn font_get_underline_thickness(&self, font_rid: Rid, size: i64) -> f64; fn font_set_scale(&mut self, font_rid: Rid, size: i64, scale: f64); fn font_get_scale(&self, font_rid: Rid, size: i64) -> f64; fn font_get_texture_count(&self, font_rid: Rid, size: Vector2i) -> i64; fn font_clear_textures(&mut self, font_rid: Rid, size: Vector2i); fn font_remove_texture( &mut self, font_rid: Rid, size: Vector2i, texture_index: i64, ); fn font_set_texture_image( &mut self, font_rid: Rid, size: Vector2i, texture_index: i64, image: Option<Gd<Image>>, ); fn font_get_texture_image( &self, font_rid: Rid, size: Vector2i, texture_index: i64, ) -> Option<Gd<Image>>; fn font_get_glyph_list( &self, font_rid: Rid, size: Vector2i, ) -> PackedArray<i32>; fn font_clear_glyphs(&mut self, font_rid: Rid, size: Vector2i); fn font_remove_glyph(&mut self, font_rid: Rid, size: Vector2i, glyph: i64); fn font_get_glyph_advance( &self, font_rid: Rid, size: i64, glyph: i64, ) -> Vector2; fn font_set_glyph_advance( &mut self, font_rid: Rid, size: i64, glyph: i64, advance: Vector2, ); fn font_get_glyph_offset( &self, font_rid: Rid, size: Vector2i, glyph: i64, ) -> Vector2; fn font_set_glyph_offset( &mut self, font_rid: Rid, size: Vector2i, glyph: i64, offset: Vector2, ); fn font_get_glyph_size( &self, font_rid: Rid, size: Vector2i, glyph: i64, ) -> Vector2; fn font_set_glyph_size( &mut self, font_rid: Rid, size: Vector2i, glyph: i64, gl_size: Vector2, ); fn font_get_glyph_uv_rect( &self, font_rid: Rid, size: Vector2i, glyph: i64, ) -> Rect2; fn font_set_glyph_uv_rect( &mut self, font_rid: Rid, size: Vector2i, glyph: i64, uv_rect: Rect2, ); fn font_get_glyph_texture_idx( &self, font_rid: Rid, size: Vector2i, glyph: i64, ) -> i64; fn font_set_glyph_texture_idx( &mut self, font_rid: Rid, size: Vector2i, glyph: i64, texture_idx: i64, ); fn font_get_glyph_texture_rid( &self, font_rid: Rid, size: Vector2i, glyph: i64, ) -> Rid; fn font_get_glyph_texture_size( &self, font_rid: Rid, size: Vector2i, glyph: i64, ) -> Vector2; fn font_get_glyph_index( &self, font_rid: Rid, size: i64, char: i64, variation_selector: i64, ) -> i64; fn font_get_char_from_glyph_index( &self, font_rid: Rid, size: i64, glyph_index: i64, ) -> i64; fn font_has_char(&self, font_rid: Rid, char: i64) -> bool; fn font_get_supported_chars(&self, font_rid: Rid) -> GString; fn font_get_supported_glyphs(&self, font_rid: Rid) -> PackedArray<i32>; fn font_draw_glyph( &self, font_rid: Rid, canvas: Rid, size: i64, pos: Vector2, index: i64, color: Color, oversampling: f32, ); fn font_draw_glyph_outline( &self, font_rid: Rid, canvas: Rid, size: i64, outline_size: i64, pos: Vector2, index: i64, color: Color, oversampling: f32, ); fn create_shaped_text( &mut self, direction: Direction, orientation: Orientation, ) -> Rid; fn shaped_text_clear(&mut self, shaped: Rid); fn shaped_text_duplicate(&mut self, shaped: Rid) -> Rid; fn shaped_text_add_string( &mut self, shaped: Rid, text: GString, fonts: Array<Rid>, size: i64, opentype_features: Dictionary<Variant, Variant>, language: GString, meta: Variant, ) -> bool; fn shaped_text_add_object( &mut self, shaped: Rid, key: Variant, size: Vector2, inline_align: InlineAlignment, length: i64, baseline: f64, ) -> bool; fn shaped_text_resize_object( &mut self, shaped: Rid, key: Variant, size: Vector2, inline_align: InlineAlignment, baseline: f64, ) -> bool; fn shaped_text_has_object(&self, shaped: Rid, key: Variant) -> bool; fn shaped_get_text(&self, shaped: Rid) -> GString; fn shaped_get_span_count(&self, shaped: Rid) -> i64; fn shaped_get_span_meta(&self, shaped: Rid, index: i64) -> Variant; fn shaped_get_span_embedded_object( &self, shaped: Rid, index: i64, ) -> Variant; fn shaped_get_span_text(&self, shaped: Rid, index: i64) -> GString; fn shaped_get_span_object(&self, shaped: Rid, index: i64) -> Variant; fn shaped_set_span_update_font( &mut self, shaped: Rid, index: i64, fonts: Array<Rid>, size: i64, opentype_features: Dictionary<Variant, Variant>, ); fn shaped_text_substr(&self, shaped: Rid, start: i64, length: i64) -> Rid; fn shaped_text_get_parent(&self, shaped: Rid) -> Rid; fn shaped_text_shape(&mut self, shaped: Rid) -> bool; fn shaped_text_is_ready(&self, shaped: Rid) -> bool; unsafe fn shaped_text_get_glyphs_rawptr( &self, shaped: Rid, ) -> RawPtr<*const Glyph>; unsafe fn shaped_text_sort_logical_rawptr( &mut self, shaped: Rid, ) -> RawPtr<*const Glyph>; fn shaped_text_get_glyph_count(&self, shaped: Rid) -> i64; fn shaped_text_get_range(&self, shaped: Rid) -> Vector2i; fn shaped_text_get_trim_pos(&self, shaped: Rid) -> i64; fn shaped_text_get_ellipsis_pos(&self, shaped: Rid) -> i64; fn shaped_text_get_ellipsis_glyph_count(&self, shaped: Rid) -> i64; unsafe fn shaped_text_get_ellipsis_glyphs_rawptr( &self, shaped: Rid, ) -> RawPtr<*const Glyph>; fn shaped_text_get_objects(&self, shaped: Rid) -> AnyArray; fn shaped_text_get_object_rect(&self, shaped: Rid, key: Variant) -> Rect2; fn shaped_text_get_object_range( &self, shaped: Rid, key: Variant, ) -> Vector2i; fn shaped_text_get_object_glyph(&self, shaped: Rid, key: Variant) -> i64; fn shaped_text_get_size(&self, shaped: Rid) -> Vector2; fn shaped_text_get_ascent(&self, shaped: Rid) -> f64; fn shaped_text_get_descent(&self, shaped: Rid) -> f64; fn shaped_text_get_width(&self, shaped: Rid) -> f64; fn shaped_text_get_underline_position(&self, shaped: Rid) -> f64; fn shaped_text_get_underline_thickness(&self, shaped: Rid) -> f64; // Provided methods fn init(base: Base<Self::Base>) -> Self { ... } fn on_notification(&mut self, what: ObjectNotification) { ... } fn on_get(&self, property: StringName) -> Option<Variant> { ... } fn on_set(&mut self, property: StringName, value: Variant) -> bool { ... } fn on_validate_property(&self, property: &mut PropertyInfo) { ... } fn on_get_property_list(&mut self) -> Vec<PropertyInfo> { ... } fn on_property_get_revert(&self, property: StringName) -> Option<Variant> { ... } fn to_string(&self) -> GString { ... } fn load_support_data(&mut self, filename: GString) -> bool { ... } fn get_support_data_filename(&self) -> GString { ... } fn get_support_data_info(&self) -> GString { ... } fn save_support_data(&self, filename: GString) -> bool { ... } fn get_support_data(&self) -> PackedArray<u8> { ... } fn is_locale_using_support_data(&self, locale: GString) -> bool { ... } fn is_locale_right_to_left(&self, locale: GString) -> bool { ... } fn name_to_tag(&self, name: GString) -> i64 { ... } fn tag_to_name(&self, tag: i64) -> GString { ... } fn create_font_linked_variation(&mut self, font_rid: Rid) -> Rid { ... } fn font_set_data(&mut self, font_rid: Rid, data: PackedArray<u8>) { ... } unsafe fn font_set_data_ptr_rawptr( &mut self, font_rid: Rid, data_ptr: RawPtr<*const u8>, data_size: i64, ) { ... } fn font_set_face_index(&mut self, font_rid: Rid, face_index: i64) { ... } fn font_get_face_index(&self, font_rid: Rid) -> i64 { ... } fn font_get_face_count(&self, font_rid: Rid) -> i64 { ... } fn font_set_style(&mut self, font_rid: Rid, style: FontStyle) { ... } fn font_get_style(&self, font_rid: Rid) -> FontStyle { ... } fn font_set_name(&mut self, font_rid: Rid, name: GString) { ... } fn font_get_name(&self, font_rid: Rid) -> GString { ... } fn font_get_ot_name_strings(&self, font_rid: Rid) -> AnyDictionary { ... } fn font_set_style_name(&mut self, font_rid: Rid, name_style: GString) { ... } fn font_get_style_name(&self, font_rid: Rid) -> GString { ... } fn font_set_weight(&mut self, font_rid: Rid, weight: i64) { ... } fn font_get_weight(&self, font_rid: Rid) -> i64 { ... } fn font_set_stretch(&mut self, font_rid: Rid, stretch: i64) { ... } fn font_get_stretch(&self, font_rid: Rid) -> i64 { ... } fn font_set_antialiasing( &mut self, font_rid: Rid, antialiasing: FontAntialiasing, ) { ... } fn font_get_antialiasing(&self, font_rid: Rid) -> FontAntialiasing { ... } fn font_set_disable_embedded_bitmaps( &mut self, font_rid: Rid, disable_embedded_bitmaps: bool, ) { ... } fn font_get_disable_embedded_bitmaps(&self, font_rid: Rid) -> bool { ... } fn font_set_generate_mipmaps( &mut self, font_rid: Rid, generate_mipmaps: bool, ) { ... } fn font_get_generate_mipmaps(&self, font_rid: Rid) -> bool { ... } fn font_set_multichannel_signed_distance_field( &mut self, font_rid: Rid, msdf: bool, ) { ... } fn font_is_multichannel_signed_distance_field(&self, font_rid: Rid) -> bool { ... } fn font_set_msdf_pixel_range( &mut self, font_rid: Rid, msdf_pixel_range: i64, ) { ... } fn font_get_msdf_pixel_range(&self, font_rid: Rid) -> i64 { ... } fn font_set_msdf_size(&mut self, font_rid: Rid, msdf_size: i64) { ... } fn font_get_msdf_size(&self, font_rid: Rid) -> i64 { ... } fn font_set_allow_system_fallback( &mut self, font_rid: Rid, allow_system_fallback: bool, ) { ... } fn font_is_allow_system_fallback(&self, font_rid: Rid) -> bool { ... } fn font_clear_system_fallback_cache(&mut self) { ... } fn font_set_force_autohinter( &mut self, font_rid: Rid, force_autohinter: bool, ) { ... } fn font_is_force_autohinter(&self, font_rid: Rid) -> bool { ... } fn font_set_modulate_color_glyphs(&mut self, font_rid: Rid, modulate: bool) { ... } fn font_is_modulate_color_glyphs(&self, font_rid: Rid) -> bool { ... } fn font_set_hinting(&mut self, font_rid: Rid, hinting: Hinting) { ... } fn font_get_hinting(&self, font_rid: Rid) -> Hinting { ... } fn font_set_subpixel_positioning( &mut self, font_rid: Rid, subpixel_positioning: SubpixelPositioning, ) { ... } fn font_get_subpixel_positioning( &self, font_rid: Rid, ) -> SubpixelPositioning { ... } fn font_set_keep_rounding_remainders( &mut self, font_rid: Rid, keep_rounding_remainders: bool, ) { ... } fn font_get_keep_rounding_remainders(&self, font_rid: Rid) -> bool { ... } fn font_set_embolden(&mut self, font_rid: Rid, strength: f64) { ... } fn font_get_embolden(&self, font_rid: Rid) -> f64 { ... } fn font_set_spacing( &mut self, font_rid: Rid, spacing: SpacingType, value: i64, ) { ... } fn font_get_spacing(&self, font_rid: Rid, spacing: SpacingType) -> i64 { ... } fn font_set_baseline_offset(&mut self, font_rid: Rid, baseline_offset: f64) { ... } fn font_get_baseline_offset(&self, font_rid: Rid) -> f64 { ... } fn font_set_transform(&mut self, font_rid: Rid, transform: Transform2D) { ... } fn font_get_transform(&self, font_rid: Rid) -> Transform2D { ... } fn font_set_variation_coordinates( &mut self, font_rid: Rid, variation_coordinates: Dictionary<Variant, Variant>, ) { ... } fn font_get_variation_coordinates(&self, font_rid: Rid) -> AnyDictionary { ... } fn font_set_oversampling(&mut self, font_rid: Rid, oversampling: f64) { ... } fn font_get_oversampling(&self, font_rid: Rid) -> f64 { ... } fn font_get_size_cache_info(&self, font_rid: Rid) -> Array<AnyDictionary> { ... } fn font_set_texture_offsets( &mut self, font_rid: Rid, size: Vector2i, texture_index: i64, offset: PackedArray<i32>, ) { ... } fn font_get_texture_offsets( &self, font_rid: Rid, size: Vector2i, texture_index: i64, ) -> PackedArray<i32> { ... } fn font_get_glyph_contours( &self, font_rid: Rid, size: i64, index: i64, ) -> AnyDictionary { ... } fn font_get_kerning_list(&self, font_rid: Rid, size: i64) -> Array<Vector2i> { ... } fn font_clear_kerning_map(&mut self, font_rid: Rid, size: i64) { ... } fn font_remove_kerning( &mut self, font_rid: Rid, size: i64, glyph_pair: Vector2i, ) { ... } fn font_set_kerning( &mut self, font_rid: Rid, size: i64, glyph_pair: Vector2i, kerning: Vector2, ) { ... } fn font_get_kerning( &self, font_rid: Rid, size: i64, glyph_pair: Vector2i, ) -> Vector2 { ... } fn font_render_range( &mut self, font_rid: Rid, size: Vector2i, start: i64, end: i64, ) { ... } fn font_render_glyph(&mut self, font_rid: Rid, size: Vector2i, index: i64) { ... } fn font_is_language_supported( &self, font_rid: Rid, language: GString, ) -> bool { ... } fn font_set_language_support_override( &mut self, font_rid: Rid, language: GString, supported: bool, ) { ... } fn font_get_language_support_override( &mut self, font_rid: Rid, language: GString, ) -> bool { ... } fn font_remove_language_support_override( &mut self, font_rid: Rid, language: GString, ) { ... } fn font_get_language_support_overrides( &mut self, font_rid: Rid, ) -> PackedArray<GString> { ... } fn font_is_script_supported(&self, font_rid: Rid, script: GString) -> bool { ... } fn font_set_script_support_override( &mut self, font_rid: Rid, script: GString, supported: bool, ) { ... } fn font_get_script_support_override( &mut self, font_rid: Rid, script: GString, ) -> bool { ... } fn font_remove_script_support_override( &mut self, font_rid: Rid, script: GString, ) { ... } fn font_get_script_support_overrides( &mut self, font_rid: Rid, ) -> PackedArray<GString> { ... } fn font_set_opentype_feature_overrides( &mut self, font_rid: Rid, overrides: Dictionary<Variant, Variant>, ) { ... } fn font_get_opentype_feature_overrides( &self, font_rid: Rid, ) -> AnyDictionary { ... } fn font_supported_feature_list(&self, font_rid: Rid) -> AnyDictionary { ... } fn font_supported_variation_list(&self, font_rid: Rid) -> AnyDictionary { ... } fn font_get_global_oversampling(&self) -> f64 { ... } fn font_set_global_oversampling(&mut self, oversampling: f64) { ... } fn reference_oversampling_level(&mut self, oversampling: f64) { ... } fn unreference_oversampling_level(&mut self, oversampling: f64) { ... } fn get_hex_code_box_size(&self, size: i64, index: i64) -> Vector2 { ... } fn draw_hex_code_box( &self, canvas: Rid, size: i64, pos: Vector2, index: i64, color: Color, ) { ... } fn shaped_text_set_direction(&mut self, shaped: Rid, direction: Direction) { ... } fn shaped_text_get_direction(&self, shaped: Rid) -> Direction { ... } fn shaped_text_get_inferred_direction(&self, shaped: Rid) -> Direction { ... } fn shaped_text_set_bidi_override( &mut self, shaped: Rid, override_: Array<Variant>, ) { ... } fn shaped_text_set_custom_punctuation( &mut self, shaped: Rid, punct: GString, ) { ... } fn shaped_text_get_custom_punctuation(&self, shaped: Rid) -> GString { ... } fn shaped_text_set_custom_ellipsis(&mut self, shaped: Rid, char: i64) { ... } fn shaped_text_get_custom_ellipsis(&self, shaped: Rid) -> i64 { ... } fn shaped_text_set_orientation( &mut self, shaped: Rid, orientation: Orientation, ) { ... } fn shaped_text_get_orientation(&self, shaped: Rid) -> Orientation { ... } fn shaped_text_set_preserve_invalid(&mut self, shaped: Rid, enabled: bool) { ... } fn shaped_text_get_preserve_invalid(&self, shaped: Rid) -> bool { ... } fn shaped_text_set_preserve_control(&mut self, shaped: Rid, enabled: bool) { ... } fn shaped_text_get_preserve_control(&self, shaped: Rid) -> bool { ... } fn shaped_text_set_spacing( &mut self, shaped: Rid, spacing: SpacingType, value: i64, ) { ... } fn shaped_text_get_spacing(&self, shaped: Rid, spacing: SpacingType) -> i64 { ... } fn shaped_get_run_count(&self, shaped: Rid) -> i64 { ... } fn shaped_get_run_text(&self, shaped: Rid, index: i64) -> GString { ... } fn shaped_get_run_range(&self, shaped: Rid, index: i64) -> Vector2i { ... } fn shaped_get_run_font_rid(&self, shaped: Rid, index: i64) -> Rid { ... } fn shaped_get_run_font_size(&self, shaped: Rid, index: i64) -> i32 { ... } fn shaped_get_run_language(&self, shaped: Rid, index: i64) -> GString { ... } fn shaped_get_run_direction(&self, shaped: Rid, index: i64) -> Direction { ... } fn shaped_get_run_object(&self, shaped: Rid, index: i64) -> Variant { ... } fn shaped_text_fit_to_width( &mut self, shaped: Rid, width: f64, justification_flags: JustificationFlag, ) -> f64 { ... } fn shaped_text_tab_align( &mut self, shaped: Rid, tab_stops: PackedArray<f32>, ) -> f64 { ... } fn shaped_text_update_breaks(&mut self, shaped: Rid) -> bool { ... } fn shaped_text_update_justification_ops(&mut self, shaped: Rid) -> bool { ... } fn shaped_text_get_line_breaks_adv( &self, shaped: Rid, width: PackedArray<f32>, start: i64, once: bool, break_flags: LineBreakFlag, ) -> PackedArray<i32> { ... } fn shaped_text_get_line_breaks( &self, shaped: Rid, width: f64, start: i64, break_flags: LineBreakFlag, ) -> PackedArray<i32> { ... } fn shaped_text_get_word_breaks( &self, shaped: Rid, grapheme_flags: GraphemeFlag, skip_grapheme_flags: GraphemeFlag, ) -> PackedArray<i32> { ... } fn shaped_text_overrun_trim_to_width( &mut self, shaped: Rid, width: f64, trim_flags: TextOverrunFlag, ) { ... } fn shaped_text_get_dominant_direction_in_range( &self, shaped: Rid, start: i64, end: i64, ) -> i64 { ... } unsafe fn shaped_text_get_carets_rawptr( &self, shaped: Rid, position: i64, caret: RawPtr<*mut CaretInfo>, ) { ... } fn shaped_text_get_selection( &self, shaped: Rid, start: i64, end: i64, ) -> PackedArray<Vector2> { ... } fn shaped_text_hit_test_grapheme(&self, shaped: Rid, coord: f64) -> i64 { ... } fn shaped_text_hit_test_position(&self, shaped: Rid, coord: f64) -> i64 { ... } fn shaped_text_draw( &self, shaped: Rid, canvas: Rid, pos: Vector2, clip_l: f64, clip_r: f64, color: Color, oversampling: f32, ) { ... } fn shaped_text_draw_outline( &self, shaped: Rid, canvas: Rid, pos: Vector2, clip_l: f64, clip_r: f64, outline_size: i64, color: Color, oversampling: f32, ) { ... } fn shaped_text_get_grapheme_bounds(&self, shaped: Rid, pos: i64) -> Vector2 { ... } fn shaped_text_next_grapheme_pos(&self, shaped: Rid, pos: i64) -> i64 { ... } fn shaped_text_prev_grapheme_pos(&self, shaped: Rid, pos: i64) -> i64 { ... } fn shaped_text_get_character_breaks(&self, shaped: Rid) -> PackedArray<i32> { ... } fn shaped_text_next_character_pos(&self, shaped: Rid, pos: i64) -> i64 { ... } fn shaped_text_prev_character_pos(&self, shaped: Rid, pos: i64) -> i64 { ... } fn shaped_text_closest_character_pos(&self, shaped: Rid, pos: i64) -> i64 { ... } fn format_number(&self, number: GString, language: GString) -> GString { ... } fn parse_number(&self, number: GString, language: GString) -> GString { ... } fn percent_sign(&self, language: GString) -> GString { ... } fn strip_diacritics(&self, string: GString) -> GString { ... } fn is_valid_identifier(&self, string: GString) -> bool { ... } fn is_valid_letter(&self, unicode: u64) -> bool { ... } fn string_get_word_breaks( &self, string: GString, language: GString, chars_per_line: i64, ) -> PackedArray<i32> { ... } fn string_get_character_breaks( &self, string: GString, language: GString, ) -> PackedArray<i32> { ... } fn is_confusable(&self, string: GString, dict: PackedArray<GString>) -> i64 { ... } fn spoof_check(&self, string: GString) -> bool { ... } fn string_to_upper(&self, string: GString, language: GString) -> GString { ... } fn string_to_lower(&self, string: GString, language: GString) -> GString { ... } fn string_to_title(&self, string: GString, language: GString) -> GString { ... } fn parse_structured_text( &self, parser_type: StructuredTextParser, args: Array<Variant>, text: GString, ) -> Array<Vector3i> { ... } fn cleanup(&mut self) { ... }
}
Expand description

§Interface trait for class TextServerAdvanced.

Functions in this trait represent constructors (init) or virtual method callbacks invoked by the engine.

Base interfaces: ITextServerExtension > ITextServer > IRefCounted > IObject.
(Strike-through means some intermediate Godot classes are marked final, and can thus not be inherited by GDExtension.)

See also Godot docs for TextServerAdvanced methods.

Required Methods§

fn has_feature(&self, feature: Feature) -> bool

Returns true if the server supports a feature.

fn get_name(&self) -> GString

Returns the name of the server interface.

fn get_features(&self) -> i64

Returns text server features, see [enum TextServer.Feature].

fn free_rid(&mut self, rid: Rid)

Frees an object created by this TextServer.

fn has(&mut self, rid: Rid) -> bool

Returns true if rid is valid resource owned by this text server.

fn create_font(&mut self) -> Rid

Creates a new, empty font cache entry resource.

fn font_set_fixed_size(&mut self, font_rid: Rid, fixed_size: i64)

Sets bitmap font fixed size. If set to value greater than zero, same cache entry will be used for all font sizes.

fn font_get_fixed_size(&self, font_rid: Rid) -> i64

Returns bitmap font fixed size.

fn font_set_fixed_size_scale_mode( &mut self, font_rid: Rid, fixed_size_scale_mode: FixedSizeScaleMode, )

Sets bitmap font scaling mode. This property is used only if fixed_size is greater than zero.

fn font_get_fixed_size_scale_mode(&self, font_rid: Rid) -> FixedSizeScaleMode

Returns bitmap font scaling mode.

fn font_get_size_cache_list(&self, font_rid: Rid) -> Array<Vector2i>

Returns list of the font sizes in the cache. Each size is Vector2i with font size and outline size.

fn font_clear_size_cache(&mut self, font_rid: Rid)

Removes all font sizes from the cache entry.

fn font_remove_size_cache(&mut self, font_rid: Rid, size: Vector2i)

Removes specified font size from the cache entry.

fn font_set_ascent(&mut self, font_rid: Rid, size: i64, ascent: f64)

Sets the font ascent (number of pixels above the baseline).

fn font_get_ascent(&self, font_rid: Rid, size: i64) -> f64

Returns the font ascent (number of pixels above the baseline).

fn font_set_descent(&mut self, font_rid: Rid, size: i64, descent: f64)

Sets the font descent (number of pixels below the baseline).

fn font_get_descent(&self, font_rid: Rid, size: i64) -> f64

Returns the font descent (number of pixels below the baseline).

fn font_set_underline_position( &mut self, font_rid: Rid, size: i64, underline_position: f64, )

Sets pixel offset of the underline below the baseline.

fn font_get_underline_position(&self, font_rid: Rid, size: i64) -> f64

Returns pixel offset of the underline below the baseline.

fn font_set_underline_thickness( &mut self, font_rid: Rid, size: i64, underline_thickness: f64, )

Sets thickness of the underline in pixels.

fn font_get_underline_thickness(&self, font_rid: Rid, size: i64) -> f64

Returns thickness of the underline in pixels.

fn font_set_scale(&mut self, font_rid: Rid, size: i64, scale: f64)

Sets scaling factor of the color bitmap font.

fn font_get_scale(&self, font_rid: Rid, size: i64) -> f64

Returns scaling factor of the color bitmap font.

fn font_get_texture_count(&self, font_rid: Rid, size: Vector2i) -> i64

Returns number of textures used by font cache entry.

fn font_clear_textures(&mut self, font_rid: Rid, size: Vector2i)

Removes all textures from font cache entry.

fn font_remove_texture( &mut self, font_rid: Rid, size: Vector2i, texture_index: i64, )

Removes specified texture from the cache entry.

fn font_set_texture_image( &mut self, font_rid: Rid, size: Vector2i, texture_index: i64, image: Option<Gd<Image>>, )

Sets font cache texture image data.

fn font_get_texture_image( &self, font_rid: Rid, size: Vector2i, texture_index: i64, ) -> Option<Gd<Image>>

Returns font cache texture image data.

fn font_get_glyph_list(&self, font_rid: Rid, size: Vector2i) -> PackedArray<i32>

Returns list of rendered glyphs in the cache entry.

fn font_clear_glyphs(&mut self, font_rid: Rid, size: Vector2i)

Removes all rendered glyph information from the cache entry.

fn font_remove_glyph(&mut self, font_rid: Rid, size: Vector2i, glyph: i64)

Removes specified rendered glyph information from the cache entry.

fn font_get_glyph_advance( &self, font_rid: Rid, size: i64, glyph: i64, ) -> Vector2

Returns glyph advance (offset of the next glyph).

fn font_set_glyph_advance( &mut self, font_rid: Rid, size: i64, glyph: i64, advance: Vector2, )

Sets glyph advance (offset of the next glyph).

fn font_get_glyph_offset( &self, font_rid: Rid, size: Vector2i, glyph: i64, ) -> Vector2

Returns glyph offset from the baseline.

fn font_set_glyph_offset( &mut self, font_rid: Rid, size: Vector2i, glyph: i64, offset: Vector2, )

Sets glyph offset from the baseline.

fn font_get_glyph_size( &self, font_rid: Rid, size: Vector2i, glyph: i64, ) -> Vector2

Returns size of the glyph.

fn font_set_glyph_size( &mut self, font_rid: Rid, size: Vector2i, glyph: i64, gl_size: Vector2, )

Sets size of the glyph.

fn font_get_glyph_uv_rect( &self, font_rid: Rid, size: Vector2i, glyph: i64, ) -> Rect2

Returns rectangle in the cache texture containing the glyph.

fn font_set_glyph_uv_rect( &mut self, font_rid: Rid, size: Vector2i, glyph: i64, uv_rect: Rect2, )

Sets rectangle in the cache texture containing the glyph.

fn font_get_glyph_texture_idx( &self, font_rid: Rid, size: Vector2i, glyph: i64, ) -> i64

Returns index of the cache texture containing the glyph.

fn font_set_glyph_texture_idx( &mut self, font_rid: Rid, size: Vector2i, glyph: i64, texture_idx: i64, )

Sets index of the cache texture containing the glyph.

fn font_get_glyph_texture_rid( &self, font_rid: Rid, size: Vector2i, glyph: i64, ) -> Rid

Returns resource ID of the cache texture containing the glyph.

fn font_get_glyph_texture_size( &self, font_rid: Rid, size: Vector2i, glyph: i64, ) -> Vector2

Returns size of the cache texture containing the glyph.

fn font_get_glyph_index( &self, font_rid: Rid, size: i64, char: i64, variation_selector: i64, ) -> i64

Returns the glyph index of a char, optionally modified by the variation_selector.

fn font_get_char_from_glyph_index( &self, font_rid: Rid, size: i64, glyph_index: i64, ) -> i64

Returns character code associated with glyph_index, or 0 if glyph_index is invalid.

fn font_has_char(&self, font_rid: Rid, char: i64) -> bool

Returns true if a Unicode char is available in the font.

fn font_get_supported_chars(&self, font_rid: Rid) -> GString

Returns a string containing all the characters available in the font.

fn font_get_supported_glyphs(&self, font_rid: Rid) -> PackedArray<i32>

Returns an array containing all glyph indices in the font.

fn font_draw_glyph( &self, font_rid: Rid, canvas: Rid, size: i64, pos: Vector2, index: i64, color: Color, oversampling: f32, )

Draws 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.

fn font_draw_glyph_outline( &self, font_rid: Rid, canvas: Rid, size: i64, outline_size: i64, pos: Vector2, index: i64, color: Color, oversampling: f32, )

Draws 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.

fn create_shaped_text( &mut self, direction: Direction, orientation: Orientation, ) -> Rid

Creates a new buffer for complex text layout, with the given direction and orientation.

fn shaped_text_clear(&mut self, shaped: Rid)

Clears text buffer (removes text and inline objects).

fn shaped_text_duplicate(&mut self, shaped: Rid) -> Rid

Duplicates shaped text buffer.

fn shaped_text_add_string( &mut self, shaped: Rid, text: GString, fonts: Array<Rid>, size: i64, opentype_features: Dictionary<Variant, Variant>, language: GString, meta: Variant, ) -> bool

Adds text span and font to draw it to the text buffer.

fn shaped_text_add_object( &mut self, shaped: Rid, key: Variant, size: Vector2, inline_align: InlineAlignment, length: i64, baseline: f64, ) -> bool

Adds inline object to the text buffer, key must be unique. In the text, object is represented as length object replacement characters.

fn shaped_text_resize_object( &mut self, shaped: Rid, key: Variant, size: Vector2, inline_align: InlineAlignment, baseline: f64, ) -> bool

Sets new size and alignment of embedded object.

fn shaped_text_has_object(&self, shaped: Rid, key: Variant) -> bool

Returns true if an object with key is embedded in this shaped text buffer.

fn shaped_get_text(&self, shaped: Rid) -> GString

Returns the text buffer source text, including object replacement characters.

fn shaped_get_span_count(&self, shaped: Rid) -> i64

Returns number of text spans added using shaped_text_add_string or shaped_text_add_object.

fn shaped_get_span_meta(&self, shaped: Rid, index: i64) -> Variant

Returns text span metadata.

fn shaped_get_span_embedded_object(&self, shaped: Rid, index: i64) -> Variant

Returns text embedded object key.

fn shaped_get_span_text(&self, shaped: Rid, index: i64) -> GString

Returns the text span source text.

fn shaped_get_span_object(&self, shaped: Rid, index: i64) -> Variant

Returns the text span embedded object key.

fn shaped_set_span_update_font( &mut self, shaped: Rid, index: i64, fonts: Array<Rid>, size: i64, opentype_features: Dictionary<Variant, Variant>, )

Changes text span font, font size, and OpenType features, without changing the text.

fn shaped_text_substr(&self, shaped: Rid, start: i64, length: i64) -> Rid

Returns text buffer for the substring of the text in the shaped text buffer (including inline objects).

fn shaped_text_get_parent(&self, shaped: Rid) -> Rid

Returns the parent buffer from which the substring originates.

fn shaped_text_shape(&mut self, shaped: Rid) -> bool

Shapes buffer if it’s not shaped. Returns true if the string is shaped successfully.

fn shaped_text_is_ready(&self, shaped: Rid) -> bool

Returns true if buffer is successfully shaped.

unsafe fn shaped_text_get_glyphs_rawptr( &self, shaped: Rid, ) -> RawPtr<*const Glyph>

§Godot docs

Returns an array of glyphs in the visual order.

§Safety

This method has automatically been marked unsafe because it accepts raw pointers as parameters. If Godot does not document any safety requirements, make sure you understand the underlying semantics.

unsafe fn shaped_text_sort_logical_rawptr( &mut self, shaped: Rid, ) -> RawPtr<*const Glyph>

§Godot docs

Returns text glyphs in the logical order.

§Safety

This method has automatically been marked unsafe because it accepts raw pointers as parameters. If Godot does not document any safety requirements, make sure you understand the underlying semantics.

fn shaped_text_get_glyph_count(&self, shaped: Rid) -> i64

Returns number of glyphs in the buffer.

fn shaped_text_get_range(&self, shaped: Rid) -> Vector2i

Returns substring buffer character range in the parent buffer.

fn shaped_text_get_trim_pos(&self, shaped: Rid) -> i64

Returns the position of the overrun trim.

fn shaped_text_get_ellipsis_pos(&self, shaped: Rid) -> i64

Returns position of the ellipsis.

fn shaped_text_get_ellipsis_glyph_count(&self, shaped: Rid) -> i64

Returns number of glyphs in the ellipsis.

unsafe fn shaped_text_get_ellipsis_glyphs_rawptr( &self, shaped: Rid, ) -> RawPtr<*const Glyph>

§Godot docs

Returns array of the glyphs in the ellipsis.

§Safety

This method has automatically been marked unsafe because it accepts raw pointers as parameters. If Godot does not document any safety requirements, make sure you understand the underlying semantics.

fn shaped_text_get_objects(&self, shaped: Rid) -> AnyArray

Returns array of inline objects.

fn shaped_text_get_object_rect(&self, shaped: Rid, key: Variant) -> Rect2

Returns bounding rectangle of the inline object.

fn shaped_text_get_object_range(&self, shaped: Rid, key: Variant) -> Vector2i

Returns the character range of the inline object.

fn shaped_text_get_object_glyph(&self, shaped: Rid, key: Variant) -> i64

Returns the glyph index of the inline object.

fn shaped_text_get_size(&self, shaped: Rid) -> Vector2

Returns size of the text.

fn shaped_text_get_ascent(&self, shaped: Rid) -> f64

Returns the text ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical).

fn shaped_text_get_descent(&self, shaped: Rid) -> f64

Returns the text descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical).

fn shaped_text_get_width(&self, shaped: Rid) -> f64

Returns width (for horizontal layout) or height (for vertical) of the text.

fn shaped_text_get_underline_position(&self, shaped: Rid) -> f64

Returns pixel offset of the underline below the baseline.

fn shaped_text_get_underline_thickness(&self, shaped: Rid) -> f64

Returns thickness of the underline.

Provided Methods§

fn init(base: Base<Self::Base>) -> Self

Godot constructor, accepting an injected base object.

base refers to the base instance of the class, which can either be stored in a Base<T> field or discarded. This method returns a fully-constructed instance, which will then be moved into a Gd<T> pointer.

If the class has a #[class(init)] attribute, this method will be auto-generated and must not be overridden.

fn on_notification(&mut self, what: ObjectNotification)

Called when the object receives a Godot notification.

The type of notification can be identified through what. The enum is designed to hold all possible NOTIFICATION_* constants that the current class can handle. However, this is not validated in Godot, so an enum variant Unknown exists to represent integers out of known constants (mistakes or future additions).

This method is named _notification in Godot, but on_notification in Rust. To send notifications, use the Object::notify method.

See also in Godot docs:

fn on_get(&self, property: StringName) -> Option<Variant>

Called whenever get() is called or Godot gets the value of a property.

Should return the given property’s value as Some(value), or None if the property should be handled normally.

See also in Godot docs:

fn on_set(&mut self, property: StringName, value: Variant) -> bool

Called whenever Godot set() is called or Godot sets the value of a property.

Should set property to the given value and return true, or return false to indicate the property should be handled normally.

See also in Godot docs:

fn on_validate_property(&self, property: &mut PropertyInfo)

Called whenever Godot retrieves value of property. Allows to customize existing properties. Every property info goes through this method, except properties added with on_get_property_list().

Exposed property here is a shared mutable reference obtained (and returned to) from Godot.

See also in the Godot docs:

fn on_get_property_list(&mut self) -> Vec<PropertyInfo>

Available on since_api=4.3 only.

Called whenever Godot get_property_list() is called, the returned vector here is appended to the existing list of properties.

This should mainly be used for advanced purposes, such as dynamically updating the property list in the editor.

See also in Godot docs:

fn on_property_get_revert(&self, property: StringName) -> Option<Variant>

Called by Godot to tell if a property has a custom revert or not.

Return None for no custom revert, and return Some(value) to specify the custom revert.

This is a combination of Godot’s Object::_property_get_revert and Object::_property_can_revert. This means that this function will usually be called twice by Godot to find the revert.

Note that this should be a pure function. That is, it should always return the same value for a property as long as self remains unchanged. Otherwise, this may lead to unexpected (safe) behavior.

fn to_string(&self) -> GString

String representation of the Godot instance.

Override this method to define how the instance is represented as a string. Used by impl Display for Gd<T>, as well as str() and print() in GDScript.

fn load_support_data(&mut self, filename: GString) -> bool

Loads optional TextServer database (e.g. ICU break iterators and dictionaries).

fn get_support_data_filename(&self) -> GString

Returns default TextServer database (e.g. ICU break iterators and dictionaries) filename.

fn get_support_data_info(&self) -> GString

Returns TextServer database (e.g. ICU break iterators and dictionaries) description.

fn save_support_data(&self, filename: GString) -> bool

Saves optional TextServer database (e.g. ICU break iterators and dictionaries) to the file.

fn get_support_data(&self) -> PackedArray<u8>

Returns default TextServer database (e.g. ICU break iterators and dictionaries).

fn is_locale_using_support_data(&self, locale: GString) -> bool

Returns true if the locale requires text server support data for line/word breaking.

fn is_locale_right_to_left(&self, locale: GString) -> bool

Returns true if locale is right-to-left.

fn name_to_tag(&self, name: GString) -> i64

Converts the given readable name of a feature, variation, script, or language to an OpenType tag.

fn tag_to_name(&self, tag: i64) -> GString

Converts the given OpenType tag to the readable name of a feature, variation, script, or language.

fn create_font_linked_variation(&mut self, font_rid: Rid) -> Rid

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.

fn font_set_data(&mut self, font_rid: Rid, data: PackedArray<u8>)

Sets font source data, e.g contents of the dynamic font source file.

unsafe fn font_set_data_ptr_rawptr( &mut self, font_rid: Rid, data_ptr: RawPtr<*const u8>, data_size: i64, )

§Godot docs

Sets pointer to the font source data, e.g contents of the dynamic font source file.

§Safety

This method has automatically been marked unsafe because it accepts raw pointers as parameters. If Godot does not document any safety requirements, make sure you understand the underlying semantics.

fn font_set_face_index(&mut self, font_rid: Rid, face_index: i64)

Sets an active face index in the TrueType / OpenType collection.

fn font_get_face_index(&self, font_rid: Rid) -> i64

Returns an active face index in the TrueType / OpenType collection.

fn font_get_face_count(&self, font_rid: Rid) -> i64

Returns number of faces in the TrueType / OpenType collection.

fn font_set_style(&mut self, font_rid: Rid, style: FontStyle)

Sets the font style flags.

fn font_get_style(&self, font_rid: Rid) -> FontStyle

Returns font style flags.

fn font_set_name(&mut self, font_rid: Rid, name: GString)

Sets the font family name.

fn font_get_name(&self, font_rid: Rid) -> GString

Returns font family name.

fn font_get_ot_name_strings(&self, font_rid: Rid) -> AnyDictionary

Returns Dictionary with OpenType font name strings (localized font names, version, description, license information, sample text, etc.).

fn font_set_style_name(&mut self, font_rid: Rid, name_style: GString)

Sets the font style name.

fn font_get_style_name(&self, font_rid: Rid) -> GString

Returns font style name.

fn font_set_weight(&mut self, font_rid: Rid, weight: i64)

Sets weight (boldness) of the font. A value in the 100...999 range, normal font weight is 400, bold font weight is 700.

fn font_get_weight(&self, font_rid: Rid) -> i64

Returns weight (boldness) of the font. A value in the 100...999 range, normal font weight is 400, bold font weight is 700.

fn font_set_stretch(&mut self, font_rid: Rid, stretch: i64)

Sets font stretch amount, compared to a normal width. A percentage value between 50% and 200%.

fn font_get_stretch(&self, font_rid: Rid) -> i64

Returns font stretch amount, compared to a normal width. A percentage value between 50% and 200%.

fn font_set_antialiasing( &mut self, font_rid: Rid, antialiasing: FontAntialiasing, )

Sets font anti-aliasing mode.

fn font_get_antialiasing(&self, font_rid: Rid) -> FontAntialiasing

Returns font anti-aliasing mode.

fn font_set_disable_embedded_bitmaps( &mut self, font_rid: Rid, disable_embedded_bitmaps: bool, )

If set to true, embedded font bitmap loading is disabled.

fn font_get_disable_embedded_bitmaps(&self, font_rid: Rid) -> bool

Returns whether the font’s embedded bitmap loading is disabled.

fn font_set_generate_mipmaps(&mut self, font_rid: Rid, generate_mipmaps: bool)

If set to true font texture mipmap generation is enabled.

fn font_get_generate_mipmaps(&self, font_rid: Rid) -> bool

Returns true if font texture mipmap generation is enabled.

fn font_set_multichannel_signed_distance_field( &mut self, font_rid: Rid, msdf: bool, )

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.

fn font_is_multichannel_signed_distance_field(&self, font_rid: Rid) -> bool

Returns true if glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data.

fn font_set_msdf_pixel_range(&mut self, font_rid: Rid, msdf_pixel_range: i64)

Sets the width of the range around the shape between the minimum and maximum representable signed distance.

fn font_get_msdf_pixel_range(&self, font_rid: Rid) -> i64

Returns the width of the range around the shape between the minimum and maximum representable signed distance.

fn font_set_msdf_size(&mut self, font_rid: Rid, msdf_size: i64)

Sets source font size used to generate MSDF textures.

fn font_get_msdf_size(&self, font_rid: Rid) -> i64

Returns source font size used to generate MSDF textures.

fn font_set_allow_system_fallback( &mut self, font_rid: Rid, allow_system_fallback: bool, )

If set to true, system fonts can be automatically used as fallbacks.

fn font_is_allow_system_fallback(&self, font_rid: Rid) -> bool

Returns true if system fonts can be automatically used as fallbacks.

fn font_clear_system_fallback_cache(&mut self)

Frees all automatically loaded system fonts.

fn font_set_force_autohinter(&mut self, font_rid: Rid, force_autohinter: bool)

If set to true auto-hinting is preferred over font built-in hinting.

fn font_is_force_autohinter(&self, font_rid: Rid) -> bool

Returns true if auto-hinting is supported and preferred over font built-in hinting.

fn font_set_modulate_color_glyphs(&mut self, font_rid: Rid, modulate: bool)

If set to true, color modulation is applied when drawing colored glyphs, otherwise it’s applied to the monochrome glyphs only.

fn font_is_modulate_color_glyphs(&self, font_rid: Rid) -> bool

Returns true if color modulation is applied when drawing the font’s colored glyphs.

fn font_set_hinting(&mut self, font_rid: Rid, hinting: Hinting)

Sets font hinting mode. Used by dynamic fonts only.

fn font_get_hinting(&self, font_rid: Rid) -> Hinting

Returns the font hinting mode. Used by dynamic fonts only.

fn font_set_subpixel_positioning( &mut self, font_rid: Rid, subpixel_positioning: SubpixelPositioning, )

Sets font subpixel glyph positioning mode.

fn font_get_subpixel_positioning(&self, font_rid: Rid) -> SubpixelPositioning

Returns font subpixel glyph positioning mode.

fn font_set_keep_rounding_remainders( &mut self, font_rid: Rid, keep_rounding_remainders: bool, )

Sets 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.

fn font_get_keep_rounding_remainders(&self, font_rid: Rid) -> bool

Returns 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.

fn font_set_embolden(&mut self, font_rid: Rid, strength: f64)

Sets font embolden strength. If strength is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness.

fn font_get_embolden(&self, font_rid: Rid) -> f64

Returns font embolden strength.

fn font_set_spacing(&mut self, font_rid: Rid, spacing: SpacingType, value: i64)

Sets the spacing for spacing to value in pixels (not relative to the font size).

fn font_get_spacing(&self, font_rid: Rid, spacing: SpacingType) -> i64

Returns the spacing for spacing in pixels (not relative to the font size).

fn font_set_baseline_offset(&mut self, font_rid: Rid, baseline_offset: f64)

Sets extra baseline offset (as a fraction of font height).

fn font_get_baseline_offset(&self, font_rid: Rid) -> f64

Returns extra baseline offset (as a fraction of font height).

fn font_set_transform(&mut self, font_rid: Rid, transform: Transform2D)

Sets 2D transform, applied to the font outlines, can be used for slanting, flipping, and rotating glyphs.

fn font_get_transform(&self, font_rid: Rid) -> Transform2D

Returns 2D transform applied to the font outlines.

fn font_set_variation_coordinates( &mut self, font_rid: Rid, variation_coordinates: Dictionary<Variant, Variant>, )

Sets variation coordinates for the specified font cache entry.

fn font_get_variation_coordinates(&self, font_rid: Rid) -> AnyDictionary

Returns variation coordinates for the specified font cache entry.

fn font_set_oversampling(&mut self, font_rid: Rid, oversampling: f64)

If set to a positive value, overrides the oversampling factor of the viewport this font is used in. See [member Viewport.oversampling]. This value doesn’t override the oversampling parameter of draw_* methods. Used by dynamic fonts only.

fn font_get_oversampling(&self, font_rid: Rid) -> f64

Returns oversampling factor override. If set to a positive value, overrides the oversampling factor of the viewport this font is used in. See [member Viewport.oversampling]. This value doesn’t override the oversampling parameter of draw_* methods. Used by dynamic fonts only.

fn font_get_size_cache_info(&self, font_rid: Rid) -> Array<AnyDictionary>

Returns 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.

fn font_set_texture_offsets( &mut self, font_rid: Rid, size: Vector2i, texture_index: i64, offset: PackedArray<i32>, )

Sets array containing glyph packing data.

fn font_get_texture_offsets( &self, font_rid: Rid, size: Vector2i, texture_index: i64, ) -> PackedArray<i32>

Returns array containing glyph packing data.

fn font_get_glyph_contours( &self, font_rid: Rid, size: i64, index: i64, ) -> AnyDictionary

Returns outline contours of the glyph.

fn font_get_kerning_list(&self, font_rid: Rid, size: i64) -> Array<Vector2i>

Returns list of the kerning overrides.

fn font_clear_kerning_map(&mut self, font_rid: Rid, size: i64)

Removes all kerning overrides.

fn font_remove_kerning( &mut self, font_rid: Rid, size: i64, glyph_pair: Vector2i, )

Removes kerning override for the pair of glyphs.

fn font_set_kerning( &mut self, font_rid: Rid, size: i64, glyph_pair: Vector2i, kerning: Vector2, )

Sets kerning for the pair of glyphs.

fn font_get_kerning( &self, font_rid: Rid, size: i64, glyph_pair: Vector2i, ) -> Vector2

Returns kerning for the pair of glyphs.

fn font_render_range( &mut self, font_rid: Rid, size: Vector2i, start: i64, end: i64, )

Renders the range of characters to the font cache texture.

fn font_render_glyph(&mut self, font_rid: Rid, size: Vector2i, index: i64)

Renders specified glyph to the font cache texture.

fn font_is_language_supported(&self, font_rid: Rid, language: GString) -> bool

Returns true if the font supports the given language (as a ISO 639 code).

fn font_set_language_support_override( &mut self, font_rid: Rid, language: GString, supported: bool, )

Adds override for font_is_language_supported.

fn font_get_language_support_override( &mut self, font_rid: Rid, language: GString, ) -> bool

Returns true if support override is enabled for the language.

fn font_remove_language_support_override( &mut self, font_rid: Rid, language: GString, )

Remove language support override.

fn font_get_language_support_overrides( &mut self, font_rid: Rid, ) -> PackedArray<GString>

Returns list of language support overrides.

fn font_is_script_supported(&self, font_rid: Rid, script: GString) -> bool

Returns true if the font supports the given script (as a ISO 15924 code).

fn font_set_script_support_override( &mut self, font_rid: Rid, script: GString, supported: bool, )

Adds override for font_is_script_supported.

fn font_get_script_support_override( &mut self, font_rid: Rid, script: GString, ) -> bool

Returns true if support override is enabled for the script.

fn font_remove_script_support_override( &mut self, font_rid: Rid, script: GString, )

Removes script support override.

fn font_get_script_support_overrides( &mut self, font_rid: Rid, ) -> PackedArray<GString>

Returns list of script support overrides.

fn font_set_opentype_feature_overrides( &mut self, font_rid: Rid, overrides: Dictionary<Variant, Variant>, )

Sets font OpenType feature set override.

fn font_get_opentype_feature_overrides(&self, font_rid: Rid) -> AnyDictionary

Returns font OpenType feature set override.

fn font_supported_feature_list(&self, font_rid: Rid) -> AnyDictionary

Returns the dictionary of the supported OpenType features.

fn font_supported_variation_list(&self, font_rid: Rid) -> AnyDictionary

Returns the dictionary of the supported OpenType variation coordinates.

fn font_get_global_oversampling(&self) -> f64

Returns the font oversampling factor, shared by all fonts in the TextServer.

fn font_set_global_oversampling(&mut self, oversampling: f64)

Sets oversampling factor, shared by all font in the TextServer.

fn reference_oversampling_level(&mut self, oversampling: f64)

Increases the reference count of the specified oversampling level. This method is called by Viewport, and should not be used directly.

fn unreference_oversampling_level(&mut self, oversampling: f64)

Decreases 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.

fn get_hex_code_box_size(&self, size: i64, index: i64) -> Vector2

Returns size of the replacement character (box with character hexadecimal code that is drawn in place of invalid characters).

fn draw_hex_code_box( &self, canvas: Rid, size: i64, pos: Vector2, index: i64, color: Color, )

Draws box displaying character hexadecimal code.

fn shaped_text_set_direction(&mut self, shaped: Rid, direction: Direction)

Sets desired text direction. If set to Direction::AUTO, direction will be detected based on the buffer contents and current locale.

fn shaped_text_get_direction(&self, shaped: Rid) -> Direction

Returns direction of the text.

fn shaped_text_get_inferred_direction(&self, shaped: Rid) -> Direction

Returns direction of the text, inferred by the BiDi algorithm.

fn shaped_text_set_bidi_override( &mut self, shaped: Rid, override_: Array<Variant>, )

Overrides BiDi for the structured text.

fn shaped_text_set_custom_punctuation(&mut self, shaped: Rid, punct: GString)

Sets custom punctuation character list, used for word breaking. If set to empty string, server defaults are used.

fn shaped_text_get_custom_punctuation(&self, shaped: Rid) -> GString

Returns custom punctuation character list, used for word breaking. If set to empty string, server defaults are used.

fn shaped_text_set_custom_ellipsis(&mut self, shaped: Rid, char: i64)

Sets ellipsis character used for text clipping.

fn shaped_text_get_custom_ellipsis(&self, shaped: Rid) -> i64

Returns ellipsis character used for text clipping.

fn shaped_text_set_orientation(&mut self, shaped: Rid, orientation: Orientation)

Sets desired text orientation.

fn shaped_text_get_orientation(&self, shaped: Rid) -> Orientation

Returns text orientation.

fn shaped_text_set_preserve_invalid(&mut self, shaped: Rid, enabled: bool)

If set to true text buffer will display invalid characters as hexadecimal codes, otherwise nothing is displayed.

fn shaped_text_get_preserve_invalid(&self, shaped: Rid) -> bool

Returns true if text buffer is configured to display hexadecimal codes in place of invalid characters.

fn shaped_text_set_preserve_control(&mut self, shaped: Rid, enabled: bool)

If set to true text buffer will display control characters.

fn shaped_text_get_preserve_control(&self, shaped: Rid) -> bool

Returns true if text buffer is configured to display control characters.

fn shaped_text_set_spacing( &mut self, shaped: Rid, spacing: SpacingType, value: i64, )

Sets extra spacing added between glyphs or lines in pixels.

fn shaped_text_get_spacing(&self, shaped: Rid, spacing: SpacingType) -> i64

Returns extra spacing added between glyphs or lines in pixels.

fn shaped_get_run_count(&self, shaped: Rid) -> i64

Returns the number of uniform text runs in the buffer.

fn shaped_get_run_text(&self, shaped: Rid, index: i64) -> GString

Returns the source text of the index text run (in visual order).

fn shaped_get_run_range(&self, shaped: Rid, index: i64) -> Vector2i

Returns the source text range of the index text run (in visual order).

fn shaped_get_run_font_rid(&self, shaped: Rid, index: i64) -> Rid

Returns the font RID of the index text run (in visual order).

fn shaped_get_run_font_size(&self, shaped: Rid, index: i64) -> i32

Returns the font size of the index text run (in visual order).

fn shaped_get_run_language(&self, shaped: Rid, index: i64) -> GString

Returns the language of the index text run (in visual order).

fn shaped_get_run_direction(&self, shaped: Rid, index: i64) -> Direction

Returns the direction of the index text run (in visual order).

fn shaped_get_run_object(&self, shaped: Rid, index: i64) -> Variant

Returns the embedded object of the index text run (in visual order).

fn shaped_text_fit_to_width( &mut self, shaped: Rid, width: f64, justification_flags: JustificationFlag, ) -> f64

Adjusts text width to fit to specified width, returns new text width.

fn shaped_text_tab_align( &mut self, shaped: Rid, tab_stops: PackedArray<f32>, ) -> f64

Aligns shaped text to the given tab-stops.

fn shaped_text_update_breaks(&mut self, shaped: Rid) -> bool

Updates break points in the shaped text. This method is called by default implementation of text breaking functions.

fn shaped_text_update_justification_ops(&mut self, shaped: Rid) -> bool

Updates justification points in the shaped text. This method is called by default implementation of text justification functions.

fn shaped_text_get_line_breaks_adv( &self, shaped: Rid, width: PackedArray<f32>, start: i64, once: bool, break_flags: LineBreakFlag, ) -> PackedArray<i32>

Breaks text to the lines and columns. Returns character ranges for each segment.

fn shaped_text_get_line_breaks( &self, shaped: Rid, width: f64, start: i64, break_flags: LineBreakFlag, ) -> PackedArray<i32>

Breaks text to the lines and returns character ranges for each line.

fn shaped_text_get_word_breaks( &self, shaped: Rid, grapheme_flags: GraphemeFlag, skip_grapheme_flags: GraphemeFlag, ) -> PackedArray<i32>

Breaks text into words and returns array of character ranges. Use grapheme_flags to set what characters are used for breaking.

fn shaped_text_overrun_trim_to_width( &mut self, shaped: Rid, width: f64, trim_flags: TextOverrunFlag, )

Trims text if it exceeds the given width.

fn shaped_text_get_dominant_direction_in_range( &self, shaped: Rid, start: i64, end: i64, ) -> i64

Returns dominant direction of in the range of text.

unsafe fn shaped_text_get_carets_rawptr( &self, shaped: Rid, position: i64, caret: RawPtr<*mut CaretInfo>, )

§Godot docs

Returns shapes of the carets corresponding to the character offset position in the text. Returned caret shape is 1 pixel wide rectangle.

§Safety

This method has automatically been marked unsafe because it accepts raw pointers as parameters. If Godot does not document any safety requirements, make sure you understand the underlying semantics.

fn shaped_text_get_selection( &self, shaped: Rid, start: i64, end: i64, ) -> PackedArray<Vector2>

Returns selection rectangles for the specified character range.

fn shaped_text_hit_test_grapheme(&self, shaped: Rid, coord: f64) -> i64

Returns grapheme index at the specified pixel offset at the baseline, or -1 if none is found.

fn shaped_text_hit_test_position(&self, shaped: Rid, coord: f64) -> i64

Returns caret character offset at the specified pixel offset at the baseline. This function always returns a valid position.

fn shaped_text_draw( &self, shaped: Rid, canvas: Rid, pos: Vector2, clip_l: f64, clip_r: f64, color: Color, oversampling: f32, )

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). If oversampling is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.

fn shaped_text_draw_outline( &self, shaped: Rid, canvas: Rid, pos: Vector2, clip_l: f64, clip_r: f64, outline_size: i64, color: Color, oversampling: f32, )

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). If oversampling is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.

fn shaped_text_get_grapheme_bounds(&self, shaped: Rid, pos: i64) -> Vector2

Returns composite character’s bounds as offsets from the start of the line.

fn shaped_text_next_grapheme_pos(&self, shaped: Rid, pos: i64) -> i64

Returns grapheme end position closest to the pos.

fn shaped_text_prev_grapheme_pos(&self, shaped: Rid, pos: i64) -> i64

Returns grapheme start position closest to the pos.

fn shaped_text_get_character_breaks(&self, shaped: Rid) -> PackedArray<i32>

Returns array of the composite character boundaries.

fn shaped_text_next_character_pos(&self, shaped: Rid, pos: i64) -> i64

Returns composite character end position closest to the pos.

fn shaped_text_prev_character_pos(&self, shaped: Rid, pos: i64) -> i64

Returns composite character start position closest to the pos.

fn shaped_text_closest_character_pos(&self, shaped: Rid, pos: i64) -> i64

Returns composite character position closest to the pos.

fn format_number(&self, number: GString, language: GString) -> GString

Converts a number from Western Arabic (0..9) to the numeral system used in the given language.

If language is an empty string, the active locale will be used.

fn parse_number(&self, number: GString, language: GString) -> GString

Converts number from the numeral system used in the given language to Western Arabic (0..9).

If language is an empty string, the active locale will be used.

fn percent_sign(&self, language: GString) -> GString

Returns percent sign used in the given language.

fn strip_diacritics(&self, string: GString) -> GString

Strips diacritics from the string.

fn is_valid_identifier(&self, string: GString) -> bool

Returns true if string is a valid identifier.

fn is_valid_letter(&self, unicode: u64) -> bool

fn string_get_word_breaks( &self, string: GString, language: GString, chars_per_line: i64, ) -> PackedArray<i32>

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.

fn string_get_character_breaks( &self, string: GString, language: GString, ) -> PackedArray<i32>

Returns array of the composite character boundaries.

fn is_confusable(&self, string: GString, dict: PackedArray<GString>) -> i64

Returns index of the first string in dict which is visually confusable with the string, or -1 if none is found.

fn spoof_check(&self, string: GString) -> bool

Returns true if string is likely to be an attempt at confusing the reader.

fn string_to_upper(&self, string: GString, language: GString) -> GString

Returns the string converted to UPPERCASE.

fn string_to_lower(&self, string: GString, language: GString) -> GString

Returns the string converted to lowercase.

fn string_to_title(&self, string: GString, language: GString) -> GString

Returns the string converted to Title Case.

fn parse_structured_text( &self, parser_type: StructuredTextParser, args: Array<Variant>, text: GString, ) -> Array<Vector3i>

Default implementation of the BiDi algorithm override function.

fn cleanup(&mut self)

This method is called before text server is unregistered.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§