Readonly
charsThe map of characters by character code.
Readonly
distanceThe range of the distance field in pixels.
Readonly
distanceThe kind of distance field for this font or "none".
Readonly
fontThe name of the font face.
Readonly
lineThe line-height of the font face in pixels.
Readonly
pageThe map of base page textures (i.e., sheets of glyphs).
Readonly
sizeThe size of the font face in pixels.
Static
Readonly
ALPHAThis character set includes all the letters in the alphabet (both lower- and upper- case).
BitmapFont.from('ExampleFont', style, { chars: BitmapFont.ALPHA })
Static
Readonly
ALPHANUMERICThis character set is the union of BitmapFont.ALPHA
and BitmapFont.NUMERIC
.
Static
Readonly
ASCIIThis character set consists of all the ASCII table.
Static
Readonly
NUMERICThis character set includes all decimal digits (from 0 to 9).
BitmapFont.from('ExampleFont', style, { chars: BitmapFont.NUMERIC })
Static
Readonly
availableCollection of available/installed fonts.
Static
Readonly
defaultCollection of default options when using BitmapFont.from
.
Static
fromGenerates a bitmap-font for the given style and character set. This does not support
kernings yet. With style
properties, only the following non-layout properties are used:
The name of the custom font to use with BitmapText.
Optional
textStyle: Pixi.TextStyle | Partial<ITextStyle>Style options to render with BitmapFont.
Optional
options: IBitmapFontOptionsSetup options for font or name of the font.
Font generated by style options.
import { BitmapFont, BitmapText } from 'pixi.js';
BitmapFont.from('TitleFont', {
fontFamily: 'Arial',
fontSize: 12,
strokeThickness: 2,
fill: 'purple',
});
const title = new BitmapText('This is the title', { fontName: 'TitleFont' });
Static
installRegister a new bitmap font.
The characters map that could be provided as xml or raw string.
List of textures for each page.
Optional
ownsTextures: booleanSet to true
to destroy page textures
when the font is uninstalled. By default fonts created with
BitmapFont.from
or from the BitmapFontLoader
are true
.
Result font object with font, size, lineHeight and char fields.
Static
uninstallGenerated using TypeDoc
BitmapFont represents a typeface available for use with the BitmapText class. Use the
install
method for adding a font to be used.Memberof
PIXI