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,
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,
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,
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.