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.