Type Alias FontConfig

FontConfig: {
    fonts?: (DefaultFontIndex | FontIndex | FontFile)[];
}

Type declaration

  • Optionalfonts?: (DefaultFontIndex | FontIndex | FontFile)[]

    The set of fonts available to the Document Authoring system. If unset the DefaultFontIndex is used.

    Individual fonts can be added directly using a FontFile or loaded by the system as they are needed using a pre-built FontIndex that all lists all available fonts. A FontIndex is the recommended way to provide a set of fonts to the system in a production environment.

    Providing two additional fonts next to the built-in default fonts. In this scenario the system will load both fonts during initialization:

    fonts: [
    DocAuth.defaultFontIndex,
    { type: 'file', blob: fetch('/fonts/awesome.ttf') },
    { type: 'file', blob: fetch('/fonts/more-awesome.ttf') },
    ],

    Providing multiple additional fonts using a font index in addition to the built-in default fonts. In this scenario the system will only load the fonts that are actually needed:

    fonts: [
    DocAuth.defaultFontIndex,
    {
    type: 'index',
    index: fetch('/fonts/font-index.json'),
    loadFn: (name) => fetch(`/fonts/${name}`),
    },
    ],