Hosanna UI API v1.30.2-next
    Preparing search index...
    interface IFontManager {
        getFontStatus(fontUrl: string): FontLoadStatus;
        getFontWithKey(key: string): undefined | ISGNFont;
        getSimpleLabelFontInfoWithKey(key: string): undefined | SimpleLabelFontInfo;
        onFontLoad(callback: (fontUrl: string, success: boolean) => void): void;
        removeFontLoadListener(
            callback: (fontUrl: string, success: boolean) => void,
        ): void;
    }

    Implemented by

    Index

    Methods

    • Gets the load status of a font.

      Parameters

      • fontUrl: string

        The URL of the font to check.

      Returns FontLoadStatus

      The load status of the font.

    • 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.

    • Resolves a font key to fontUri and fontSize for ISGNSimpleLabel. Uses the same key rules as getFontWithKey. If the resolved font has no positive size (e.g. system font with implicit size), size defaults to 36.

      Parameters

      • key: string

        Font key (uri,size, system name, etc.).

      Returns undefined | SimpleLabelFontInfo

      [fontUri, fontSize], or undefined if the key does not resolve to a font with a usable URI.

    • Subscribes to font load events.

      Parameters

      • callback: (fontUrl: string, success: boolean) => void

        Function called when a font load completes (success or failure).

      Returns void

    • Removes a font load listener.

      Parameters

      • callback: (fontUrl: string, success: boolean) => void

        The callback function to remove.

      Returns void