BitmapFont
Renders text using fonts under the BMFont format.
Handles files with the extension.
Renders text using *.fnt
fonts containing texture atlases. Supports distance fields. For using vector font files like TTF directly, see DynamicFont.
void | ( int character, texture, Rect2 rect, align=Vector2( 0, 0 ), float advance=-1 ) |
void | |
void | ( Texture texture ) |
( ) | |
( String path ) | |
get_kerning_pair ( char_a, int char_b ) const | |
get_texture ( idx ) const | |
( ) const |
Ascent (number of pixels above the baseline).
- distance_field
Default | |
Setter | set_distance_field_hint(value) |
is_distance_field_hint() |
If true
, distance field hint is enabled.
- BitmapFont fallback
The fallback font.
- height
Default |
|
Setter | set_height(value) |
Getter | get_height() |
Total font height (ascent plus descent) in pixels.
Adds a character to the font, where character
is the Unicode value, texture
is the texture index, rect
is the region in the texture (in pixels!), is the (optional) alignment for the character and advance
is the (optional) advance.
Adds a kerning pair to the BitmapFont
as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character.
Adds a texture to the BitmapFont
.
- void clear ( )
Clears all the font data and settings.
- create_from_fnt ( String path )
Creates a BitmapFont from the *.fnt
file at path
.
- get_kerning_pair ( int char_a, char_b ) const
Returns a kerning pair as a difference.
- Texture get_texture ( idx ) const
- int get_texture_count ( ) const
Returns the number of textures in the BitmapFont atlas.