Font data source, file or memory buffer.
Built-in text servers support font data sources of the following formats:
- Bitmap fonts in the [url=https://www.angelcode.com/products/bmfont/]BMFont[/url] format. Handles [code].fnt, *.font[/code] fonts containing texture atlases. Non-scalable. Supports distance fields. Complex text shaping support is limited.
- Dynamic fonts using the [url=https://www.freetype.org/]FreeType[/url] and [url=https://github.com/silnrsi/graphite/]Graphite[/url] library for rasterization. Handles [code]*.ttf, *.otf[/code] fonts. Scalable. Doesn't support distance fields. Supports complex text shaping and OpenType features.
Adds a character to the font, where [code]character[/code] is the Unicode value, [code]texture[/code] is the texture index, [code]rect[/code] is the region in the texture (in pixels!), [code]align[/code] is the (optional) alignment for the character and [code]advance[/code] is the (optional) advance.
Adds a kerning pair to the bitmap font as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character.
Adds a texture to the bitmap font.
Draws single glyph into a canvas item at the position, using [code]font[/code] at the size [code]size[/code].
Returns advance of the glyph for horizontal and vertical layouts.
Note: Glyph index is bound to the font data, use only glyphs indices returned by [method TextServer.shaped_text_get_glyphs] or [method get_glyph_index] for this font data.
Draws single glyph outline of size [code]outline_size[/code] into a canvas item at the position, using [code]font[/code] at the size [code]size[/code]. If outline drawing is not supported, nothing is drawn.
Returns advance of the glyph for horizontal and vertical layouts (regardless of outline drawing support).
Note: Glyph index is bound to the font data, use only glyphs indices returned by [method TextServer.shaped_text_get_glyphs] or [method get_glyph_index] for this font data.
Returns the font ascent (number of pixels above the baseline).
Returns the base size of the font (the only size supported for non-scalable fonts, meaningless for scalable fonts).
Returns the font descent (number of pixels below the baseline).
Returns advance of the glyph for horizontal and vertical layouts.
Note: Glyph index is bound to the font data, use only glyphs indices returned by [method TextServer.shaped_text_get_glyphs] or [method get_glyph_index] for this font data.
Return the glyph index of a [code]char[/code], optionally modified by the [code]variation_selector[/code].
Returns a kerning of the pair of glyphs for horizontal and vertical layouts.
Note: Glyph index is bound to the font data, use only glyphs indices returned by [method TextServer.shaped_text_get_glyphs] or [method get_glyph_index] for this font data.
Returns the total font height (ascent plus descent) in pixels.
Returns [code]true[/code] if support override is enabled for the [code]language[/code].
Returns list of language support overrides.
Returns [code]true[/code] if support override is enabled for the [code]script[/code].
Returns list of script support overrides.
Returns the spacing for the given [code]type[/code] (see [enum SpacingType]).
Returns a string containing all the characters available in the font.
Returns underline offset (number of pixels below the baseline).
Returns underline thickness in pixels.
Returns variation coordinate [code]tag[/code].
Returns list of supported [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]variation coordinates[/url], each coordinate is returned as [code]tag: Vector3i(min_value,max_value,default_value)[/code].
Font variations allow for continuous change of glyph characteristics along some given design axis, such as weight, width or slant.
Return [code]true[/code] if a Unicode [code]char[/code] is available in the font.
Returns [code]true[/code], if font supports drawing glyph outlines.
Returns [code]true[/code], if font supports given language ([url=https://en.wikipedia.org/wiki/ISO_639-1]ISO 639[/url] code).
Returns [code]true[/code], if font supports given script ([url=https://en.wikipedia.org/wiki/ISO_15924]ISO 15924[/url] code).
Creates new font from the data in memory.
Note: For non-scalable fonts [code]base_size[/code] is ignored, use [method get_base_size] to check actual font size.
Creates new font from the file.
Note: For non-scalable fonts [code]base_size[/code] is ignored, use [method get_base_size] to check actual font size.
Creates new, empty bitmap font.
Remove language support override.
Removes script support override.
Adds override for [method is_language_supported].
Adds override for [method is_script_supported].
Sets the spacing for [code]type[/code] (see [enum SpacingType]) to [code]value[/code] in pixels (not relative to the font size).
Sets variation coordinate [code]tag[/code].
If [code]true[/code], the font is rendered with anti-aliasing.
The path to the font data file. If font data was loaded from memory location is set to [code]"(Memory)"[/code].
If [code]true[/code], distance field hint is enabled.
Extra spacing for each glyph in pixels.
This can be a negative number to make the distance between glyphs smaller.
Extra spacing for the space character in pixels.
This can be a negative number to make the distance between words smaller.
If [code]true[/code], default autohinter is used for font hinting.
The font hinting mode used by FreeType. See [enum TextServer.Hinting] for options.
Spacing for each glyph.
Spacing for the space character.