Free Support Forum - aspose.com

Unable to get the fonts for Linux

Hi i have a linux environment in which i have created a service to call aspose for replacement
whenn i am working with windows i am getting these fonts
Agency FB
Aharoni
Algerian
Andalus
Angsana New
AngsanaUPC
Aparajita
Arabic Typesetting
Arial
Arial Black
Arial Narrow
Arial Rounded MT Bold
Arial Unicode MS
Baskerville Old Face
Batang
BatangChe
Bauhaus 93
Bell MT
Berlin Sans FB
Berlin Sans FB Demi
Bernard MT Condensed
Blackadder ITC
etc…

but i am not getting any such fonts in llinux
Do we need to manually include those using fontsloader.loadexternalfonts()?

@khushboomehta,

I have observed your requirements and have not been able to completely understand the requirements. However, if fonts addressed are not available in your machine, you can load them externally on your end as well. If there is still issue then please provide complete working sample along with details of what is required on your end.

Hi
I loaded an external file using loadExternalFonts() method.
When i check for the existing fonts using getAllFonts(), i am unable to see the loaded utopia-regular.ttf.
Can you please let me know what is the wrong with this code. Its not working in both windows and linux.

String path = getClass().getClassLoader().getResource( "utopia-regular.ttf" ).getPath();
FontsLoader. loadExternalFonts ( new String[] {path} );
System. out .println( "==== getLocalGraphicsEnvironment ============" );
System. out .println( path );
GraphicsEnvironment e = GraphicsEnvironment. getLocalGraphicsEnvironment ( );
for (Font font:e.getAllFonts()) {
System. out .println(font.getFontName());
}

@khushboomehta,

I have observed the sample code shared by you and like to share that when you load the font externally using Aspose.Slides, it is only application specific and loaded for that particular application. It is not registered with Java and will not be available in fonts list of GraphicsEnviornment. To do this, you need to properly install the font in your machine. I hope the shared information will be helpful.

After uploading the font externally using Aspose.Slides to our aplication we are still getting the error as “can’not find any fonts installed on the system”.
Do we need to add any extra step to follow?

@khushboomehta,

I request you to please share the source font, source presentation, sample project, issue details and Operating System details with us.