Non-word modules can't find font folder

Hello Support,

We have a java-total license and have built a proof of concept application to test your modules word, cells (excel), slides (powerpoint), diagram (visio), pdf (conversion cgm to png) and ocr.

Another open issue is required fonts which are not installed on Openshift deployment (Linux-redhat). We installed an own private folder which works perfectly with your word module but not for the other modules.

Application has no access to central font folder (/usr/share/fonts). We could install our true type fonts maybe within folder ~/.local/share/fonts instead of a folder in temp area, but why is your described solution for word not working for other modules?

Currently, we define folder location with this commands:

FontSourceBase[] updatedFontSources = {originalFontSources[0], folderFontSource};
FontSettings.getDefaultInstance().setFontsSources(updatedFontSources);

Second one we’ve added because we thought it would help that non word modules would find font folder.

@alexey.butalov,

For Aspose.Cells for Java, you may set your private/custom folder (which contains all the true type fonts) via FontConfigs class which has a number of ways to set custom font directories as detailed (in the examples) in the document on configuring fonts. So, kindly use any of the methods at the start of the application, that is; before invoking any other objects of Aspose.Cells APIs to make it work.

Regarding other APIs, Aspose.PDF, Aspose.Slides, Aspose.Diagram and Aspose.OCR, our respective teams will evaluate and get back to you soon.

@alexey.butalov,
As for Aspose.Slides, please try to load your custom fonts using FontsLoader as shown below:

var folderPaths = new String[] { "path_to_font_folder" };
FontsLoader.loadExternalFonts(folderPaths);

More examples: Custom PowerPoint Font in Java|Aspose.Slides Documentation

@alexey.butalov

Below code samples can be used to set the font paths or font sources in Aspose.PDF for Java:

FontRepository.getSources().clear();
FontSource fs = new FolderFontSource(dataDir  + "customfonts\\");
FontRepository.getSources().add(fs);
java.util.List<String> fontPaths = new java.util.ArrayList<String>();
fontPaths.add(dataDir  + "customfonts\\");
FontRepository.setLocalFontPaths(fontPaths);

Regarding Aspose.OCR, we are afraid that we still need to check whether it is possible to set the custom font path or folder for the API to access. We are checking it and will be sharing with you soon.

@alexey.butalov

Below is the method to set the font folder in Aspose.OCR for Java:

You can pass the full path with font name or point some fonts from the system fonts. For example “Times New Roman”.

It looks like:

AsposeOCR.SaveMultipageDocument("D://java21.pdf", Format.Pdf, t, "Arial", PdfOptimizationMode.AGGRESSIVE);