Interface FontInstance

interface FontInstance {
    baseline(): number;
    height(): number;
    name(): string;
    path(): string;
    stringWidth(str: string, kerning?: number): number;
}

Methods

  • Return the number of pixels from the font's top to its baseline.

    Returns number

  • Return the number of pixels from the font's top to its bottom.

    Returns number

  • Return the name of the font.

    Returns string

  • Return the path of the font source.

    Returns string

  • Return the number of pixels spanned by a string rendered with this font.

    Parameters

    • str: string
    • Optionalkerning: number

    Returns number