-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix rendered characters have been chipped for some TrueType fonts #45
Fix rendered characters have been chipped for some TrueType fonts #45
Conversation
ImageFont ignores descender value of TrueType fonts (uses ascender only), then some fonts which use descender is chipped on rendering.
Is this in any way controversial or risky? If not, I'm going to merge it. 👍 |
I woudl like to test it with a font that is actually chipped. The name of one would be helpful. |
@tk0miya Can you clarify "some TrueType fonts" i.e. which ones? Thanks |
IIRC, I had this applied for a short time in my PIL fork but it broke other cases. I had to revert. |
I met this problem with IPA font (http://ossipedia.ipa.go.jp/ipafont/index.html#en ) BTW, In the broken case, the questioner uses HelveticaLTStd-Light.otf . |
I'm going to close this until we can figure out what is going on |
PIL clipping fonts is a common problem, e.g.:
There's a patch at http://pastebin.com/jP2iLkDN :
|
Is this the patch you had to revert? Or another one |
This patch is another one. I have not tried it. I just pasted it here to keep track of things and so it doesn't get lost. |
Got it, thanks |
With a patch from http://pastebin.com/jP2iLkDN and HelveticaLTStd-Light.otf, I got correct image! I think this patch works fine. |
Fix rendered characters have been chipped for some TrueType fonts
That's great! Thanks |
@aclark4life sorry for confuse you. My pull request is imcomplete. Please use patch from http://pastebin.com/jP2iLkDN that is pasted by cgohike. |
Can you send the patch as a pull request? Do you want me to revert this last merge? |
We definitely need test coverage on this one. |
Sooo am I supposed to just patch on top with: http://pastebin.com/jP2iLkDN ? Or revert, then patch… |
Hi @aclark4life |
Thanks! |
Converted setup and teardown methods
via scikit-image/scikit-image@e094b38 * pillow 7.1.0 fails on png files, See scikit-image/scikit-image#4548 * pillow 7.1.1 fails due to python-pillow/Pillow#45
ImageFont ignores descender value of TrueType fonts (uses ascender only),
then some fonts which use descender is chipped on rendering.
This fix is already reported to PIL at http://hg.effbot.org/pil-2009-raclette/issue/13/chipped-characters-have-been-rendered