PDF created from Aspose.Cells has a different font embedded

Hi, We are utilizing Aspose.Cells 8.5 (Java) to create PDFs from Excel Charts. The font used in Chart is HelveticaNeueLT Std, however the resultant PDF has Latin Wide font embedded in it. The HelveticaNeueLT Std font is installed on the system. What is the font fallback mechanism used by Aspose.Cells? And how can we ensure that same font as used in the document gets in the output PDF? The sample chart file and PDF is attached. Thanks in advance for your help!

Hi Raghav,


Thank you for the samples.

First of all, please go through these articles for better understanding on how the Aspose.Cells for Java API uses the TrueType fonts. Please note, Aspose.Cells APIs currently support TTF & TTC font types. The API tries to substitute the font used in the spreadsheet with any available font if it does not find the required one by its exact name on the system where conversion process is being executed. If the required fonts are available to the API then substitution will not occur and you will get the exact font embedded in the resultant PDF. Although Aspose.Cells APIs try to locate the required fonts in the usual installation directories, however, it is best that you should tell the API where to look while using the CellsHelper.setFontDir method at the very start of your application.

In case setting the font directory does not help then please give a try to the latest version of Aspose.Cells for Java 8.5.2.4 and let us know of your feedback.

Hi Babar, Thank you for your quick feedback. I will review the suggested articles and let you know if I have any additional questions.


Regards,
Raghav

Hi Raghav,


Sure, please feel free to contact us back in case you have any further questions or concerns.

Hi Babar, I have some additional questions on this subject.


As per one of the article - "If Aspose.Cells 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."
Regarding the above statement, can you provide more details on how and from where most suitable font is selected. Does aspose have its own set of fallback TTF fonts embedded within its library, or does it always select from the fonts available on the system?

Further we found that font substitution is not always consistent across different library versions. For instance, in the attached outputs you will notice that v8.5.0.0 substituted HelveticaNeueLT Std with LatinWide, whereas v8.4.2.5 and the latest v8.5.2.4 substituted the same font with ArialUnicodeMS. All these outputs were created on the same machine. Thanks in advance for providing an insight on this matter.

Thanks & Regards,
Raghav Arora
Hi Raghav,

ragarora:
As per one of the article - "If Aspose.Cells 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."
Regarding the above statement, can you provide more details on how and from where most suitable font is selected.

In case of substitution, the font selection is based on the ability to render a particular glyph. If more than on available fonts could render the glyph then the API uses the one that is close to the missing font, such as the fonts within same family.

ragarora:
Does aspose have its own set of fallback TTF fonts embedded within its library, or does it always select from the fonts available on the system?

If there are no fonts available on the machine then API simulates the Ariel font to render all possible glyph.

ragarora:
Further we found that font substitution is not always consistent across different library versions. For instance, in the attached outputs you will notice that v8.5.0.0 substituted HelveticaNeueLT Std with LatinWide, whereas v8.4.2.5 and the latest v8.5.2.4 substituted the same font with ArialUnicodeMS. All these outputs were created on the same machine.

It could be due to the reason that the implementation of font search/loading mechanism has been altered recently (between 8.5.2 & 8.6.0) to handle scenario where preset font directory was required to be overridden for each conversion cycle. That said, I will further check with the concerned member of the product team to get more details in this regard.

Thanks Babar for your feedback. Could you please also take up with Product team regarding support for OTF fonts. Is it on the roadmap? Our customers are finding it hard to procure TTF variants of certain fonts, e.g. HelveticaNeueLT Std.


Regards,
Raghav

Hi Raghav,


We have discussed your concerns regarding the diverse font substitution as stated in your previous response. Please note, along with the scenario as narrated earlier, we have also fixed a few bugs related to the font replacement logic for chart rendering where the preset font was not able to render a few glyph.

how can we ensure that same font as used in the document gets in the output PDF?

If you wish to be sure that every time a spreadsheet is converted to PDF, the API uses the same fonts, you have to install/place the exact fonts used in the spreadsheet on the machine where conversion is taking place (also explicitly point the API to use those fonts). In this case, no font substitution will occur and the resultant PDF will have the exact fonts as in the spreadsheet.

Regarding the support of OTF, I am afraid, we currently do not have this feature on our road map. In case we get more requests in this regard, we will bring it up on Aspose.Cells future plans.

Hi Babar, I appreciate your quick follow up, I will let you know if I have any additional queries.


Regards,
Raghav

Hi Raghav,


You are most welcome. Please feel free to contact us back in case you need our further assistance with Aspose APIs.

Hi,

Can you please open a ticket with development team to support OTF fonts which may be helpful for Aspose as well as us for further tracking?

Thanks,

Neeraj

HI Neeraj,


As discussed earlier, we currently do not have any plans to provide support for OTF font type with Aspose.Cells APIs, however, we will shortly log a ticket for tracking purposes and provide the Id here for your reference.

Hi again,


We have logged a feature request (CELLSNET-43975) to provide the support for the OTF fonts while rendering spreadsheets with Aspose.Cells APIs. Please note, we have currently logged the ticket for .NET component because all the features are first implemented in .NET and then ported out to create the Java build. Moreover, we will be collecting requests from other users in this regard, and based on that we will formulate the implementation plan. As soon as we have made some significant progress in achieving the requested feature, we will update you in reference to the aforesaid ticket.

@ragarora,
Please try our latest version/fix: Aspose.Cells for .NET v20.7.3:
Aspose.Cells20.7.3 For .Net2_AuthenticodeSigned.Zip (5.4 MB)
Aspose.Cells20.7.3 For .Net4.0.Zip (5.4 MB)

Your issue should be fixed in it.

Let us know your feedback.

The issues you have found earlier (filed as CELLSNET-43975) have been fixed in Aspose.Cells for .NET v20.8. This message was posted using Bugs notification tool by Amjad_Sahi