Font substitution in Aspose.Slides not rendering non-latin character based languages correctly


#1

Hi Aspose -

We running into problem rendering presentations that are using non-latin characters using Aspose.Slides.

We’ve setup a simple program that takes a presentation and outputs a PDF as follows:

            LoadOptions loadOptions = new LoadOptions();
            loadOptions.setWarningCallback(new WarningCallback());
            Presentation doc = new Presentation(filename, loadOptions);

            PdfOptions options = new PdfOptions();
            options.setWarningCallback(new WarningCallback());
            doc.save(outputFilename, SaveFormat.Pdf, options);

We output the warnings with the following code:

class WarningCallback implements IWarningCallback {
    @Override
    public int warning(IWarningInfo warningInfo) {
        System.out.println("Warning: " + warningInfo.getDescription());
        return ReturnAction.Continue;
    }
}

The presentation is created on a Window computer and being rendered on a Linux computer. The Windows and Linux computer does not have the same fonts installed, but the Linux computer has fonts that can be used as fallbacks for every language in the presentation.

However when we load and render presentations we see that a lots of font substitutions to fonts that does not properly support the languages. In other words Aspose.Slides is not picking the best font for the text that needs to be rendered.

We are currently facing problems rendering characters for the following languages:

  • Chinese (Simplified)
  • Chinese (Traditional)
  • Japanese
  • Korean
  • Punjabi
  • Thai
  • Tamil
  • Urdu
  • Hindi

Attached is sample code: AsposeSlidesTest.zip (322.6 KB).

To build run:

./gradlew shadowJar 

To run:

java -jar build/libs/AsposeSlidesTest-1.0-all.jar Languages.pptx encoding.pdf

Here is an example of the rendered outcome: encoding.pdf (157.5 KB)


#2

@sbd,

I have observed your comments. Can you please environment details along with which Aspose.Slides version you are using on your end so that we may further investigate to help you out.


#3

Yes, Ubuntu 14.04 running Aspose.Slides 18.9.


#4

@sbd,

I have observed your comments. Can you please try to use Aspose.Slides latest version 18.10 on your end and share your feedback with us.


#5

Using Aspose.Slides 18.10 produces the same results. See output: encoding.pdf (157.3 KB).


#6

@sbd,

I have worked with the sample code shared by you and have been able to observe the issue. An issue with ID SLIDESJAVA-37404 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.