FontInfoSubstitutionRule Class

Font info substitution rule.
Inheritance Hierarchy

Namespace:  Aspose.Words.Fonts
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public class FontInfoSubstitutionRule : FontSubstitutionRule

The FontInfoSubstitutionRule type exposes the following members.

Properties
  NameDescription
Public propertyCode exampleEnabled
Specifies whether the rule is enabled or not.
(Inherited from FontSubstitutionRule.)
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodToString (Inherited from Object.)
Remarks
According to this rule Aspose.Words evaluates all the related fields in FontInfo (Panose, Sig etc) for the missing font and finds the closest match among the available font sources. If FontInfo is not available for the missing font then nothing will be done.
Examples
Shows how to set the property for finding the closest match font among the available font sources instead missing font.
Document doc = new Document(MyDir + "Missing font.docx");

// Create a new class implementing IWarningCallback and assign it to the PdfSaveOptions class
HandleDocumentWarnings callback = new HandleDocumentWarnings();
doc.WarningCallback = callback;

FontSettings fontSettings = new FontSettings();
fontSettings.SubstitutionSettings.DefaultFontSubstitution.DefaultFontName = "Arial"; ;
fontSettings.SubstitutionSettings.FontInfoSubstitution.Enabled = true;
See Also