hosanna-ui-docs - v0.9.0
    Preparing search index...

    Class FontManagerPrivate

    Manages font caching and retrieval for the application.

    FontManager

    constructor Initializes a new instance of the FontManager class.

    getFontWithKey Retrieves a font based on the provided key. The key can be a font name, a size, or both separated by a comma. If the size is missing, the font name must be one of the system fonts. If the font name is missing, it will use the system default font.

    The key representing the font name and/or size.

    • The font object if found, otherwise undefined.

    private getFont Retrieves a font based on the provided name and size. If the font is not cached, it will be created and cached.

    The name of the font.

    The size of the font.

    • The font object if found or created, otherwise undefined.
    • Throws an error if the font is not registered.

    Implements

    Index

    Constructors

    Properties

    cachedFonts: { [key: string]: ISGNFont } = {}

    A cache of fonts keyed by font name and size.

    fontLabel: ISGNLabel = ...

    A label node used for retrieving system fonts.

    Methods

    • Retrieves a font based on the provided name and size. If the font is not cached, it will be created and cached.

      Parameters

      • nameOrPath: string

        The name or path of the font.

      • Optionalsize: number

        The size of the font.

      Returns undefined | ISGNFont

      The font object if found or created, otherwise undefined.

    • Retrieves a font based on the provided key. The key can be a font name, a size, or both separated by a comma. If the size is missing, the font name must be one of the system fonts. If the font name is missing, it will use the system default font.

      Parameters

      • key: string

        The key representing the font name and/or size.

      Returns undefined | ISGNFont

      The font object if found, otherwise undefined.