New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Japanese font glyph with direction "ttb" is drawn to incorrect position #2656
Comments
Do you have the raqm feature compiled in? ( you would have had to build from source, as it's not in the binary builds) (for reference:) from PIL import features
print (features.check('raqm')) |
I installed libraqm using >>> from PIL import features
>>> print ("raqm:",features.check('raqm'))
raqm: True |
Similarly, This phenomenon appear in pillow 4.3.0. |
It looks like the layout we're getting is straight from what raqm is getting from harfbuzz. It's either a bug in harfbuzz, or raqm is driving it incorrectly for this font/script. I've looked at this against harfbuzz 1.01 (default ubuntu 16.04) and the latest 1.5.1, and raqm@MASTER @khaledhosny Can you take a look at this? |
Raqm only passes the direction to HarfBuzz, the code that does the rendering needs to handle vertical direction specially by using |
Sorry, I couldn't understand above exactly. Let me confirm about this issue. |
@masushin FWIW I read it as potentially something Pillow could do (e.g. "by using y_advance instead of x_advance"), assuming Pillow is "the code that does the rendering". |
Have a look at the vertical layout example https://github.com/HinTak/harfbuzz-python-demos |
I wasn't able to reproduce the shift to the left, but I've created PR #3856 to fix the vertical positioning issues. |
ok, I'll try it and report a result. |
What did you do?
I tried to draw Japanese font glyph by following test code.
What did you expect to happen?
I expected to get the following image.
What actually happened?
I got the following image.
Glyphs are drawn to deviate to the lower left.
Also, it seems that these glyphs are drawn overlapping.
(It may be better to deal with this after the first problem has been solved..)
The font file using in my code can be got from the following link.
http://okoneya.jp/font/GenEiAntique-3.0.zip
Incidentally, I tried it using other font "ヒラギノ 明朝".
It included in Japanese mac OS. And same problem appear.
So, I think it is not problem with a specific font file.
Please let me know if there are mistake in my code.
What versions of Pillow and Python are you using?
Python 3.6.0
Pillow 4.2.1
The text was updated successfully, but these errors were encountered: