mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36: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 numbers
|
||||
|
||||
from . import Image, ImageColor, ImageFont
|
||||
from . import Image, ImageColor
|
||||
|
||||
"""
|
||||
A simple 2D drawing interface for PIL images.
|
||||
|
@ -667,6 +667,8 @@ class ImageDraw:
|
|||
|
||||
if font is None:
|
||||
font = self.getfont()
|
||||
from . import ImageFont
|
||||
|
||||
if not isinstance(font, ImageFont.FreeTypeFont):
|
||||
raise ValueError("Only supported for TrueType fonts")
|
||||
mode = "RGBA" if embedded_color else self.fontmode
|
||||
|
|
Loading…
Reference in New Issue
Block a user