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.
Promise
Blob
See this guide to learn more.
The name specified on the same Font constructor.
name
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());}) Copy
new NutrientViewer.Font({ name: "Arial.ttf", callback: name => fetch(`https://example.com/${name}`).then(r => r.blob());})
On Standalone, this callback receives the name of a font to retrieve as an argument and you can return from it a
Promisethat resolves to aBlobwith the font data to use.See this guide to learn more.