Closed j75 closed 3 years ago
Please see the document for your reference. You need to first install the font and then set the fonts folder (the folder should be accessible seamlessly there should not be any rights issue) at the start of the program (before using any other Aspose.Cells APIs). This task is compulsory for non windows os (e.g. Linux). e.g. Sample code:
// Second parameter directs the API to search the sub folders for font files
FontConfigs.setFontFolder(your_font_folder, true);
Also the above document will explain the font substitution mechanism.
Regarding the process which Aspose.Cells API follows for selection of fonts, see the below details: 1) The API tries to find the fonts on the file system matching the exact font name used in the spreadsheet. 2) If API cannot find the fonts with the exact same name, it attempts to use the default font specified under the Workbook’s DefaultStyle.Font property. 3) If API cannot locate the font defined under the workbook’s DefaultStyle.Font property, it attempts to select the most suitable fonts from all of the available fonts. 4) Finally, if API cannot find any fonts on the file system, it renders the spreadsheet using Arial.
Moreover, see the document on how to specify individual or private set of fonts for workbook rendering for your reference.
At the 2nd paragraph I said that I installed the font in a standard Linux folder ("standard" for fontconfig) but I forget to add that I also performed fc-cache
to update the font cache before running the program. And yes, then the font was used by the system (either by using fc-list
or, as I said, by opening the Excel file with LibreOffice).
@j75 ,
It looks you have sorted out your issue. Let us know with details if you still find the issue.
Yes, your example from the documentation works, thank you.
Good to know that your issue sorted out by referring to the docs. Have a good day!
Hi!
I am trying to convert an Excel file (test.xlsx from the attached zip) to PDF. test.zip
The Excel contains only a cell, written with the Angelina font downloaded from https://www.1001freefonts.com/angelina.font. When saving the workbook, I use
PdfSaveOptions#setCompliance(PdfCompliance.PDF_A_1_B)
and I am on a Linux computer (Ubuntu 20.04).pdffonts
produces the same result!So:
Aspose.Cells
to pick a font ?