You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used Pillow (5.4.1) to draw Arabic text onto a canvas using libraqm (0.5.0)
What did you expect to happen?
I expected the arabic text to be rendered without clipping.
What actually happened?
The text was clipped.
What are your OS, Python and Pillow versions?
OS: Ubuntu 18.04
Python: 3.6.8
Pillow: 5.4.1
Please include code that reproduces the issue and whenever possible, an image that demonstrates the issue. Please upload images to GitHub, not to third-party file hosting sites. If necessary, add the image to a zip or tar archive.
The best reproductions are self-contained scripts with minimal dependencies. If you are using a framework such as plone, Django, or buildout, try to replicate the issue just using Pillow.
Using font.getsize('لح') gives me (29, 121) but as you can see from the image above, while the text is 121 pixels high it is still clipped from the top. It is also clipped on the right side, even though there is an offset of (-2, 46).
So the dimensions are correct but the actual drawn text is clipped. I was informed that the font is cascading so font global metrics cannot be used reliably for clipping.
Is there any way to correct this clipping?
Thanks!
The text was updated successfully, but these errors were encountered:
What did you do?
I used Pillow (5.4.1) to draw Arabic text onto a canvas using libraqm (0.5.0)
What did you expect to happen?
I expected the arabic text to be rendered without clipping.
What actually happened?
The text was clipped.
What are your OS, Python and Pillow versions?
Please include code that reproduces the issue and whenever possible, an image that demonstrates the issue. Please upload images to GitHub, not to third-party file hosting sites. If necessary, add the image to a zip or tar archive.
The best reproductions are self-contained scripts with minimal dependencies. If you are using a framework such as plone, Django, or buildout, try to replicate the issue just using Pillow.
I am using the Aref-Ruqaa font. The exact version I am using is here:
https://github.com/alif-type/aref-ruqaa/blob/master/ArefRuqaa-Regular.ttf
Using
font.getsize('لح')
gives me(29, 121)
but as you can see from the image above, while the text is121
pixels high it is still clipped from the top. It is also clipped on the right side, even though there is an offset of(-2, 46)
.So the dimensions are correct but the actual drawn text is clipped. I was informed that the font is cascading so font global metrics cannot be used reliably for clipping.
Is there any way to correct this clipping?
Thanks!
The text was updated successfully, but these errors were encountered: