Font resolution events
Detect missing fonts at load time and handle them before your users notice.
Documents move between systems. Fonts don't always follow. Now you can detect and handle unsupported fonts before your users notice.
The problem
A contract created in Word with Calibri looks right on the author's machine. Open it in a web-based editor without that font installed, and the layout shifts — line breaks change, tables overflow, headers wrap differently. Your users see a broken document and blame your app, not the missing font.
Until now, there was no reliable way to detect this at load time and respond before the damage was visible.
The FontsResolved event
SuperDoc now emits a fonts-resolved event after loading a document. It tells you exactly which fonts loaded successfully and which ones are missing from the user's environment.
superdoc.on('fonts-resolved', ({ documentFonts, unsupportedFonts }) => {
if (unsupportedFonts.length > 0) {
showNotification(
`Unsupported fonts: ${unsupportedFonts.join(', ')}. Layout may differ from the original.`
);
}
});
What you can build with it
The event gives you the data. What you do with it is up to your product:
- Show a user-facing alert when fonts are missing, so users understand why the document looks different
- Dynamically update toolbar font options to only show fonts that are actually available
- Log font issues to track which fonts your users' documents rely on most
- Load fonts on demand from a CDN or your own font server when a missing font is detected
superdoc.on('fonts-resolved', async ({ unsupportedFonts }) => {
for (const font of unsupportedFonts) {
const hosted = await fetchFontFromCDN(font);
if (hosted) {
document.fonts.add(hosted);
}
}
});
Consistent rendering across the pipeline
Font handling is now more predictable across the full lifecycle: editing, rendering, and export. Mixed-style runs from imported .docx files — where a single paragraph uses multiple fonts — resolve consistently instead of falling back unpredictably.
The result: what your users see in the editor matches what they get when they export or print.
Get started
Listen for the fonts-resolved event on any SuperDoc instance. No configuration needed — the event fires automatically on every document load.