diff --git a/PIL/ImageDraw.py b/PIL/ImageDraw.py index e70991e9f..b7260c14b 100644 --- a/PIL/ImageDraw.py +++ b/PIL/ImageDraw.py @@ -90,10 +90,10 @@ class ImageDraw(object): self.fill = 0 self.font = None - ## - # Set the default font. - def setfont(self, font): + if warnings: + warnings.warn("setfont() is deprecated. " + + "Please set the attribute directly instead.") # compatibility self.font = font diff --git a/Tests/test_imagefont.py b/Tests/test_imagefont.py index 09f4942a7..dd2234467 100644 --- a/Tests/test_imagefont.py +++ b/Tests/test_imagefont.py @@ -223,11 +223,11 @@ try: font, orientation=orientation) # Original font - draw.setfont(font) + draw.font = font box_size_a = draw.textsize(word) # Rotated font - draw.setfont(transposed_font) + draw.font = transposed_font box_size_b = draw.textsize(word) # Check (w,h) of box a is (h,w) of box b @@ -245,11 +245,11 @@ try: font, orientation=orientation) # Original font - draw.setfont(font) + draw.font = font box_size_a = draw.textsize(word) # Rotated font - draw.setfont(transposed_font) + draw.font = transposed_font box_size_b = draw.textsize(word) # Check boxes a and b are same size