Free Support Forum -

New FontEntity not showing up in final presentation

Please help! I have created a new FontEntity for the "Wingdings 3" font (see code below) and added text to a slide using this FontEntity. However, when the presentation is opened in PowerPoint, the text set to the Wingdings 3 FontEntity shows up in the normal Arial font. If I manually add new text to the presentation using the Wingdings 3 font onto new slide, the text that was added via the Aspose Slides is now displayed using the Wingdings 3 font. It is as if the new FontEntity isn't really part of the saved presentation. I am using version of the AsposeSlides.dll file.

Here is the code that I am using to add the Wingdings 3 FontEntity. The pres variable is my Presentation object.

FontEntity wingdings3 = new FontEntity( pres, pres.Fonts[ 0 ] );

wingdings3.FontName = "Wingdings 3";

pres.Fonts.Add( wingdings3 );

I answered my own question. I needed to set the other attributes on the FontEntity. Now it works!

FontEntity wingdings3 = new FontEntity( pp.pres, pp.pres.Fonts[ 0 ] );

wingdings3.Family = Aspose.Slides.FontFamily.ROMAN;

wingdings3.FontName = WINGDINGS_FONT_NAME;

wingdings3.CharSet = FontCharSet.SYMBOL_CHARSET;

wingdings3.Pitch = FontPitch.VARIABLE_PITCH;

wingdings3.Quality = FontQuality.DEFAULT_QUALITY;

pres.Fonts.Add( wingdings3 );