Here a part of the section about ligatures from the Unicode article: Apologies in advance for the long quotes, but else I could have just linked the 2 Wikipedia articles. As far as I understood from Wikipedia, the problem is very likely to be your font.
I'm not an expert myself, but here some pointers. I'd be extremely thankful for any hints, or code snippets by other developers (preferrably with a Hindi background who develop on Mac).
I believe all this might have something to do with the fact that the default character encoding on Macs is MacRoman (NOT a UTF-8 subset), and that other systems (like Windows) use a UTF-8 subset (such as WinLatin-1) or cp1252 or such.Įven with this information at hand, I'm in the dark about how to handle this problem. I have set the font as follows, so it should use a default font on any system: new Font(null,Font.PLAIN,20) screenshots below, correct rendering example from Win XP SP2 on the left (with RenderingHints Antialiasing Key ON), wrong rendering example from Mac OS X 10.6.7 on the right (Antialising DEFAULT = OFF). The ligatures are displayed correctly in Windows XP SP2 and 7, and Ubuntu, but in Mac OS X, the ligatures are decomposed (or rather, not merged correctly), diacritics are moved away from their positions, etc. The strings are drawn on a JComponent and take RenderingHints for Antialiasing. I'm trying to get Devanagari ligatures (in Unicode strings) rendered correctly on Mac OS X 10.6. Prince: debug: loaded resource: /usr/local/lib/prince/license/license.dat Prince: loading document: /usr/local/lib/prince/license/license.dat Prince: debug: loading license: /usr/local/lib/prince/license/license.dat $ prince -debug -media=print -i html5 tmp.html -output tmp.pdf Here's the output of the command I'm using, with the -debug argument:
Rather I believe it's the environment, which is a fresh install of macOS 10.14 Mojave with the most recent OS updates installed. I don't believe this problem originates from PrinceXML. Prince: debug: oops, could not get font traits informationįWIW: I searched on Google as well as on this forum for the debug message and couldn't find any resources that could help me move forward. Prince: debug: found font: Helvetica Regular Prince: debug: font request: bold Helvetica, Arial, sans-serif When I use the -debug command line argument, I see statements like this (full debug output is included further below): This is a paragraph with some strong text.
When using PrinceXML 10r7 with the following file (simplified, to illustrate the problem) the text in the PDF does not use Helvetica or Arial as the font: