Skip to content

Commit e542da2

Browse files
committed
Fix test expectations for multiline descender line spacing
The change from 'A' to 'Aj' in getbbox correctly accounts for font descenders, increasing multiline text bbox height by 4px for fonts with descenders (like FreeMono.ttf at size 20). Updated test_textbbox_stroke expected values: - stroke_width=2: bottom 44 → 48 - stroke_width=4: bottom 50 → 54
1 parent 1b60a60 commit e542da2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Tests/test_imagedraw.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,8 +1376,8 @@ def test_textbbox_stroke() -> None:
13761376
# Act / Assert
13771377
assert draw.textbbox((2, 2), "A", font, stroke_width=2) == (0, 4, 16, 20)
13781378
assert draw.textbbox((2, 2), "A", font, stroke_width=4) == (-2, 2, 18, 22)
1379-
assert draw.textbbox((2, 2), "ABC\nAaaa", font, stroke_width=2) == (0, 4, 52, 44)
1380-
assert draw.textbbox((2, 2), "ABC\nAaaa", font, stroke_width=4) == (-2, 2, 54, 50)
1379+
assert draw.textbbox((2, 2), "ABC\nAaaa", font, stroke_width=2) == (0, 4, 52, 48)
1380+
assert draw.textbbox((2, 2), "ABC\nAaaa", font, stroke_width=4) == (-2, 2, 54, 54)
13811381

13821382

13831383
@skip_unless_feature("freetype2")

0 commit comments

Comments
 (0)