FontSubstitutionContext class

FontSubstitutionContext class

Describes a single font substitution that occurred while loading or rendering a source document.

Instances are passed to ConversionEvents.on_font_substituted.

The FontSubstitutionContext type exposes the following members:

Constructors

Constructor Description
init Initializes a new FontSubstitutionContext.

Properties

Property Description
original_font_name The name of the font referenced by the source document but unavailable to the conversion pipeline.
reason The substitution message exactly as reported by the conversion pipeline, verbatim and unparsed.
source_file_name The file name of the source document being converted. When the source was provided as a stream that is not a io.RawIOBase, this contains a generated identifier rather than a real file name.
substitute_font_name The name of the font used as a substitute. May be None for documents whose engine reports the substitution only as descriptive text — in that case read FontSubstitutionContext.reason.

See Also