DefaultFontSubstitutionRule Class
Wordize.Fonts.DefaultFontSubstitutionRule class. Default font substitution rule.
DefaultFontSubstitutionRule class
Default font substitution rule.
public class DefaultFontSubstitutionRule : FontSubstitutionRule
Properties
Name | Description |
---|---|
DefaultFontName { get; set; } | Gets or sets the default font name. |
Enabled { get; set; } | Specifies whether the rule is enabled or not. |
Remarks
This rule defines single default font name to be used for substitution if the original font is not available.
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