Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

TextServer

Inherits: RefCounted < Object

Inherited By: TextServerExtension

A server interface for font management and text rendering.

Description

TextServer is the API backend for managing fonts and rendering text.

Methods

RID

create_font ( )

RID

create_font_linked_variation ( RID font_rid )

RID

create_shaped_text ( Direction direction=0, Orientation orientation=0 )

void

draw_hex_code_box ( RID canvas, int size, Vector2 pos, int index, Color color ) const

void

font_clear_glyphs ( RID font_rid, Vector2i size )

void

font_clear_kerning_map ( RID font_rid, int size )

void

font_clear_size_cache ( RID font_rid )

void

font_clear_textures ( RID font_rid, Vector2i size )

void

font_draw_glyph ( RID font_rid, RID canvas, int size, Vector2 pos, int index, Color color=Color(1, 1, 1, 1) ) const

void

font_draw_glyph_outline ( RID font_rid, RID canvas, int size, int outline_size, Vector2 pos, int index, Color color=Color(1, 1, 1, 1) ) const

FontAntialiasing

font_get_antialiasing ( RID font_rid ) const

float

font_get_ascent ( RID font_rid, int size ) const

int

font_get_char_from_glyph_index ( RID font_rid, int size, int glyph_index ) const

float

font_get_descent ( RID font_rid, int size ) const

float

font_get_embolden ( RID font_rid ) const

int

font_get_face_count ( RID font_rid ) const

int

font_get_face_index ( RID font_rid ) const

int

font_get_fixed_size ( RID font_rid ) const

FixedSizeScaleMode

font_get_fixed_size_scale_mode ( RID font_rid ) const

bool

font_get_generate_mipmaps ( RID font_rid ) const

float

font_get_global_oversampling ( ) const

Vector2

font_get_glyph_advance ( RID font_rid, int size, int glyph ) const

Dictionary

font_get_glyph_contours ( RID font, int size, int index ) const

int

font_get_glyph_index ( RID font_rid, int size, int char, int variation_selector ) const

PackedInt32Array

font_get_glyph_list ( RID font_rid, Vector2i size ) const

Vector2

font_get_glyph_offset ( RID font_rid, Vector2i size, int glyph ) const

Vector2

font_get_glyph_size ( RID font_rid, Vector2i size, int glyph ) const

int

font_get_glyph_texture_idx ( RID font_rid, Vector2i size, int glyph ) const

RID

font_get_glyph_texture_rid ( RID font_rid, Vector2i size, int glyph ) const

Vector2

font_get_glyph_texture_size ( RID font_rid, Vector2i size, int glyph ) const

Rect2

font_get_glyph_uv_rect ( RID font_rid, Vector2i size, int glyph ) const

Hinting

font_get_hinting ( RID font_rid ) const

Vector2

font_get_kerning ( RID font_rid, int size, Vector2i glyph_pair ) const

Vector2i[]

font_get_kerning_list ( RID font_rid, int size ) const

bool

font_get_language_support_override ( RID font_rid, String language )

PackedStringArray

font_get_language_support_overrides ( RID font_rid )

int

font_get_msdf_pixel_range ( RID font_rid ) const

int

font_get_msdf_size ( RID font_rid ) const

String

font_get_name ( RID font_rid ) const

Dictionary

font_get_opentype_feature_overrides ( RID font_rid ) const

Dictionary

font_get_ot_name_strings ( RID font_rid ) const

float

font_get_oversampling ( RID font_rid ) const

float

font_get_scale ( RID font_rid,