Embedding Fonts in a PPT File to Avoid Font Substitution by Aspose.Slides

Hello team,

I am currently using Aspose.Slides 25.5 to convert PowerPoint presentations (PPT) to PDF format. The fonts used in the PPT files are not available on the machine where the conversion is taking place. To avoid font substitution by Aspose.Slides, I have embedded the fonts in the source PPT files.

However, I have observed that Aspose.Slides still substitutes the fonts to other fonts, despite the fonts being embedded in the source PPT files. This issue needs to be addressed to ensure the accurate representation of the original fonts in the converted PDFs.

I have added below rules in code to substitute fonts only when not accessible:

IFontSubstRuleCollection slidesFontSettings = new FontSubstRuleCollection();

for (final Map.Entry<String, String> entry : substituteFontMap.entrySet()) {
    final IFontSubstRule fontSubstituteRule = new FontSubstRule(new FontData(entry.getKey()),
            new FontData(entry.getValue()),
            FontSubstCondition.WhenInaccessible);
    slidesFontSettings.add(fontSubstituteRule);
}
presentation.getFontsManager().setFontSubstRuleList(slidesFontSettings);

Thank you for your attention to this matter.

@aakanksha76,
Thank you for contacting free support. We need more information to thoroughly investigate the case. Please share the following files and information:

  • The sample presentation file.
  • The simplest complete code example.
  • The output PDF file.
  • The name and version of the operating system on which the code was executed.
  • The JDK target version in your application project.