FontInfoSubstitutionRule Class
Wordize.Fonts.FontInfoSubstitutionRule class. Font info substitution rule.
FontInfoSubstitutionRule class
Font info substitution rule.
public class FontInfoSubstitutionRule : FontSubstitutionRule
Properties
Name | Description |
---|---|
Enabled { get; set; } | Specifies whether the rule is enabled or not. |
Remarks
According to this rule Wordize evaluates all the related fields in font info (Panose, Sig etc) for the missing font and finds the closest match among the available font sources. If font info is not available for the missing font then nothing will be done.
Examples
Shows how to enable and disable font substitution rules. Demonstrates how to specify default substitution font.
FontSettings fontSettings = new FontSettings();
fontSettings.SetFontsFolder(MyDir + "MyFonts", true);
// Disable font name substitution rule, which is enabled by default
fontSettings.SubstitutionSettings.FontNameSubstitution.Enabled = false;
// Disable font config substitution rule, which is disabled by default
fontSettings.SubstitutionSettings.FontConfigSubstitution.Enabled = false;
// Disable table substitution rule, which is enabled by default
fontSettings.SubstitutionSettings.TableSubstitution.Enabled = false;
// Disable font info substitution rule, which is enabled by default
fontSettings.SubstitutionSettings.FontInfoSubstitution.Enabled = false;
// Enable default font rule, which is enabled by default
fontSettings.SubstitutionSettings.DefaultFontSubstitution.Enabled = true;
fontSettings.SubstitutionSettings.DefaultFontSubstitution.DefaultFontName = "Noticia Text";
// Specify font setting for concrete document conversion operation.
ConverterContext context = new ConverterContext();
context.FontSettings = fontSettings;
// Missed fonts will be substituted with default "Noticia Text" font if it is available.
Converter.Create(context)
.From(MyDir + "Simple.docx")
.To(ArtifactsDir + "FontSubstitutionNoticiaText.pdf")
.Execute();
See Also
- class FontSubstitutionRule
- namespace Wordize.Fonts
- assembly Wordize