Nutrient Web SDK

ReferenceFontCallback

Type Alias FontCallback

On Standalone, this callback receives the name of a font to retrieve as an argument and you can return from it a Promise that resolves to a Blob with the font data to use.

See this guide to learn more.

Type Alias
Type Signature
type FontCallback = (fontName: string) => Promise<Blob>

Example

Create a custom font for retrieving "Arial.ttf"

new NutrientViewer.Font({
name: "Arial.ttf",
callback: name => fetch(`https://example.com/${name}`).then(r => r.blob())
})

Type Declaration

Parameters

fontNamestring

The name specified on the same Font constructor.

Returns