Fix rendered characters have been chipped for some TrueType fonts#45
Fix rendered characters have been chipped for some TrueType fonts#45aclark4life merged 1 commit intopython-pillow:masterfrom tk0miya:fix-rendered-chars-have-been-chipped
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