-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Handle PCF fonts files with less than 256 characters #6386
Handle PCF fonts files with less than 256 characters #6386
Conversation
We like to have tests with our PRs, so that we can guard against this change being accidentally reverted in the future. Is the font one that we can include in our test suite and distribute under Pillow's license? |
I believe so, it's available from X.org: https://www.x.org/releases/individual/font/font-schumacher-misc-1.0.0.tar.gz , but I'm not an expert on open-source licenses. The copyright notice says:
|
My Google search suggests this is a variant of the MIT license, so should be compatible with Pillow: https://spdx.org/licenses/MIT-CMU.html |
…' into handle_pcf_missing_characters
I've pushed a commit that adds a test, using a hexedited version of https://github.com/python-pillow/Pillow/blob/main/Tests/fonts/10x20-ISO8859-1.pcf. I've also changed this to no longer catch the exception, but instead to not look beyond the number of characters in the first place. |
0b6a65a
to
93805d5
Compare
Fixes loading fonts where a lot of basic characters are missing.
Here is an example clR4x6.pcf.gz, from the X11 misc fixed-sized fonts, found on Ubuntu at
/usr/share/fonts/X11/misc/clR4x6.pcf.gz