Options
All
  • Public
  • Public/Protected
  • All
Menu

BitmapFont represents a typeface available for use with the BitmapText class. Use the install method for adding a font to be used.

memberof

PIXI

Hierarchy

  • BitmapFont

Index

Constructors

constructor

Properties

Private _ownsTextures

_ownsTextures: any

Readonly chars

Readonly font

font: string

Readonly lineHeight

lineHeight: number

Readonly pageTextures

pageTextures: Dict<Texture<Resource>>

Readonly size

size: number

Static Readonly ALPHA

ALPHA: (string | string[])[]

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

readonly
static
member

{string[][]}

example

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

Static Readonly ALPHANUMERIC

ALPHANUMERIC: (string | string[])[]

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

readonly
static
member

{string[][]}

Static Readonly ASCII

ASCII: string[][]

This character set consists of all the ASCII table.

readonly
static
member

{string[][]}

see

http://www.asciitable.com/

Static Readonly NUMERIC

NUMERIC: string[][]

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

readonly
static
member

{string[][]}

example

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

Static Readonly available

available: Dict<BitmapFont>

Collection of available/installed fonts.

readonly
static
member

{Object.<string, PIXI.BitmapFont>}

Static Readonly defaultOptions

defaultOptions: IBitmapFontOptions

Collection of default options when using BitmapFont.from.

readonly
static
member

{PIXI.IBitmapFontOptions}

property

{number} resolution=1

property

{number} textureWidth=512

property

{number} textureHeight=512

property

{number} padding=4

property

{string|string[]|string[][]} chars = PIXI.BitmapFont.ALPHANUMERIC

Methods

destroy

  • destroy(): void
  • Remove references to created glyph textures.

    Returns void

Static from

  • Generates 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:

    • {@link PIXI.TextStyle#dropShadow|dropShadow}
    • {@link PIXI.TextStyle#dropShadowDistance|dropShadowDistance}
    • {@link PIXI.TextStyle#dropShadowColor|dropShadowColor}
    • {@link PIXI.TextStyle#dropShadowBlur|dropShadowBlur}
    • {@link PIXI.TextStyle#dropShadowAngle|dropShadowAngle}
    • {@link PIXI.TextStyle#fill|fill}
    • {@link PIXI.TextStyle#fillGradientStops|fillGradientStops}
    • {@link PIXI.TextStyle#fillGradientType|fillGradientType}
    • {@link PIXI.TextStyle#fontFamily|fontFamily}
    • {@link PIXI.TextStyle#fontSize|fontSize}
    • {@link PIXI.TextStyle#fontVariant|fontVariant}
    • {@link PIXI.TextStyle#fontWeight|fontWeight}
    • {@link PIXI.TextStyle#lineJoin|lineJoin}
    • {@link PIXI.TextStyle#miterLimit|miterLimit}
    • {@link PIXI.TextStyle#stroke|stroke}
    • {@link PIXI.TextStyle#strokeThickness|strokeThickness}
    • {@link PIXI.TextStyle#textBaseline|textBaseline}
    static
    example

    PIXI.BitmapFont.from("TitleFont", { fontFamily: "Arial", fontSize: 12, strokeThickness: 2, fill: "purple" });

    const title = new PIXI.BitmapText("This is the title", { fontName: "TitleFont" });

    Parameters

    Returns BitmapFont

    Font generated by style options.

Static install

  • Register a new bitmap font.

    static

    Parameters

    Returns BitmapFont

    Result font object with font, size, lineHeight and char fields.

Static uninstall

  • uninstall(name: string): void
  • Remove bitmap font by name.

    static

    Parameters

    • name: string

      Name of the font to uninstall.

    Returns void

Generated using TypeDoc