We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Cells.FontConfigs.SetFontSubstitutes needs Aspose.Cells.FontConfigs.SetFontFolders for Linux

Hi,



the method Aspose.Cells.FontConfigs.SetFontSubstitutes needs font folder to be set by the method Aspose.Cells.FontConfigs.SetFontFolders for system fonts installed for Linux (Ubuntu 15.10 + mono 4.2.3.4).



At the same time Aspose.Slides does not needs similar font folder setting. So, the need to set font folder by Aspose.Cells.FontConfigs.SetFontSubstitutes can be treated as an extra inconvenience when system font folder is used.



Best Regards,

Aleksey.

Hi Aleksey,

Thank you for contacting Aspose support.

First of all, please note that Aspose.Cells & Aspose.Slides are entirely two different API sets, offering completely different features. Anyway, regarding your concerns about Aspose.Cells’ font initialization & substitution, please note, the Aspose.Cells APIs first searches all available system folders for the required fonts (used in spreadsheets). In case a required font is not present, the API tries to substitute it with the one available. The Aspose.Cells.FontConfigs class has recently been exposed to provide more flexible means to set the custom font folders and to specify the font substitutions. If you set the font substitution, you are actually overriding the Aspose.Cells internal mechanism to substitute the fonts so that a particular font is always substituted by another font. If you do not set the font substitution, you have to rely on Aspose.Cells’ decision.

In my honest opinion, Aspose.Cells.FontConfigs class is a great addition to the API set where customer can control the font initialization and substitution mechanism as per their application requirements.

Hi, Babar,



thanks for your reply. But it looks very strange that Aspose.Cells.FontConfigs.SetFontSubstitutes does not work without call to Aspose.Cells.FontConfigs.SetFontFolders pointing to system font folder for Linux. Why FontConfigs.SetFontSubstitutes can not find system font folder when using along without FontConfigs.SetFontFolders - but at the same time default internal mechanism you mention does find that folder?



Note, that for Windows FontConfigs.SetFontFolders is not needed for the task to work properly.



Best Regards,

Aleksey.

Hi Aleksey,


Thank you for writing back.

I have performed a few tests on Ubuntu 15.10 under Mono, and I can confirm your concern, that is; Aspose.Cells for .NET API is not able to locate/pick the default TrueType fonts from default font location. If you check the attached snapshot, you will notice that DejaVu Sans font is available in Ubuntu but when I formatted a cell with aforementioned font and rendered the spreadsheet in PDF format, I can observe that API has incorrectly embedded the font in resultant PDF. I have raised this problem with the product team under the ticket CELLSNET-44935. Please spare us little time to properly analyze this case and revert back with updates in this regard.

C#

var book = new Workbook ();
var sheet = book.Worksheets [0];
var cells = sheet.Cells;
var style = book.CreateStyle ();
style.Font.Name = “DejaVu Sans”;
cells [“A1”].SetStyle (style);
cells [“A1”].PutValue (“Hello World!”);
book.Save ("/home/babar/Downloads/output.pdf", SaveFormat.Pdf);

Hi again,


This is to update you that the ticket logged earlier as CELLSNET-44935 has been resolved. You can try the fix against the latest version of Aspose.Cells for .NET 16.11.5 (attached). Please note, I have verified the fix by using the code snippet shared in my previous response. This time, the API has correctly embedded the DejaVu Sans font in the resultant PDF.

Please feel free to contact us back in case you have any further concerns or questions. We will be glad to help you out.

Hi, Babar,



thank you for the fix - it really works now: Aspose.Cells.FontConfigs.SetFontSubstitutes works without calling Aspose.Cells.FontConfigs.SetFontFolders for system font folder for Linux.



Best Regards,

Aleksey.

Hi Aleksey,


Thank you for the confirmation. It is good to know that you are up & running again. Please feel free to contact us back in case you need our further assistance with Aspose APIs.

The issues you have found earlier (filed as CELLSNET-44935) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.