Open jflaflamme opened 7 years ago
I have the same problem with khmer language :(
Looks like an issue with Pango (or maybe HarfBuzz), not node-canvas ☹️.
I did a test in C:
However, I think it might be the mixed Roman letters that are making it difficult to do the right shaping. If you take out the English, is this more correct? never mind, still looks wrong.
If so you could do the English and Khmer in two separate calls to fillText
.
Most likely it has to do with your environment. If you're using Ubuntu, check for your language supports. You can do that by typing:
locale -a
In my case, my font was Thai. So I decided to install the basic language supports.
sudo apt-get install language-pack-{{language}} language-pack-gnome-{{language}} language-pack-{{language}}-base language-pack-gnome-{{language}}-base
Once that is done, you should had a new list of language support. So recheck you list, then add it by executing the command below.
locale -a
sudo locale-gen {{locale language}}
My local language was th_TH.utf8
. Hope this solves your issue as it did mine.
Issue
Hello guys, first thanks for the awesome work. I have an issue with Khmer font, with or without a custom font (font is unicode and available on Google fonts
Hanuman-Regular.ttf
)The top and bottom vowels are all shifted to the left as the screen shot below.
Hope you can help.
Steps to Reproduce
Above, the fillText is displaying the vowels correctly (សូមអរគុណពីហ្គីកូខេមបូឌ) on github as utf-8, my file is encoded as utf-8, the output from fillText seems to have an issue aligning them.
Your Environment