Is font fallback supported?

Hi,
does Aspose.PDF support font fallback? I would like to insert the following text: “€ü²±ffi⑵②국ية日本:cityscape::fork_and_knife::cloud_with_snow:ทืทื้่öüᾯāǽö” e.g. with Arial, but I want to set a list of fonts too, where the lib can look for the glyphs if they are missing in the given font. Is it possible somehow?

@david.csillik.messerli

Yes, you can set the font source directory for the API to look for specified fonts. Please check following:

[.NET]

Aspose.Pdf.Text.FontRepository.Sources.Add(new FolderFontSource("<user's path to ms fonts>"));

[Java]

FontRepository.setLocalFontPaths(List] newFontPathsList)

Hi Ali,
thank you for your answer!
I think I was not clear enough, sorry!

I would like to do something like this:

        Document doc = new Document();
        Page page = doc.Pages.Add();

        FontRepository.Sources.Add(new FolderFontSource(@"C:\Temp\Fonts\"));

        TextState style = new TextState();
        style.Font = FontRepository.FindFont("Arial");
        style.FontSize = 12;
        style.FontStyle = FontStyles.Regular;
        style.LineSpacing = 4;

        var frag = new TextFragment("€ü²±ffi⑵②국日本🏙🍴🌨ทืทื้่öüᾯāǽö");
        frag.TextState.ApplyChangesFrom(style);
        frag.IsInLineParagraph = true;
        page.Paragraphs.Add(frag);

        //save it
        doc.Save("fontTest.pdf");

Here the c:\Temp\Fonts contains the needed fonts, like Cambria, Leewaladee, Malgun, as you supposed, but it does not work! The text appears with the font MSGothic, even I set the font to Arial.
I have tried with one unicode character per paragraph too, then it works better, the first few characters appear with Arial, some with MSGothic, but the characters that have a glyph only in Segoe UI or in Leewaladee do not appear, only if I set the font explicit.
Is there a better solution? Or do I something wrong?

@david.csillik.messerli

Thanks for further elaborating on the issue.

We have tested the scenario in our environment and also noticed the similar issue. It seems like the API assign font on text fragment level which is why unsupported characters/glyphs are not rendered correctly.

We have logged an investigation ticket to determine whether it is possible to handle all the characters explicitly in terms of assigning supported fonts or not. The ticket has been logged under the ID PDFNET-49076 in our issue tracking system. We will further look into its details and keep you posted with the status of its resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.

Thank you Ali!
I would like to add an example to it: the following text contains an Arabic (???) symbol. In this case the library changes the orientation of the whole text, and cuts the end. Could you check it too?

“€ü²±ffi⑵②국ية日本:cityscape::fork_and_knife::cloud_with_snow:ทืทื้่öüᾯāǽö”

@david.csillik.messerli

Sure, we will surely check from this perspective and let you know once we have additional updates.