Excel conversion produces wrong font

Product & Version:

Apose.total_for_cpp_windows_26.6.0
Platform: Windows 11
I saw my issue with that configuration, then I overlayed
Aspose.Cell-for-Cpp-26.7-windows and Aspose.PDF.Cpp.26.7 and continue to see my issue

Platform: Windows 11

Issue:
My issue is when I convert the attached Excel document for conversion to PDF, the resulting PDF is wrong.

In this Excel file we use an installed Aptos Narrows Font and an Arial font. When we convert to PDF the resulting PDF does not have a Aptos Narrow font but a substitute font is used, SimSn-ExtB

I tried this same file on the Convert any file, save as PDF, Word, HTML, CSV, JPG, HTML, ODS, BMP, PNG, SVG, TIFF, XPS and more. Immediate download, 100% Free Online site and it did not produce a correct PDF file either, the substituted font was Malgun Gothic.

Doing this similar test with a word document does produce a PDF with the correct font.

Input: fonttest.xlsx
Output PDF: fonttest.pdf

Code Snippet:

Aspose::Cells::Startup();

// Set up warning callback
FontWarningCallback fontWarningCallback;
Aspose::Cells::LoadOptions options;
options.SetWarningCallback(&fontWarningCallback);

LOG("Loading Excel workbook...");
auto str = Aspose::Cells::U16String(inputFilePath.c_str());
// Load the Excel workbook with warning callback
Aspose::Cells::Workbook workbook(str, options);
LOG("Excel workbook loaded successfully.");

// Check if license file exists
if (!fileExists("Aspose.Total.C__.lic")) {
	LOG("WARNING: License file 'Aspose.Total.C__.lic' not found in current directory");
}

//Licensing
try {
	Aspose::Cells::License license;
	license.SetLicense(u"Aspose.Total.C__.lic");
	LOG("License applied successfully for Cells.");
}
catch (...) {
	LOG("WARNING: Failed to apply license for Cells - continuing anyway");
}


if (outputExtension == "pdf") {
	LOG("Saving Excel file as PDF.");
	workbook.Save(Aspose::Cells::U16String(outputFilePath.c_str()), Aspose::Cells::SaveFormat::Pdf);
	LOG("Excel file saved successfully.");
}

Aspose::Cells::Cleanup();

Here are the sample files

Font.7z (24.7 KB)

@wlaube
Please check the docs:

If Aptos Narrows is not in the C:\Windows\Fonts, please set font dir.

Aptos Narrows font is in the c:\windows\fonts directory.

I used the Aspose Convert any file, save as PDF, Word, HTML, CSV, JPG, HTML, ODS, BMP, PNG, SVG, TIFF, XPS and more. Immediate download, 100% Free Online site to convert my file and it failed also, so is this web site not configured to support Aptos Narrows fonts ?

Lastly, I did the same test but i used a Word document and it converted correctly. Its only the Excel document with the Aptos Narrows font that is getting substituted.

So if it works for Word, I must have my machine configured correctly.

Am I missing something here with that logic ?

Thanks

@wlaube

Thank you for the additional information and for confirming that the font is correctly installed on your system. Your observation regarding the successful conversion in Word versus the substitution in Excel is a valuable detail for our investigation.

We have updated the internal ticket with these new findings, including the fact that the issue persists on our online conversion tools. This suggests the behavior may be specific to how the Aspose.Cells rendering engine handles this particular font family compared to other formats.

The development team is currently investigating why the substitution is occurring despite the font being available in the system directory. We will continue to look into this and provide you with an update as soon as we have more information or a resolution.

@wlaube
Hi,
Please use the following code to verify whether the font has loaded successfully. If it fails to load, please send us your font file; this will help us troubleshoot the issue.
bool b = FontConfigs::IsFontAvailable(u"Aptos Narrow");
Typically, if your font is installed in the c:\windows\fonts directory, this code will return true.