Struct BitmapFont

Renders text using fonts under the url=https://www.angelcode.com/products/bmfont/BMFont/url format. Handles files with the .fnt extension.

struct BitmapFont ;

Renders text using *.fnt fonts containing texture atlases. Supports distance fields. For using vector font files like TTF directly, see DynamicFont.

Properties

NameTypeDescription
ascent[get, set] doubleAscent (number of pixels above the baseline).
chars[get, set] PoolArray!(int)
distanceField[get, set] boolIf true, distance field hint is enabled.
fallback[get, set] BitmapFontThe fallback font.
height[get, set] doubleTotal font height (ascent plus descent) in pixels.
kernings[get, set] PoolArray!(int)
textures[get, set] Array

Methods

NameDescription
_getChars
_getKernings
_getTextures
_setChars
_setKernings
_setTextures
addChar 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!), align is the (optional) alignment for the character and advance is the (optional) advance.
addKerningPair 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.
addTexture Adds a texture to the BitmapFont.
clear Clears all the font data and settings.
createFromFnt Creates a BitmapFont from the *.fnt file at path.
getCharSize Returns the size of a character, optionally taking kerning into account if the next character is provided.
getFallback
getKerningPair Returns a kerning pair as a difference.
getTexture Returns the font atlas texture at index idx.
getTextureCount Returns the number of textures in the BitmapFont atlas.
setAscent
setDistanceFieldHint
setFallback
setHeight