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

Raise ValueError when TrueType font size is zero or less #7584

Merged
merged 2 commits into from
Nov 29, 2023

Conversation

akx
Copy link
Contributor

@akx akx commented Nov 28, 2023

Fixes #7583

Changes proposed in this pull request:

  • Validate size before FreeType gets to raise an "invalid ppem value" or "invalid argument" for us.

@akx akx changed the title Improve error message when creating TrueType fonts of negative size Improve error message when creating TrueType fonts of invalid size Nov 28, 2023
@akx akx force-pushed the truetype-size-validation branch from 0f788b3 to 4ea5289 Compare November 28, 2023 11:00
src/PIL/ImageFont.py Outdated Show resolved Hide resolved
Tests/test_imagefont.py Outdated Show resolved Hide resolved
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
@akx akx force-pushed the truetype-size-validation branch from 4eaf55c to 39ec56c Compare November 28, 2023 13:10
Tests/test_imagefont.py Outdated Show resolved Hide resolved
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
@akx akx requested a review from radarhere November 29, 2023 07:21
@hugovk hugovk merged commit 54c5631 into python-pillow:main Nov 29, 2023
56 checks passed
@radarhere radarhere changed the title Improve error message when creating TrueType fonts of invalid size Raise ValueError when TrueType font size is not greater than zero Nov 29, 2023
radarhere added a commit to radarhere/Pillow that referenced this pull request Dec 8, 2023
radarhere added a commit to radarhere/Pillow that referenced this pull request Dec 8, 2023
@radarhere radarhere mentioned this pull request Dec 8, 2023
@hugovk hugovk changed the title Raise ValueError when TrueType font size is not greater than zero Raise ValueError when TrueType font size is zero or less Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Creating TrueType fonts with size=0 fails with Pillow 10+ differently than with Pillow 9
4 participants