BitmapFont
Inherits: Font < Resource < Reference < Object
BMFont format.
.fnt extension.
Description
*.fnt fonts containing texture atlases. Supports distance fields. For using vector font files like TTF directly, see DynamicFont.
Properties
Methods
Property Descriptions
- float ascent Ascent (number of pixels above the baseline).
- bool distance_field
true, distance field hint is enabled.
- BitmapFont fallback The fallback font.
- float height
Total font height (ascent plus descent) in pixels.
Method Descriptions
- add_char ( int character, int texture, Rect2 rect, Vector2 align=Vector2( 0, 0 ), float advance=-1 )
characteris the Unicode value,textureis the texture index,rectis the region in the texture (in pixels!),alignis the (optional) alignment for the character andadvanceis the (optional) advance.
- add_kerning_pair ( int char_a, int char_b, int kerning )
BitmapFontas a difference. Kerning pairs are special cases where a typeface advance is determined by the next character.
- add_texture ( Texture texture )
BitmapFont.
- clear ( ) Clears all the font data and settings.
- Error create_from_fnt ( String path )
*.fntfile atpath.
- int get_kerning_pair ( int char_a, int char_b ) const Returns a kerning pair as a difference.
- Texture get_texture ( int idx ) const
idx.
- int get_texture_count ( ) const Returns the number of textures in the BitmapFont atlas.
