mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
Merge pull request #6341 from radarhere/imagedraw
Only import ImageFont in ImageDraw when necessary
This commit is contained in:
commit
418820a1e8
|
@ -33,7 +33,7 @@
|
||||||
import math
|
import math
|
||||||
import numbers
|
import numbers
|
||||||
|
|
||||||
from . import Image, ImageColor, ImageFont
|
from . import Image, ImageColor
|
||||||
|
|
||||||
"""
|
"""
|
||||||
A simple 2D drawing interface for PIL images.
|
A simple 2D drawing interface for PIL images.
|
||||||
|
@ -667,6 +667,8 @@ class ImageDraw:
|
||||||
|
|
||||||
if font is None:
|
if font is None:
|
||||||
font = self.getfont()
|
font = self.getfont()
|
||||||
|
from . import ImageFont
|
||||||
|
|
||||||
if not isinstance(font, ImageFont.FreeTypeFont):
|
if not isinstance(font, ImageFont.FreeTypeFont):
|
||||||
raise ValueError("Only supported for TrueType fonts")
|
raise ValueError("Only supported for TrueType fonts")
|
||||||
mode = "RGBA" if embedded_color else self.fontmode
|
mode = "RGBA" if embedded_color else self.fontmode
|
||||||
|
|
Loading…
Reference in New Issue
Block a user