PIL font renderer cuts off descender of some TrueType fonts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-imaging (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: python-imaging
#!/usr/bin/env python
"""Demonstrate a bug in Python Imaging Library.
Summary: PIL font renderer cuts off descender of some TrueType fonts
The FreeType font loader in the _imagingft component of
python-imaging does not always render the entire glyph.
Steps to reproduce:
1. Download FinkHeavy.ttf from
http://
2. Copy it to the .fonts folder in your home folder.
3. Run this Python program.
Expected result:
The bottom of the 'g' is round, as it appears in other programs.
Actual result:
The bottom of the 'g' is flat; the bottom has been cut off.
Unlike python-imaging, SDL_ttf does not have this problem.
"""
from PIL import Image, ImageDraw, ImageFont
import os
fontname = os.path.
im = Image.new('L', (256, 256))
dc = ImageDraw.Draw(im)
fh = ImageFont.
dc.text((62, 64), "Hg", 254, fh)
im.show()
ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: python-imaging 1.1.7-2
ProcVersionSign
Uname: Linux 2.6.35-22-generic i686
NonfreeKernelMo
Architecture: i386
Date: Thu Nov 18 16:41:17 2010
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
ProcEnviron:
LANG=en_US.utf8
SHELL=/bin/bash
SourcePackage: python-imaging
#!/usr/bin/env python expanduser( '~/.fonts/ FinkHeavy. ttf') truetype( fontname, 64) Draw(im) .text(( 62, 64), "jq{", 254, fh)
"""
I've also caught it chopping off ascenders and the first glyph in a line.
"""
from PIL import Image, ImageDraw, ImageFont
import os
fontname = os.path.
im = Image.new('L', (256, 256))
fh = ImageFont.
ImageDraw.
im.show()