Word save as PDF problem with Font identification wingding_x

good day,
when I save the document as a PDF, the font wingding2 and wingding3 are saved in my PDF as the font wingding.

All three fonts are installed. The problem only occurs on the server. If I perform the test on my computer, the font identification is correct. I have it set in both environments to CultureInfo(“cs-CZ”).

Don’t know why this is happening?
Thank you in advance for your reply
TB

@benestom Could you please attach your input and output documents along with the problematic fonts? We will check the issue and provide you more information.

File:
Znaky2.docx (10.2 KB)
Font:
fonts.zip (103.6 KB)
This is how my conversion to PDF looks like:
image.png (33.1 KB)

@benestom Unfortunately, I cannot reproduce the problem on my side. I have used the following code for testing:

Document doc = new Document(@"C:\Temp\in.docx");

doc.FontSettings = new FontSettings();
doc.FontSettings.SetFontsSources(new FontSourceBase[] { new FolderFontSource(@"C:\\Temp\\fonts", true) });

doc.Save(@"C:\Temp\out.pdf");

C:\Temp\font folder contain the fonts you have attached and Calibri font. Here is the produced output:
out.pdf (47.7 KB)

Have you tried using IWarningCallback to detects whether fonts on your server are substituted upon rendering to PDF?

thank you for answer.
If I use the code, the font works. To another folder.

If I point to the C:\Windows\Fonts folder in the same way, even though the fonts are there, it doesn’t work. Don’t know why? I’m just reminding you that this behavior is only on the server.

The problem persists
If I reference a font:

doc.FontSettings.SetFontsSources(new FontSourceBase[] { new FolderFontSource(@"C:\\Temp\\fonts", true) });
  • the Wingdings 2 font is fine, but the other fonts are missing.

If I reference a font:

doc.FontSettings.SetFontsSources(new FontSourceBase[] { new FolderFontSource(@"C:\\Temp\\fonts", true), new FolderFontSource(@"C:\\Windows\\Fonts", true) });
  1. if font Wingdings 2 IN “C:\Windows\Fonts” - IT IS BAD, NOT CORECT
  2. if font Wingdings 2 NOT IN “C:\Windows\Fonts” - IS ok :slight_smile:

Why doesn’t the WINGDNG2 style work in the win/fonts folder?

It can’t be language differences. The server is in English and I have a local computer in Czech.
The names of the styles are also changing, see the table
local compute (C:\Windows\Fonts) - OK; name - Wingdings 2 Normální
IIS Server (custom folder) - ok; name - WINGDNG2
IIS Server (C:\Windows\Fonts) - Bad; name - Wingdings 2 Regular

@benestom Most likely the problem occurs because the application does not have access to read the fonts from the specified folder. Please try using SystemFontSource instead of FolderFontSource:

doc.FontSettings.SetFontsSources(new FontSourceBase[] { new SystemFontSource(), new FolderFontSource(@"C:\\Temp\\fonts", true) });

Also, please try using the following code to check what fonts are available for Aspose.Words:

// Specify where Aspose.Words will look for fonts.
doc.FontSettings = new FontSettings();
doc.FontSettings.SetFontsSources(new FontSourceBase[] { new SystemFontSource(), new FolderFontSource(@"C:\Temp\fonts\", true) });
// now you can list the fonts avaialbe in the specified font sources (for testing purposes)
foreach (FontSourceBase src in doc.FontSettings.GetFontsSources())
{
    foreach (PhysicalFontInfo fontInfo in src.GetAvailableFonts())
        Console.WriteLine(fontInfo.FullFontName);
}

Aspose.Words need to read the fonts to be able to use them. If the font files are not accessible, this might causes the problems.