Skip to content

Commit 5ff8c19

Browse files
authored
Merge pull request #88 from FoamyGuy/fix_load_glyphs_for_builtin
gracefully recover if load_glpyhs does not exist on font we are using
2 parents 54acb53 + 3b03903 commit 5ff8c19

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

adafruit_display_text/label.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,13 @@ def _update_text(
237237
else:
238238
i = 0
239239
tilegrid_count = i
240-
self._font.load_glyphs(new_text + "M")
240+
241+
try:
242+
self._font.load_glyphs(new_text + "M")
243+
except AttributeError:
244+
# ignore if font does not have load_glyphs
245+
pass
246+
241247
y_offset = int(
242248
(
243249
self._font.get_glyph(ord("M")).height

0 commit comments

Comments
 (0)