HtmlSaveOptions.ResolveFontNames

HtmlSaveOptions ResolveFontNames property. Specifies whether font family names used in the document are resolved and substituted according to FontSettings when being written into HTMLbased formats.

HtmlSaveOptions.ResolveFontNames property

Specifies whether font family names used in the document are resolved and substituted according to FontSettings when being written into HTML-based formats.

public bool ResolveFontNames { get; set; }

Remarks

By default, this option is set to false and font family names are written to HTML as specified in source documents. That is, FontSettings are ignored and no resolution or substitution of font family names is performed.

If this option is set to true, Wordize uses FontSettings to resolve each font family name specified in a source document into the name of an available font family, performing font substitution as required.

Examples

Shows how to instructs Wordize to resolved and substitute fonts according to FontSettings while exporting document to HTML.

HtmlSaveOptions htmlSaveOptions = new HtmlSaveOptions();
htmlSaveOptions.ResolveFontNames = true;
htmlSaveOptions.PrettyFormat = true;

ConverterContext context = new ConverterContext();
context.FontSettings = new FontSettings();
context.FontSettings.SetFontsFolder(MyDir+ "MyFonts", true);

Converter.Create(context)
    .From(MyDir + "Simple.docx")
    .To(ArtifactsDir + "HtmlSaveOptions.ResolveFontNames.html", htmlSaveOptions)
    .Execute();

See Also