Skip to content

Fix multiline text line height calculation#9618

Open
mitre88 wants to merge 1 commit intopython-pillow:mainfrom
mitre88:fix/multiline-text-line-height
Open

Fix multiline text line height calculation#9618
mitre88 wants to merge 1 commit intopython-pillow:mainfrom
mitre88:fix/multiline-text-line-height

Conversation

@mitre88
Copy link
Copy Markdown

@mitre88 mitre88 commented May 5, 2026

The line spacing calculation was using only 'A' which doesn't account for characters that extend below the baseline (like 'p', 'g', 'y'). Using string.ascii_letters ensures we measure the full font height including both ascenders and descenders.

Fixes #1646

The line spacing calculation was using only 'A' which doesn't account
for characters that extend below the baseline (like 'p', 'g', 'y').
Using string.ascii_letters ensures we measure the full font height.

Fixes python-pillow#1646
@radarhere
Copy link
Copy Markdown
Member

This is very similar to #9581

Please have a read of the comments I have left there, primarily

There's a lot of debate in #1646. Are you sure that you have read all of that and concluded that this simple change is all that is needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiline text line height not being calculated correctly

2 participants