This commit is contained in:
Micah Chambers 2016-05-24 15:57:34 +00:00
parent 2defce3431
commit 033661c17f

View File

@ -310,7 +310,7 @@ class ImageDraw(object):
lineHeightPercent = 100
try:
lineHeight = font.font.height
except Exception as exc:
except AttributeError:
lineHeight = sum(font.getmetrics())
lineHeight = int(lineHeight * lineHeightPercent / 100)
@ -348,7 +348,6 @@ class ImageDraw(object):
font = self.getfont()
ink, fill = self._getink(fill)
if ink is None:
inx = fill
if ink is None:
return
if justifyX not in ('left', 'center', 'right'):
@ -398,6 +397,16 @@ class ImageDraw(object):
break
oy += lineHeight
##
# A simple 2D drawing interface for PIL images.
#
# @param im The image to draw in.
# @param mode Optional mode to use for color values. For RGB
# images, this argument can be RGB or RGBA (to blend the
# drawing into the image). For all other modes, this argument
# must be the same as the image mode. If omitted, the mode
# defaults to the mode of the image.
def Draw(im, mode=None):
"""
A simple 2D drawing interface for PIL images.