Forum Feature requests

Font Shaping: Khmer

cambell
Khmer is a national language in South East Asia. Currently PrinceXml doesn't render it correctly.

See http://www.princexml.com/bb/viewtopic.php?p=7062

Just adding a note here in the hopes that it will be fixed one day.

Thanks.
Cambell
whittierta
Is Khmer still on the roadmap or has it already been addressed? If not, when should we expect it to be?
mikeday
It's still on the roadmap, and it may be supported in 2014, it really depends how long other things take.
joeh
Any update on support for Khmer font shaping? Is this still on the roadmap?
mikeday
It's still on the roadmap, and we're revisiting our complex script shaping support this year.
Petro
Hi, guys!

Have a similar problem with Khmer font rendering. For example, this text:
សត្វ​ចិញ្ចឹម ន្តិ

converts into this:
Screenshot 2021-05-13 at 10.24.52.png


It's very important for us to be fixed ASAP, since we have lots of customers using Khmer font. Or, as an option, maybe you have a suggestion how to workaround such cases.

License id 1002440

Regards, Petro Kodko
Senior Front-End Engineer
Faria Education Group
  1. Screenshot 2021-05-13 at 10.24.52.png9.0 kB
    conversion result
mikeday
Supporting each complex script is a significant undertaking so we may not be able to promise this in a hurry. Our latest build has finally added support for Sinhala script, which completes the basic set of Indic scripts for now, but Khmer and Burmese/Myanmar remain on the roadmap.
Petro
I really hope that you guys will do your best with it. Thank you in advance.

Regards, Petro Kodko
Senior Front-End Engineer
Faria Education Group
mikeday
The latest build of Prince now supports the Khmer script! Please let us know if you experience any issues with particular fonts.
Petro
Good to hear that, checking.
vtofeliuk
Dear PrinceXML Support Team,

I hope this message finds you well. I am reaching out to inquire about the current status of support for the Burmese (Myanmar) script in PrinceXML. I have encountered significant issues with rendering Burmese text in PDF documents generated by PrinceXML. Despite trying various fonts and CSS configurations, the rendered output does not match the web version, especially for complex script features and ligatures.

I read a previous response from your team in the forum where it was mentioned that "supporting each complex script is a significant undertaking so we may not be able to promise this in a hurry. Our latest build has finally added support for Sinhala script, which completes the basic set of Indic scripts for now, but Khmer and Burmese/Myanmar remain on the roadmap."

Could you please provide an update on whether full support for the Burmese script is planned or any recommendations for workarounds in the meantime? Any guidance or timeline for this feature would be greatly appreciated.

Thank you for your assistance.
mikeday
Support for Burmese remains on the roadmap but work on it has not yet begun at this time of writing.
vtofeliuk
Thank you for your prompt response.

Could you please provide any estimated timeline for when this support might be implemented? This feature is very important for us, and having an approximate timeline would greatly help us in our planning and decision-making.

Edited by vtofeliuk

mikeday
Do you have any specific requirements for which Burmese fonts you will be using?
vtofeliuk
We plan to use Noto Sans Myanmar Google Font.
mikeday
Thanks, we are investigating the work necessary for supporting this script now.
vtofeliuk
Hi mikeday,

I hope this message finds you well. I wanted to follow up on our previous conversation regarding the support for the Burmese script, specifically with the Noto Sans Myanmar Google Font. I wanted to check if there are any new developments or estimated timelines for when this feature might be supported.

Thank you for your assistance.
mikeday
We are working on support for Myanmar script now, but don't have a release timeline just yet. I would hope we would have something to test within a few months.
mikeday
The latest builds now support Myanmar (Burmese) script! :)
vtofeliuk
mikeday thanks, we will update it.
vtofeliuk
Hi mikeday,

Thank you for the update on the Myanmar (Burmese) script support! I noticed on your latest build link that the build was recently updated (prince-20241011-macos.zip), but the version number remains the same as the previous one.

When updating manually, the process completes, but I still don’t see the fix for the Myanmar script. Additionally, when attempting the update through Homebrew, it indicates that no new version is available.

Could there be an error in the version labeling or deployment of the latest build? If so, could you please confirm or provide guidance on ensuring we have the correct version that includes the Myanmar script support?

Thank you very much for your assistance.
wezm
Hi vtofeliuk,

I forgot to add some Myanmar fonts to the default style sheet in Prince when adding support for Myanmar script (this will be resolved in the next build). It's possible this is why it's not working for you. It looks like you're on macOS, so a workaround you can try is including this style sheet when running Prince:
@font-face {
    font-family: serif; /* Myanmar */
    src: prince-lookup("Noto Serif Myanmar"), prince-lookup("Myanmar Sangam MN")
}

@font-face {
    font-family: sans-serif; /* Myanmar */
    src: prince-lookup("Myanmar Sangam MN"), prince-lookup("Padauk"), prince-lookup("Myanmar Sagar"), prince-lookup("Noto Sans Myanmar")
}

For example if you saved the above CSS as myanmar.css then you could run prince as:
prince -s myanmar.css some-file-or-url.html

If that doesn't work it would be useful if you could supply:
  • a sample document
  • how you are running Prince (the full command)
  • the output of: prince --version

Edited by wezm

vtofeliuk
Hi wezm,

Thank you for the workaround suggestion with the CSS adjustments for Myanmar fonts.

Unfortunately, applying the provided @font-face declarations in my custom stylesheet didn’t resolve the rendering issues for the Myanmar (Burmese) script. Here’s a summary of what I’ve tried so far and some additional details on our setup:

1. Font Usage: We are using Noto Serif Myanmar and Noto Sans Myanmar from Google Fonts, and these render correctly in the browser. However, the PDF output generated by PrinceXML still has issues, particularly with complex script features and ligatures.

2. CSS Workaround: I applied the suggested CSS (added it directly to the stylesheets used for PDF generation) but still saw incorrect rendering.

3. Command Details: The PDF generation is initiated through a Ruby project using the princely gem, which wraps around PrinceXML. Here’s the command that appears in the console during PDF generation:
/opt/homebrew/bin/prince --http-timeout=10 --input=html --insecure --log=/path/to/project/log/prince.log  -s /path/to/project/app/assets/stylesheets/pdf.css.


4. Prince Version: I am using the latest version of Prince(15.4.1), but the version number hasn’t changed despite updating recently.

To illustrate the problem, I’ve attached some examples of how certain Myanmar script characters render incorrectly in PDF compared to the correct versions:

1. First example: ကြော (file: first.png)
2. Second example: မြန်မာ (file: second.png)
3. Third example: စုစည်းပြီး (file: third.png)
In each screenshot, you can see that the characters do not align properly or appear distorted in the PDF output, even though they display correctly in the web browser.

Could you please advise if it would be best to wait for your next build? If so, when might the updated version be available?

Thank you for your assistance.
  1. example.pdf29.5 kB
  2. first.png7.1 kB
  3. second.png6.4 kB
  4. third.png8.5 kB
mikeday
Latest builds include Myanmar script support:

https://www.princexml.com/latest/

This will be included in Prince 16, but is not available in Prince 15.
vtofeliuk
Hi mikeday,

Could you provide an estimated release date for version 16? Having a timeline would be really helpful for our project planning.

Thank you once again for your assistance.
mikeday
Within the next 3-6 months?
vtofeliuk
Hi mikeday,

I hope this message finds you well. I wanted to follow up regarding the Burmese font issue. Has there been any update on the release date for the version that will include the script supporting Burmese fonts?

Thank you for your assistance, and I look forward to your response again!

mikeday
I think we can narrow it down to within the next three months, now. :D
vtofeliuk
Great, I’m looking forward to this update!