Class: BitmapFontManagerClass

BitmapFontManagerClass

The BitmapFontManager is a helper class that exists to install and uninstall fonts into the cache for BitmapText objects.

new BitmapFontManagerClass ()

Members

ALPHA Array<Array<string>> readonly

This character set includes all the letters in the alphabet (both lower- and upper- case).

Example
BitmapFont.from('ExampleFont', style, { chars: BitmapFont.ALPHA })

ALPHANUMERIC Array<Array<string>> readonly

This character set is the union of BitmapFont.ALPHA and BitmapFont.NUMERIC.

ASCII Array<Array<string>> readonly

This character set consists of all the ASCII table.

See:

NUMERIC Array<Array<string>> readonly

This character set includes all decimal digits (from 0 to 9).

Example
BitmapFont.from('ExampleFont', style, { chars: BitmapFont.NUMERIC })

Methods

install (name, textStyle, options)

Generates a bitmap-font for the given style and character set

Name Type Attributes Description
name string

The name of the custom font to use with BitmapText.

textStyle TextStyle | TextStyleOptions<Partial> <optional>

Style options to render with BitmapFont.

options BitmapFontInstallOptions <optional>

Setup options for font or name of the font.

Returns:
Font generated by style options.
Example
 import { BitmapFontManager, BitmapText } from 'pixi.js';

 BitmapFontManager.install('TitleFont', {
     fontFamily: 'Arial',
     fontSize: 12,
     strokeThickness: 2,
     fill: 'purple',
 });

 const title = new Text({ text: 'This is the title', fontFamily: 'TitleFont', renderMode: 'bitmap' });

uninstall (name)

Uninstalls a bitmap font from the cache.

Name Type Description
name string

The name of the bitmap font to uninstall.