Cannot find any fonts installed on the system reported on REHL

The Aspose 16.1.0 used to generate a PPTX, the code work well on Windows but encounter below error when running on REHL5 64 bit edition
I checked the forum, some thread suggest using FontsLoader.loadExternalFonts(_fontDir);
http://www.aspose.com/docs/display/slidesjava/Using+Custom+Fonts+without+Installing+them

But I do not think it is proper for me. My code can be running against multiple environment with different OS. The _fontDir will be different from env to env.

Caused by: class com.aspose.slides.ms.pbdb106a0.co: Cannot find any fonts installed on the system.
com.aspose.slides.p6a2feef8.p9f36407e.j.do(Unknown Source)
com.aspose.slides.p6a2feef8.p9f36407e.j.do(Unknown Source)
com.aspose.slides.p6a2feef8.p9f36407e.j.do(Unknown Source)
com.aspose.slides.vn.do(Unknown Source)
com.aspose.slides.vf.(Unknown Source)
com.aspose.slides.vf.do(Unknown Source)
com.aspose.slides.bir.int(Unknown Source)
com.aspose.slides.bir.static(Unknown Source)
com.aspose.slides.bhw.do(Unknown Source)
com.aspose.slides.bhw.do(Unknown Source)
com.aspose.slides.bhw.do(Unknown Source)
com.aspose.slides.bhw.(Unknown Source)
com.aspose.slides.TextFrame.do(Unknown Source)
com.aspose.slides.TextFrame.do(Unknown Source)
com.aspose.slides.TextFrame.goto(Unknown Source)
com.aspose.slides.bv.do(Unknown Source)
com.aspose.slides.yg.do(Unknown Source)
com.aspose.slides.yg.do(Unknown Source)
com.aspose.slides.eb.do(Unknown Source)
com.aspose.slides.bbb.do(Unknown Source)
com.aspose.slides.auq.do(Unknown Source)
com.aspose.slides.auq.do(Unknown Source)
com.aspose.slides.Presentation.do(Unknown Source)
com.aspose.slides.Presentation.do(Unknown Source)
com.aspose.slides.Presentation.do(Unknown Source)
com.aspose.slides.Presentation.save(Unknown Source)

BTW, I believe my presentation only used [Arial, Calibri]

Hi Rui,

I have observed the issue shared by you and like to share that Aspose.Slides load the fonts used in presentation that are registered and visible via your Java environment or which you are loading manually from a predefined location using FontsLoader.LoadExternalFonts() method. If you are having exception while loading fonts then possible issue may be that fonts are missing in your environment. In this case loading fonts externally is a viable option. Can you please share why loading fonts externally is not proper for you. There seems no issue with API as you have already mentioned that using same code in Windows has no issue. I also suggest you to please check the installed fonts list using the sample code shared over this link.

Many Thanks,

Thanks for your reply. Here is my Linux env fonts info:

[idcuser@idp-app ~]$ java ListFonts
Bitstream Charter
Courier 10 Pitch
Cursor
Dialog
DialogInput
Lucida Bright
Lucida Sans
Lucida Sans Typewriter
Monospaced
SansSerif
Serif
Utopia

However, I do not know which fonts were missed cause Aspose.Slides report Cannot find any fonts installed on the system.
I can not use the external load because (1) I have no idea which fonts are needed to be loaed (2)my code will running on different type env: Windows, REHL, OpenOS, Unix etc. I should not hard code font_dir to be loaded in my code.
I believe my presentation only used [Arial, Calibri]

Hi Rui,

I have observed the list of fonts visible to Java on your end. I am unable to observe Calibri and Arial fonts in the list that you have shared that these fonts have been used in your presentation. If you are unable to use LoadExternal fonts method on your end then you need to ensure that the fonts used in your presentation are properly installed and available to Java before working with that application using Aspose.Slides for Java. Please share, if I may help you further in this regard.

Many Thanks,

Hi,


I have installed the MS TrueType core my REHL
rpm -Uvh msttcore-fonts-2.0-3.noarch.rpm
But Aspose still reported “Cannot find any fonts installed on the system.”
Could you pls help guide me how to enable trace to show more details about which fonts are missed in my environment? I attached the trace to you
Caused by: class com.aspose.slides.ms.pbdb106a0.co: Cannot find any fonts installed on the system.
com.aspose.slides.p6a2feef8.p9f36407e.j.do(Unknown Source)
com.aspose.slides.p6a2feef8.p9f36407e.j.do(Unknown Source)
com.aspose.slides.p6a2feef8.p9f36407e.j.do(Unknown Source)
com.aspose.slides.vn.do(Unknown Source)
com.aspose.slides.vf.(Unknown Source)
com.aspose.slides.vf.do(Unknown Source)
com.aspose.slides.bir.int(Unknown Source)
com.aspose.slides.bir.static(Unknown Source)
com.aspose.slides.bhw.do(Unknown Source)
com.aspose.slides.bhw.do(Unknown Source)
com.aspose.slides.bhw.do(Unknown Source)
com.aspose.slides.bhw.(Unknown Source)
com.aspose.slides.TextFrame.do(Unknown Source)
com.aspose.slides.TextFrame.do(Unknown Source)
com.aspose.slides.TextFrame.goto(Unknown Source)
com.aspose.slides.bv.do(Unknown Source)
com.aspose.slides.yg.do(Unknown Source)
com.aspose.slides.yg.do(Unknown Source)
com.aspose.slides.eb.do(Unknown Source)
com.aspose.slides.bbb.do(Unknown Source)
com.aspose.slides.auq.do(Unknown Source)
com.aspose.slides.auq.do(Unknown Source)
com.aspose.slides.Presentation.do(Unknown Source)
com.aspose.slides.Presentation.do(Unknown Source)
com.aspose.slides.Presentation.do(Unknown Source)
com.aspose.slides.Presentation.save(Unknown Source)

Hi Rui,

I have discussed the issue with our product team. The issue(Cannot find any fonts installed on the system.) arises because the process cannot access to directory with fonts ("/usr/share/fonts", “/usr/local/share/fonts”, “/usr/X11R6/lib/X11/fonts”). We suggest you to please check and grant the user rights for having access of the listed paths. Please set path to "MS TrueType core my REHL"using FontsLoader.

As per our product team, you may also create directory in all types of Linux OS(same place for all os). Please check access right for this folder and use FontsLoader.

Many Thanks,