Font changes to a different one when hosted on Azure App Service

We’re using OCR-A Extended font for some part of the documents. The application works fine locally, but when hosted on Azure App Services, the aforementioned font changes to a different one. When I inspect it using LibreOffice, the application says it is now MingLiU. I tried to find the issue and stumbled upon this article but it looks like it is already outdated. I believe it is not called Windows Azure anymore and I cannot find the “full trust” configuration in the Azure portal either.

The code as simple as this:

Document doc = new Document("doc.docx");
doc.Save("doc.pdf");

@vdolosa It looks like Aspose.Words can’t find the specified font. Try to directly specify the folder where Aspose.Words will look for fonts and place your fonts there.

Document doc = new Document("doc.docx");
FontSettings.DefaultInstance.SetFontsSources(new FontSourceBase[]
{
    new SystemFontSource(), new FolderFontSource("/path/to/fonts/", true,1)
});
doc.Save("doc.pdf"); 
1 Like