Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed stroke on FreeType < 2.9 #4401

Merged
merged 1 commit into from
Mar 5, 2020
Merged

Conversation

radarhere
Copy link
Member

Resolves #4366

The issue reported that the stroke was incorrectly positioned when writing the text 'Sample Overlay Text'. Testing for that issue, I found that it was only happening for FreeType < 2.9 - all three of the values being used in calculating the ascender (bitmap.rows, glyph_slot->bitmap_top and PIXEL(glyph_info[i].y_offset)) were zero. I find that always passing in FT_LOAD_RENDER when loading the glyphs for those calculations fixes that.

However, FreeType < 2.9 is a scenario in our test environments, so why wasn't this picked up? It's because 'Sample Overlay Text' has descenders - 'p' and 'y' go below the baseline of the text. The current stroke text tests involve 'A', 'A\nB' and 'ABC\nAaaa' - no descenders.

@hugovk hugovk merged commit da4667c into python-pillow:master Mar 5, 2020
@hugovk
Copy link
Member

hugovk commented Mar 5, 2020

Thank you!

This was referenced Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Offset Text Stroke in Linux
2 participants