OnFontSubstituted

ConversionEvents.OnFontSubstituted property

Fired when a font referenced by the source document is not available and is substituted (either by a customer-supplied FontSubstitute rule, by the configured default font, or by the conversion pipeline’s internal fallback).

public Action<FontSubstitutionContext> OnFontSubstituted { get; set; }

Remarks

The event is deduplicated per (SourceFileName, OriginalFontName) within a single Converter.Convert(...) call — subscribers receive at most one notification per missing font per source document. A notification that carries no font names is deduplicated by its Reason instead. Fires synchronously on the conversion thread. Not raised for image conversions.

When the load options set a DefaultFont that is not available, so that missing fonts were replaced by the engine’s own fallback font instead, one more notification is raised for the source document. Both OriginalFontName and SubstituteFontName are null, and Reason names the unavailable default font. A handler that reads only the font names skips this notification. It is raised for presentations, word processing documents, spreadsheets, PDF documents, Publisher documents and diagrams, including a word processing document attached to an email, which is reported as its own source document. It is not raised for the body of an email or for OneNote documents.

See Also