I have observed your comments. I like to share that you can get fonts from any external website and use them in your application. Can you please visit this article to solve your issue related to fonts. This will help you to achieve your requirements. Please share feedback with us if there is still an issue.
Thank Adnan, can you give me an example of “any external website” with fonts? It will be useful if your documentation will list of common fonts that are needed. Since, right now I am doing lots of trail and error to try and get Aspose to work.
I found this 31 Free Arial Fonts · 1001 Fonts web site with fonts, but since the Aspose error message doesn’t specify which fonts are missing, I don’t know which fonts I need to get. How can I solve this problem without spending days trying different fonts?
This making working with Aspose Slide difficult in production systems. Since we regularly will need to update the system with new fronts. Is there away to set a fallback font? So the conversion will not fail, just have the wrong fonts.
I have observed your comments. I have a shared link, you can download fonts that are used in your presentation from link i have shared and place them in directory and than you can load them externally without installing them. Please visit this link for more details and how to load fonts externally. Also you can set default fonts using Aspose.Slides. Please visit this link in case of you need to set default fonts. Please share feedback with us if there is still an issue.
Thanks, I am going to set the default font and see how does it work.
I think you have an error in the documentation. Doesn’ the load options should in the constructor? For example new Presentation(“input.pptx”, LoadOptions)
From the docs:
// Use load options to define the default regualr and asian fonts
LoadOptions lo = new LoadOptions(LoadFormat.Auto);
// Do Some work and perform presentation/slides rendering
Presentation presentation = new Presentation(“input.pptx”);
First the problem, Linux OS don’t have to good support for MS types as results when trying to convert powerpoint to HTML on Linux OS the conversion fails in the save method since the fonts are missing.
One solution that was proposed was to get the missing fonts and include them in the application using the external load method. But, this solution doesn’t scale in my case, since I can’t anticipate all the different fonts that will be existing in production.
The solution was to set the default fonts to an open source fonts by google. I include here the code as a reference for other users.
I would like write a logic that checks for missing fonts and if there is, then use the default fonts.
Do you have a utility that gives you the fonts that are on the system? If not, can you give me the name of the exception I should catch to detect missing fonts? I couldn’t find it in the message Aspose printed.
I discovered that I still can convert to HTML even though I am missing some of the fonts. For example, my presentation uses Calibri and Gill Sans. But my OS only has Gill Sans, and I still can save the presentation.
That means that I need a different method to determine with Aspose is going to throw an error when saving to HTML. The easiest way forward, I think, is for you to give the Exception Class that Aspose Slide is throwing.
Actually, Aspose.Slides tries to find the font used in presentation. if that is installed then Aspose.Slides use that font. However, for some reason if that font is either not installed or inaccessible then Aspose.Slides looks for default font for that Operating System. If default font is not available then Aspose.Slides throw exception related to font.