Struct BitmapFont
Renders text using fonts under the url=https://www.angelcode.com/products/bmfont/
BMFont/url
format.
Handles files with the
extension.
struct BitmapFont
;
Renders text using *
fonts containing texture atlases. Supports distance fields. For using vector font files like TTF directly, see DynamicFont
.
Properties
Name | Type | Description |
---|---|---|
ascent [get, set]
|
double | Ascent (number of pixels above the baseline). |
chars [get, set]
|
PoolArray!(int) | |
distanceField [get, set]
|
bool | If true , distance field hint is enabled.
|
fallback [get, set]
|
BitmapFont | The fallback font. |
height [get, set]
|
double | Total font height (ascent plus descent) in pixels. |
kernings [get, set]
|
PoolArray!(int) | |
textures [get, set]
|
Array |
Methods
Name | Description |
---|---|
_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 * 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
|