@kayahr/wastelib
    Preparing search index...

    Class Font

    Container for the 172 font characters of the COLORF.FNT file.

    Index

    Methods

    • Returns the font character image with the given index.

      Parameters

      • index: number

        The index of the font character.

      Returns FontChar

      The font character image.

    • Returns the number of characters.

      Returns number

      The number of characters.

    • Creates and returns a new canvas containing all characters of the font. 16 characters per row.

      Returns HTMLCanvasElement

      The created canvas.

    • Creates and returns a font image data URL. 16 font characters per row.

      Parameters

      • Optionaltype: string

        Optional image mime type. Defaults to image/png.

      • Optionalquality: number

        Optional quality parameter for encoder. For image/jpeg this is the image quality between 0 and 1 with a default value of 0.92.

      Returns string

      The created data URL.

    • Creates and returns a HTML image of the font. 16 font characters per row.

      Parameters

      • Optionaltype: string

        Optional image mime type. Defaults to image/png.

      • Optionalquality: number

        Optional quality parameter for encoder. For image/jpeg this is the image quality between 0 and 1 with a default value of 0.92.

      Returns HTMLImageElement

      The created HTML image.

    • Parses a font from the given array and returns it.

      Parameters

      • array: Uint8Array

        The array with the colorf.fnt file content to parse.

      Returns Font

      The parsed font.

    • Reads the color font from the given blob and returns it.

      Parameters

      • blob: Blob

        The COLORF.FNT blob to read.

      Returns Promise<Font>

      The read font.