pixi.js
    Preparing search index...

    Class BitmapFontManagerAdvanced

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

    import { BitmapFontManager, BitmapText } from 'pixi.js';

    BitmapFontManager.install({
    name: 'TitleFont',
    style: {}
    });

    const title = new BitmapText({ text: 'This is the title', style: { fontFamily: 'TitleFont' }});
    Index

    Properties

    ALPHA: (string | string[])[] = ...

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

    BitmapFont.from('ExampleFont', style, { chars: BitmapFont.ALPHA })
    
    ALPHANUMERIC: (string | string[])[] = ...

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

    ASCII: string[][] = ...

    This character set consists of all the ASCII table.

    defaultOptions: Omit<BitmapFontInstallOptions, "style"> = ...

    Default options for installing a new BitmapFont.

    NUMERIC: string[][] = ...

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

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

    Methods

    • Get a font for the specified text and style.

      Parameters

      • text: string

        The text to get the font for

      • style: TextStyle

        The style to use

      Returns BitmapFont

    • Get the layout of a text for the specified style.

      Parameters

      • text: string

        The text to get the layout for

      • style: TextStyle

        The style to use

      • trimEnd: boolean = true

        Whether to ignore whitespaces at the end of each line

      Returns BitmapTextLayoutData

    • Measure the text using the specified style.

      Parameters

      • text: string

        The text to measure

      • style: TextStyle

        The style to use

      • trimEnd: boolean = true

        Whether to ignore whitespaces at the end of each line

      Returns { height: number; offsetY: number; scale: number; width: number }

    • Uninstalls a bitmap font from the cache.

      Parameters

      • name: string

        The name of the bitmap font to uninstall.

      Returns void