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

Free Support Forum - aspose.com

Detecting if fonts are embedded

Hi,

Is there a way of detecting if any fonts are missing from the powerpoint when generating thumbnails with slides-java (20.3)? We have users that sometimes don’t embed fonts at all, or don’t embed all the fonts, and then complain that the image is different from what they see on the screen. I’d like to at least warn them about that, so they know how to resolve the issue, and it would be good to know if Aspose is trying to use system fonts instead of embedded fonts for rendering a slide.

gojko

@gojko,

I have observed the requirements shared and like to share that it is not necessary to have embedded font for rendering. If the font used in presentation is also installed or externally available (load fonts externally using Aspose.Slides). You can please visit this documentation link to get the embedded fonts list.

Hi,

I probably did not explain well what I was asking about, sorry - let me try again.

I know it’s not necessary to embed fonts, but I have users that create powerpoint documents using fonts that are not available in the system where the application using Aspose.Slides runs, so the thumbnails produced by Aspose.Slides do not look the same as users expect. This is not a bug - I just need to manage the expectations of my users well, and I would like to let them know that something might not look 100% the same unless the fonts are embedded.

My ideal scenario would be to somehow get from Aspose.Slides if it tried to use any external fonts while producing the thumbnail, and if so, show a warning and a link directing people to embed fonts and retry; if only embedded fonts were used during thumbnail generation, I would not display this warning and the related link, since it would not apply. Is it possible to detect that somehow?

@gojko,

I have observed your requirements. There are different options that you can use. One thing that you can do is to use FontsData to get the list of fonts used in your presentation. You can compare the list used fonts with that of fonts embedded inside presentation and also available on machine. You can find difference this way and notify to your users that X font is either not embedded or not installed on machine before rendering begin. I hope this will be helpful.

    Presentation p = new Presentation();
    IFontData[] fonts = p.FontsManager.GetFonts();

thanks very much for responding, this looks like it will solve the problem. Can I just double-check that my understanding is correct - the difference between getEmbeddedFonts() and getFonts() are effectively fonts that need to be used from the system?

@gojko,

Actually, getEmbeddedFonts() will give you the list of fonts embedded in presentation. Where as getFonts() return the list of all fonts referred in presentation. So, we can say that getEmbeddedFonts() is subset of getFonts().