brepjs API Reference
    Preparing search index...

    Function loadFont

    • Load and register an OpenType/TrueType font for use with text drawing functions.

      The font is fetched (if a URL string) or parsed (if an ArrayBuffer) and stored in an internal registry keyed by fontFamily. The first font loaded is also registered as 'default'.

      Parameters

      • fontPath: string | ArrayBuffer

        URL string or raw ArrayBuffer of the font file.

      • fontFamily: string = 'default'

        Registry key for later retrieval (defaults to 'default').

      • force: boolean = false

        If true, overwrite a previously loaded font with the same key.

      Returns Promise<any>

      The parsed opentype.js Font object.