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

remove ImageFont.getsize() usage for Pillow 10.0.0 #108

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

FoamyGuy
Copy link
Contributor

I think this will resolve the actions error from adafruit/Adafruit_CircuitPython_MatrixPortal#91 as well as other attempts to use Blinka_DisplayIO with Pillow version 10.0.0 which was released recently.

I found the new API to use from the Pillow release notes: https://pillow.readthedocs.io/en/stable/releasenotes/10.0.0.html#font-size-and-offset-methods

The new function returns a tuple with size 4 instead of 2, so I've used slice to make a drop-in replacement for the now removed getsize() I confirmed this by adding some print statements to the fontio.py file temporarily.

I did only very minimal testing with the PyGame Display simpletest script.

Copy link
Contributor

@makermelissa makermelissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@makermelissa makermelissa merged commit 63ecf20 into adafruit:main Jul 12, 2023
1 check passed
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.

2 participants