Aspose Words Java Font mismatch on upgrade

Hi
We had an upgrade from Aspose.Words Java v15.3 to v22.6. The client also had their environment upgrade from Rhel6.x to Rhel7.x, JBoss upgrade v6.4 to v7.x. The documents that are getting generated now have fonts mismatch. We copied fonts from ‘/usr/share/fonts’ and some of them were resolved, but there are still many mismatches.
Can I know what other folders I should be checking for font styles ?

I did get below code to look into font sources, but while this work with Aspose.Words v22.6, it doesn’t work with v15.3. Kindly help.

Below code works on v22.6 not on v15.3

for (String systemFontFolder : SystemFontSource.getSystemFontFolders()) {
    System.out.println(systemFontFolder);
}

Tried below on v15.3 but the folder location is not printed

for ( FontSourceBase fontFolder : FontSettings.getFontsSources()) {
    System.out.println(fontFolder.toString());
}

@ashwath Please see our documentation to learn where Aspose.Words looks for fonts:
https://docs.aspose.com/words/java/specify-truetype-fonts-location/

If Aspose.Words cannot find the fonts used in the document the fonts are substituted. You can implement IWarningCallback to get a notification when font substitution is performed.

Thanks Alex, I have already refereed the link shared and didn’t find other folders other than /usr/share/fonts. Let me try adding the IWarningCallback and see if can get the details on missing fonts.

1 Like