Optional
charsCharacters included in the font set. You can specify individual characters or ranges. Don't forget to include spaces ' ' in your character set!
Optional
dynamicWhether to allow overriding the fill color with a tint at runtime.
When enabled, the font can be dynamically tinted using the tint
property of BitmapText,
allowing a single font to display multiple colors without creating separate font textures.
This is memory efficient but requires the font to be rendered with white fill color.
When disabled, the fill color is permanently baked into the font texture. This allows any fill color but prevents runtime tinting - each color variation requires a separate font.
false (automatically determined based on style)
Requirements for tinting:
0xFFFFFF
or '#ffffff'
)Performance considerations:
// Correct usage - white fill with tinting enabled
BitmapFont.install({
name: 'TintableFont',
style: {
fontFamily: 'Arial',
fontSize: 24,
fill: 0xFFFFFF // Must be white for tinting
},
dynamicFill: true
});
// Use the font with different colors via tinting
const redText = new BitmapText({
text: 'Red Text',
style: { fontFamily: 'TintableFont', fill: 'red }, // Red tint
});
const blueText = new BitmapText({
text: 'Blue Text',
style: { fontFamily: 'TintableFont', fill: 'blue' }, // Blue tint
});
Optional
nameThe name of the font. This will be used as the fontFamily in text styles to access this font. Must be unique across all installed bitmap fonts.
Optional
paddingPadding between glyphs on texture atlas. Balances visual quality with texture space.
Optional
resolutionRender resolution for glyphs. Higher values create sharper text at the cost of memory. Useful for supporting high-DPI displays.
Optional
skipSkip generation of kerning information for the BitmapFont.
Optional
styleStyle options to render the BitmapFont with. Supports all TextStyle properties including fill, stroke, and shadow effects.
Optional
textureOptional texture style to use when creating the font textures. Controls how the font textures are rendered and filtered.
The options for installing a new BitmapFont. Once installed, the font will be available for use in BitmapText objects through the fontFamily property of TextStyle.
Example