Install MS Fonts from Slide on CentOs

I am trying to run Slide on CentOS 7 and I am getting these error ‘Cannot find any fonts installed on the system.’

I am assuming that the I am missing the MS fonts and I have being trying to install them using the guide I mention below. But, I am always get stock when the installer tries to download the fonts.

Error: arialb32.exe does not exist
Error: failed to download http://downloads.sourceforge.net/corefonts/arialb32.exe:

I know this isn’t Aspose specific problem. But do you have a guide or experience in how to get the MS Fonts installed on CentOs or Redhat? Without it, I can’t use your product.

Fonts Installation Guides:

http://mscorefonts2.sourceforge.net/

@eboraks2017,

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?

@eboraks2017,

I have observed your comments. I have shared code snippet. This will help you to identify which fonts you are using in your presentation. Please share feedback with us if there is still an issue.

public static void loadpresfonts()
{
//String path=“D:\aspose Data\aspose_files\”;
Presentation pres=new Presentation(path+“SM.pptx”);
ISlide slide=null;
ITextFrame[] textFramesPPTX = com.aspose.slides.SlideUtil.getAllTextFrames(pres, true); //Loop through the Array of TextFrames for (int i = 0; i < textFramesPPTX.Length; i++) {
Listfonts =new ArrayList();
for(int i=0;i<textFramesPPTX.length;i++)
{
ITextFrame text=textFramesPPTX[i];

    for(IParagraph para:text.getParagraphs())
    {
        for(IPortion portion:para.getPortions())
        {
           IPortionFormat format=portion.getPortionFormat();
           if(format.getLatinFont()!=null)
           {
               System.out.println(format.getLatinFont().getFontName());
               fonts.add(format.getLatinFont().getFontName());
           }   
           if(format.getSymbolFont()!=null)
           {
               fonts.add(format.getSymbolFont().getFontName());
               System.out.println(format.getSymbolFont().getFontName());
           }
        }
    }

}

}

Adnan,

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 noticed the “Loading Fonts from External Directories” section in the article you specified, but according to it, it’s not possible to set default fonts for HTML conversation why is that?

Adnan,

I installed the MS True Type from here mscorefonts2 download | SourceForge.net, and I still get that font not found in the system.

Our decision to buy Aspose is on the line and I need your help in understanding how to use the product in a reliable way.

@eboraks2017,

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);
lo.setDefaultRegularFont(“Wingdings”);
lo.setDefaultAsianFont(“Wingdings”);

// Do Some work and perform presentation/slides rendering
Presentation presentation = new Presentation(“input.pptx”);

Here is the solution I came up with.

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.

PptConverterMain.java.zip (1.3 KB)

@eboraks2017,

We are glad to know that things has started working on your end. Please share feedback with us if you have another issue.

Adnan,

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.

Eliran

@eboraks2017,

I suggest you to please visit this web link for your convenience to check the list of installed fonts.

Thank you,

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.

@eboraks2017,

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.