Skip to content

Commit 1b60a60

Browse files
committed
Fix multiline text line spacing to account for font descenders
The line height calculation for multiline text used getbbox('A') which only measures the capital letter A height, missing descenders from characters like g, j, p, q, y. This caused overlapping lines when multiline text contained lowercase letters with descenders. Use 'Aj' instead so the bbox captures both ascent (from A) and descent (from j), giving correct line spacing for all text. Fixes #1646
1 parent 9f6a6a6 commit 1b60a60

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/PIL/ImageText.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ def _split(
353353
fontmode = self._get_fontmode()
354354
line_spacing = (
355355
self.font.getbbox(
356-
"A",
356+
"Aj",
357357
fontmode,
358358
None,
359359
self.features,

0 commit comments

Comments
 (0)