Skip to content

builtin font does not have load_glyphs always #87

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

Closed
FoamyGuy opened this issue Aug 19, 2020 · 0 comments · Fixed by #88
Closed

builtin font does not have load_glyphs always #87

FoamyGuy opened this issue Aug 19, 2020 · 0 comments · Fixed by #88
Labels
bug Something isn't working

Comments

@FoamyGuy
Copy link
Contributor

in #85 we add a call to load_glyphs inside of _update_text and this made the label building / rendering work faster.

It looks like in some cases however this is resulting in an error when used with builtin font:

Traceback (most recent call last):
  File "code.py", line 15, in <module>
  File "adafruit_clue.py", line 913, in simple_text_display
  File "adafruit_clue.py", line 117, in __init__
  File "adafruit_clue.py", line 128, in add_text_line
  File "adafruit_display_text/label.py", line 125, in __init__
  File "adafruit_display_text/label.py", line 240, in _update_text
AttributeError: 'BuiltinFont' object has no attribute 'load_glyphs'

This was pointed out by a user in the #help-with-circuitpython channel on discord. They were working on the Clue Temperature and Humidity example project from here: https://learn.adafruit.com/adafruit-clue/clue-temperature-and-humidity-monitor I was able to recreate it with that project on a CLUE.

But I do suspect this issue might be more wide spread, perhaps any label that is using terminalio.FONT.

I think we could resolve this by putting the load_glyphs call inside of an if statement checking to make sure we aren't currently using terminalio.FONT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant