Forum Bugs

Incorrect Hindi Rendering

rajadain
Hello,

I'm running the latest version of Prince:

❯ prince --version
Prince 13.5
Copyright 2002-2020 YesLogic Pty. Ltd.
Non-commercial License


When I try to make a PDF of a simple HTML file (both input test.html‎ and output test.pdf‎ attached herein):

<h1 id="राग-मियॉं-की-तोड़ी-9">राग मियॉं की तोड़ी (9)</h1>
<p><strong>(तीन ताल - विलंबित लय)</strong></p>
<h2 id="स्थायी">स्‍थायी</h2>


which renders correctly in the browser. When I convert this to PDF using Prince:

❯ prince test.html -o test.pdf


the generated output is incorrect. This is shown in the screenshot below, with the correct HTML on the left and the incorrect PDF output on the right:



Do I need to do something else to get this to work correctly? Or is this a bug / regression in Prince itself?

Thank you.
  1. test.html0.3 kB
    Incorrect Hindi Rendering
  2. test.pdf19.5 kB
    Incorrect Hindi Rendering
mikeday
Thanks we will investigate this issue. It seems to be specific to the Devanagari MT font, which I think is an Apple font, correct? Unfortunately Apple fonts do not use the standard OpenType GSUB/GPOS tables for complex scripts, they have their own "morx" table which Prince does not support. Would you be able to use a different Hindi font, such as one of the fonts available on Linux or Windows, or the Google Noto fonts?
rajadain
Thank you for responding! Yes I'm working on macOS, and without any specification I assume it's using Devanagari MT. I didn't realize there were issues with it. I can try with one of the other available fonts. Will report back.
rajadain
Yes. For whatever reason, Chrome was using ITF Devanagari as the default Hindi font. When I specified that explicitly, the generated PDF now looks correct.

Thank you!
  1. test.html0.5 kB
    Correct Hindi Rendering
  2. test.pdf30.7 kB
    Correct Hindi Rendering