@rendley/sdk - v1.15.5
    Preparing search index...

    Class FontRegistry

    Manages custom fonts loaded into the document and tracks the metadata needed to serialize them.

    Index

    Constructors

    Properties

    fonts: IFontFaceDescriptor[]

    Methods

    • Removes all registered fonts from the document and clears the registry.

      Returns void

      Nothing.

    • Loads all @font-face rules found in a CSS file.

      Parameters

      • name: string

        Font family name to register for the discovered faces.

      • cssUrl: string

        URL of the stylesheet containing @font-face declarations.

      • OptionalcustomData: Map<string, unknown>

        Optional metadata stored alongside each registered font.

      Returns Promise<void>

      A promise that resolves after all matching font faces have been loaded.

    • Loads a font directly from a font file URL.

      Parameters

      • name: string

        Font family name to register.

      • url: string

        URL of the font file.

      • Optionaldescriptors: FontFaceDescriptors

        Optional FontFace descriptors such as weight or style.

      • OptionalcustomData: Map<string, unknown>

        Optional metadata stored alongside the registered font.

      Returns Promise<void>

      A promise that resolves after the font has been loaded and added to document.fonts.

    • Removes a registered font family from the document and registry.

      Parameters

      • fontFamily: string

        Font family name to remove.

      Returns void

      Nothing.

    • Preloads registered fonts for PIXI HTMLText rendering.

      Returns Promise<void>

      A promise that resolves after each registered font has been requested through PIXI.HTMLText.

    • Serializes the registered fonts and their metadata.

      Returns {
          fonts: {
              customData?: [string, unknown][];
              descriptors?: { style?: string; weight?: string };
              family: string;
              src: string;
          }[];
      }

      The serialized font registry payload.

    • Restores a font registry from serialized data.

      Parameters

      • data: unknown

        Serialized font registry payload to validate and load.

      Returns Promise<FontRegistry>

      A promise that resolves to the deserialized font registry.