Hi,
We have documents that have multiple fonts. When converting from DOCX to PDF, one of the fonts(FS Humana) is transformed in Arial. The font is installed on the server. How can we make Aspose aware about the new font?
Ovidiu.
Hi,
We have documents that have multiple fonts. When converting from DOCX to PDF, one of the fonts(FS Humana) is transformed in Arial. The font is installed on the server. How can we make Aspose aware about the new font?
Ovidiu.
@omarinoiu The problem might occur because the font cannot be found or accessed by Aspose.Words and the missed fonts are substituted. You can implement IWarningCallabck to get a notification when font substitution is performed.
You can try explicitly specify location where Aspose.Words should look for fonts. If the problem still persist, please attach your document and the problematic font here for testing. We will check the issue on our side and provide you more information.
We have two separated environments: one running Windows Server 2016 the other one Windows Server 2019. We’ve managed to make it work but only on windows server 2016(#14393). The same code on windows server 2019(#17763) replaces the font with Arial. Both server have the font installed. Is there a known issue on windows server 2019?
Thanks!
@omarinoiu The problem might occur because Aspose.Words cannot access the required fonts. Could you please check whether the required fonts are available to Aspose.Words? You can do this using the following simple code:
foreach (FontSourceBase src in settings.GetFontsSources())
{
foreach (PhysicalFontInfo fontInfo in src.GetAvailableFonts())
Console.WriteLine(fontInfo.FullFontName);
}
Where settings
is FontSettings
used to render the document. If you use default instance, then use the following code to get FontSettings
:
FontSettings settings = FontSettings.DefaultInstance;