@tahir.manzoor I think you misunderstood my post, for korean-only.docx, the font ‘UnDotum’ does exist in the system font’s folder, but ‘AR PL UKai CN’ is still used for rendering.
Running:
Document doc = new Document(filename);
doc.setWarningCallback( new WarningCallback() );
FontSettings fontSettings = new FontSettings();
fontSettings.getFallbackSettings().buildAutomatic();
fontSettings.getFallbackSettings().save("fallback.xml");
doc.setFontSettings(fontSettings);
PdfSaveOptions options = new PdfSaveOptions();
doc.save(outputFilename, options);
This produces the following output:
$ java -jar build/libs/AsposeTest-1.0-all.jar korean-only.docx encoding.pdf
Font sub: Font substitutes: 'Calibri' replaced with 'Liberation Sans'.
Font sub: Font 'Gulim' has not been found. Using 'AR PL UKai CN' font instead.
Thanks for sharing the detail. We logged this problem in our issue tracking system as WORDSNET-17852 . You will be notified via this forum thread once this issue is resolved.
Thanks for your patience. The Korean character in the document are in “U+AC00…U+D7AF Hangul Syllables” Unicode block. “utkal” font is used for this range in the fallback.xml provided by you.
Probably this font does not contains required glyphs and fallback fails. FallbackSettings.BuildAutomatic() may not produce the optimal fallback settings as described in xml comments. You should set the “UnDotum” fallback font for “U+AC00…U+D7AF Hangul Syllables” range manually. Please generate the fallback.xml using BuildAutomatic method, modify it manually, and load it with FontFallbackSettings.Load() method.
We have tested the scenario using the latest version of Aspose.Words for Java 18.12 and unable to reproduce the same issue at our end. Could you please ZIP and attach ‘Nice’ and ‘Takao P Gothic’ fonts that you are using here for testing? Thanks for your cooperation.
Thanks for sharing the detail. We logged this problem in our issue tracking system as WORDSNET-17904 . You will be notified via this forum thread once this issue is resolved.
We have completed the analysis of Urdu font issue. In your document Urdu text contains chars from “U+FB50…U+FDFF Arabic Presentation Forms-A” and “U+FE70…U+FEFF Arabic Presentation Forms-B” Unicode blocks. According to provided PDF output, “Arial” font is used for the chars from “U+FE70…U+FEFF Arabic Presentation Forms-B” block (which is directly specified for the text) and “DejaVu Sans” font is used for the chars from “U+FB50…U+FDFF Arabic Presentation Forms-A” (which is specified as a last fallback font in provided fallback settings XML). “Nice” font is probably not used because it contains only glyphs for “U+FE70…U+FEFF” block and they are already resolved in “Arial” font.
None of the provided fonts contains all required glyphs from “U+FB50…U+FDFF Arabic Presentation Forms-A”. So you should use some other font for this block. There is free “Noto Sans Arabic” font (Noto Home - Google Fonts) which you could use.