mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-27 07:34:46 +03:00
Merge 3482f23f62
into 8a4a1e0338
This commit is contained in:
commit
666e77b746
|
@ -217,7 +217,8 @@ class ImageDraw(object):
|
||||||
ink = fill
|
ink = fill
|
||||||
if ink is not None:
|
if ink is not None:
|
||||||
try:
|
try:
|
||||||
mask, offset = font.getmask2(text, self.fontmode, *args, **kwargs)
|
mask, offset = font.getmask2(text, self.fontmode,
|
||||||
|
*args, **kwargs)
|
||||||
xy = xy[0] + offset[0], xy[1] + offset[1]
|
xy = xy[0] + offset[0], xy[1] + offset[1]
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
try:
|
try:
|
||||||
|
@ -254,6 +255,8 @@ class ImageDraw(object):
|
||||||
def textsize(self, text, font=None, spacing=4, direction=None,
|
def textsize(self, text, font=None, spacing=4, direction=None,
|
||||||
features=None):
|
features=None):
|
||||||
"""Get the size of a given string, in pixels."""
|
"""Get the size of a given string, in pixels."""
|
||||||
|
if len(text) == 0:
|
||||||
|
return (0, 0)
|
||||||
if self._multiline_check(text):
|
if self._multiline_check(text):
|
||||||
return self.multiline_textsize(text, font, spacing,
|
return self.multiline_textsize(text, font, spacing,
|
||||||
direction, features)
|
direction, features)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user