Skip to content

Commit 28b3879

Browse files
committed
fallback for builtin font
1 parent eaeed21 commit 28b3879

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

adafruit_display_text/label.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,11 @@ def _get_ascent_descent(self):
178178

179179
# check a few glyphs for maximum ascender and descender height
180180
glyphs = "M j'" # choose glyphs with highest ascender and lowest
181-
self._font.load_glyphs(glyphs)
181+
try:
182+
self._font.load_glyphs(glyphs)
183+
except AttributeError:
184+
# Builtin font doesn't have or need load_glyphs
185+
pass
182186
# descender, will depend upon font used
183187
ascender_max = descender_max = 0
184188
for char in glyphs:

0 commit comments

Comments
 (0)