mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-21 04:34:47 +03:00
Some fixes for tests
This commit is contained in:
parent
b388329f92
commit
2719a2179f
|
@ -585,7 +585,7 @@ class TestImageFont:
|
||||||
assert t.getsize_multiline("A") == (12, 16)
|
assert t.getsize_multiline("A") == (12, 16)
|
||||||
assert t.getsize_multiline("AB") == (24, 16)
|
assert t.getsize_multiline("AB") == (24, 16)
|
||||||
assert t.getsize_multiline("a") == (12, 16)
|
assert t.getsize_multiline("a") == (12, 16)
|
||||||
assert t.getsize_multiline("ABC\n") == (36, 36)
|
assert t.getsize_multiline("ABC\n") == (36, 16)
|
||||||
assert t.getsize_multiline("ABC\nA") == (36, 36)
|
assert t.getsize_multiline("ABC\nA") == (36, 36)
|
||||||
assert t.getsize_multiline("ABC\nAaaa") == (48, 36)
|
assert t.getsize_multiline("ABC\nAaaa") == (48, 36)
|
||||||
|
|
||||||
|
|
|
@ -498,7 +498,7 @@ class ImageDraw:
|
||||||
line, font, direction=direction, features=features, language=language
|
line, font, direction=direction, features=features, language=language
|
||||||
)
|
)
|
||||||
widths.append(line_width)
|
widths.append(line_width)
|
||||||
heighs.append(line_height + spacing)
|
heighs.append(line_height + spacing if line_height != 0 else 0)
|
||||||
max_width = max(max_width, line_width)
|
max_width = max(max_width, line_width)
|
||||||
|
|
||||||
top = xy[1]
|
top = xy[1]
|
||||||
|
@ -689,7 +689,6 @@ class ImageDraw:
|
||||||
direction=direction,
|
direction=direction,
|
||||||
features=features,
|
features=features,
|
||||||
language=language,
|
language=language,
|
||||||
embedded_color=embedded_color,
|
|
||||||
)
|
)
|
||||||
widths.append(line_width)
|
widths.append(line_width)
|
||||||
heighs.append(line_height + spacing)
|
heighs.append(line_height + spacing)
|
||||||
|
|
|
@ -492,7 +492,7 @@ class FreeTypeFont:
|
||||||
line, direction, features, language, stroke_width
|
line, direction, features, language, stroke_width
|
||||||
)
|
)
|
||||||
max_width = max(max_width, line_width)
|
max_width = max(max_width, line_width)
|
||||||
all_height += line_height + spacing
|
all_height += line_height + spacing if line_height != 0 else 0
|
||||||
|
|
||||||
return max_width, all_height - spacing
|
return max_width, all_height - spacing
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user