Set custom fonts

You can add custom font sources.

The following code snippet shows how to add a custom font source:

using GroupDocs.Viewer;
using GroupDocs.Viewer.Options;
using GroupDocs.Viewer.Fonts;
// ...

// Specify the font source.
FolderFontSource fontSource = 
    new FolderFontSource(@"C:\custom_fonts", SearchOption.TopFolderOnly);

using (Viewer viewer = new Viewer("sample.docx"))
    // Create an HTML file.
    HtmlViewOptions viewOptions = HtmlViewOptions.ForEmbeddedResources();
Imports GroupDocs.Viewer
Imports GroupDocs.Viewer.Options
Imports GroupDocs.Viewer.Fonts
' ...

Module Program
    Sub Main(args As String())
        ' Specify the font source.
        Dim fontSource As FolderFontSource = New FolderFontSource("C:\custom_fonts", SearchOption.TopFolderOnly)
        Using viewer As Viewer = New Viewer("sample.docx")
            ' Create an HTML file.
            Dim viewOptions As HtmlViewOptions = HtmlViewOptions.ForEmbeddedResources()
        End Using
    End Sub
End Module