mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 10:46:16 +03:00
added text size test
This commit is contained in:
parent
ebb0a491b6
commit
ab61cedbdc
|
@ -52,9 +52,16 @@ class TestFontPcf(PillowTestCase):
|
|||
with Image.open('Tests/images/test_draw_pbm_target.png') as target:
|
||||
self.assert_image_similar(im, target, 0)
|
||||
|
||||
def test_textsize(self):
|
||||
tempname = self.save_font()
|
||||
font = ImageFont.load(tempname)
|
||||
for i in range(255):
|
||||
(dx,dy) = font.getsize(chr(i))
|
||||
self.assertEqual(dy, 20)
|
||||
self.assertIn(dx, (0,10))
|
||||
self.assertEqual(font.getsize(message), (len(message)*10,20))
|
||||
|
||||
def _test_high_characters(self, message):
|
||||
|
||||
tempname = self.save_font()
|
||||
font = ImageFont.load(tempname)
|
||||
im = Image.new("L", (750,30) , "white")
|
||||
|
|
Loading…
Reference in New Issue
Block a user