FontSettings.SetFontsFolder
FontSettings SetFontsFolder method. Sets the folder where Wordize looks for TrueType fonts when rendering documents or embedding fonts. This is a shortcut to SetFontsFolders for setting only one font directory.
FontSettings.SetFontsFolder method
Sets the folder where Wordize looks for TrueType fonts when rendering documents or embedding fonts. This is a shortcut to SetFontsFolders
for setting only one font directory.
public void SetFontsFolder(string fontFolder, bool recursive)
Parameter | Type | Description |
---|---|---|
fontFolder | String | The folder that contains TrueType fonts. |
recursive | Boolean | True to scan the specified folders for fonts recursively. |
Examples
Implementation of IWarningCallback to get font substitution warnings.
private class FontSubstitutionWarningCallback : IWarningCallback
{
public void Warning(WarningInfo info)
{
if (info.WarningType == WarningType.FontSubstitution)
{
Console.WriteLine(info.Description);
}
}
}
Demonstrates how to specify a fonts folder in the default font settings and use a warning callback to receive notifications about font substitution during document rendering.
Wordize.Settings.DefaultFontSettings.SetFontsFolder(MyDir + "MyFonts", true);
ConverterContext context = new ConverterContext();
context.WarningCallback = new FontSubstitutionWarningCallback();
Converter.Create(context)
.From(MyDir + "Simple.docx")
.To(ArtifactsDir + "FontSubstitution.pdf")
.Execute();
See Also
- class FontSettings
- namespace Wordize.Fonts
- assembly Wordize