Function preloadFont

  • Preload fonts and optionally pre-generate the SDF textures for particular glyphs up front. This is to avoid ondemand font generation can take long.

    If working in CSP-restricted environment, call disableText3DWorker before to avoid errors

    Parameters

    • OptionalfontUrl: string

      url of the font file served.

    Returns Promise<string>

    A promise that resolves when the font is loaded