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

font_awesome example throws error with luma.led_matrix #106

Open
thijstriemstra opened this issue Jul 8, 2019 · 1 comment
Open

font_awesome example throws error with luma.led_matrix #106

thijstriemstra opened this issue Jul 8, 2019 · 1 comment

Comments

@thijstriemstra
Copy link
Collaborator

thijstriemstra commented Jul 8, 2019

$ python examples/font_awesome.py --config max7219.conf
Version: luma.led_matrix 1.4.0 (luma.core 1.12.0)
Display: max7219
Interface: spi
Dimensions: 8 x 8
------------------------------------------------------------
Traceback (most recent call last):
  File "examples/font_awesome.py", line 161, in <module>
    main()
  File "examples/font_awesome.py", line 153, in main
    w, h = draw.textsize(text=code, font=font)
  File "/home/pi/.virtualenvs/foo/lib/python3.5/site-packages/PIL/ImageDraw.py", line 339, in textsize
    return font.getsize(text, direction, features, language)
  File "/home/pi/.virtualenvs/foo/lib/python3.5/site-packages/PIL/ImageFont.py", line 223, in getsize
    size, offset = self.font.getsize(text, direction, features, language)
OSError: raster overflow

it uses the default max7219.conf.

--display=max7219
--interface=spi
--width=8
--height=8

@rm-hull any idea how to render the icons using a max7219 device?

@rm-hull
Copy link
Owner

rm-hull commented Oct 25, 2020

i think it would be a stretch to scale the TTF icons into 8x8 pixels .. sounds like it is emanating from FreeType2 (see https://www.freetype.org/freetype2/docs/reference/ft2-error_code_values.html)

Might be worth trying again with the latest Pillow 8 patch - I think the headline change was around font rendering (see https://pillow.readthedocs.io/en/stable/releasenotes/8.0.1.html#security)

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

No branches or pull requests

2 participants