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

Free Support Forum - aspose.com

EXCLUDE default fonts folders

Hi my question is in the context of Java/Linux…

I currently use FontsLoader.loadExternalFonts() to set the folder containing the fonts I want to use. However, it seems to be adding the folder to a default folder list (which includes “/usr/share/fonts”) rather than setting the exact folder set, because I see rendering differences if I remove fonts from the default folder. I only want Aspose.Slides to use the fonts in the folder(s) I specify.

The javadoc is unclear about exact behavior of FontsLoader.loadExternalFonts(). Other Aspose products (e.g. Words) have APIs that clearly allow you specify font folders in addition to or in place of the defaults.

Can you verify the intended behavior of FontsLoader.loadExternalFonts()? Is there an alternative API to set font folders so that I exclude the default folders?



I have observed your comments. I like to inform that If you intend to load external fonts other than installed system fonts then you will have to use FontsLoader.loadExternalFonts(String[]) method and it will be used for entire program as long as it will be running so you need to load only once for application. In order to avoid the large number of fonts being copied using loadExternalFonts method, I suggest you to please copy only required fonts in a predefined directory and then load fonts externally from that directory only. It will help in resolving issue of loading unnecessary fonts during rendering and thus improving the rendering performance.

Aspose.Slides doesn’t looks for fonts at all. JRE should be properly configured. And it should know about all fonts installed in a system (Windows or Linux). JRE has its own font configurations and Aspose.Slides uses JRE fonts functionality. Also as shared earlier, Aspose.Slides has additional functionality FontsLoader.loadExternalFonts(String[] paths) which allows to use fonts which are not installed in system folders (which are not accessible through JRE functionality).