| Name | Type | Description |
|---|---|---|
data |
PIXI.BitmapFontData | |
textures |
Array.<PIXI.Texture> | Object.<string, PIXI.Texture> |
Members
-
This character set includes all the letters in the alphabet (both lower- and upper- case).
Example
BitmapFont.from("ExampleFont", style, { chars: BitmapFont.ALPHA }) -
This character set is the union of
BitmapFont.ALPHAandBitmapFont.NUMERIC. -
This character set consists of all the ASCII table.
-
PIXI.BitmapFont.available Object.<string, PIXI.BitmapFont> staticreadonly
-
Collection of available/installed fonts.
-
PIXI.BitmapFont.defaultOptions PIXI.IBitmapFontOptions staticreadonly
-
Collection of default options when using
BitmapFont.from.Properties:
Name Type Default Description resolutionnumber 1 textureWidthnumber 512 textureHeightnumber 512 paddingnumber 4 charsstring | Array.<string> | Array.<Array.<string>> PIXI.BitmapFont.ALPHANUMERIC -
This character set includes all decimal digits (from 0 to 9).
Example
BitmapFont.from("ExampleFont", style, { chars: BitmapFont.NUMERIC }) -
The map of characters by character code.
-
The name of the font face.
-
The line-height of the font face in pixels.
-
The size of the font face in pixels.
Methods
-
PIXI.BitmapFont.from (name, style, options)PIXI.BitmapFont static
-
Generates a bitmap-font for the given style and character set. This does not support kernings yet. With
styleproperties, only the following non-layout properties are used:Name Type Description namestring The name of the custom font to use with BitmapText.
styleobject | PIXI.TextStyle optional Style options to render with BitmapFont.
optionsPIXI.IBitmapFontOptions optional Setup options for font or name of the font.
Name Type Default Description charsstring | Array.<string> | Array.<Array.<string>> PIXI.BitmapFont.ALPHANUMERIC optional characters included in the font set. You can also use ranges. For example,
[['a', 'z'], ['A', 'Z'], "!@#$%^&*()~{}[] "]. Don't forget to include spaces ' ' in your character set!resolutionnumber 1 optional Render resolution for glyphs.
textureWidthnumber 512 optional Optional width of atlas, smaller values to reduce memory.
textureHeightnumber 512 optional Optional height of atlas, smaller values to reduce memory.
paddingnumber 4 optional Padding between glyphs on texture atlas.
Returns:
Type Description PIXI.BitmapFont Font generated by style options. Example
PIXI.BitmapFont.from("TitleFont", { fontFamily: "Arial", fontSize: 12, strokeThickness: 2, fill: "purple" }); const title = new PIXI.BitmapText("This is the title", { fontName: "TitleFont" }); -
PIXI.BitmapFont.install (data, textures)PIXI.BitmapFont static
-
Register a new bitmap font.
Name Type Description dataXMLDocument | string | PIXI.BitmapFontData The characters map that could be provided as xml or raw string.
texturesObject.<string, PIXI.Texture> | PIXI.Texture | Array.<PIXI.Texture> List of textures for each page.
Returns:
Type Description PIXI.BitmapFont Result font object with font, size, lineHeight and char fields. -
Remove bitmap font by name.
Name Type Description namestring -
Remove references to created glyph textures.