When doc to pdf ,There seems to be something wrong with Tibetan

i had set font like this

String fileFolder = System.getenv("LOCALAPPDATA") + "\\Microsoft\\Windows\\Fonts";
String windowsFontsFolder = "C:\\Windows\\Fonts";
FontSettings.setFontsSources(
    new FontSourceBase[]{
        new FolderFontSource(fileFolder, true, 100),
        new FolderFontSource(windowsFontsFolder, true, 1)
    }
);

the Tibetan font is Microsoft Himalaya, in docx it is right.
微信图片_20221213155917.png (46.0 KB)

then use aspose convert to pdf, then like this
image.png (22.7 KB)

i spent much time on this ,please help ,thanks .below is the docx and err pdf
docxAndPdf.zip (331.6 KB)

@LeeBq To get the desired output you should enable open type features. If you use maven project, you can add reference to com.aspose.words.shaping.harfbuzz JAR using the following dependency:

<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-words</artifactId>
    <version>22.12</version>
    <classifier>shaping-harfbuzz-plugin</classifier>
</dependency>
1 Like

thans a lot !!! it is works.

import this.
before doc.save.

doc.getLayoutOptions().setTextShaperFactory(HarfBuzzTextShaperFactory.getInstance());
2 Likes