Skip to content

Commit 5a8c9e3

Browse files
committed
Including exception regarding missing FONTBOUNDINGBOX parameter in the font file
1 parent ed16e1b commit 5a8c9e3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

adafruit_bitmap_font/bdf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,12 @@ def load_glyphs(self, code_points):
121121
if not remaining:
122122
return
123123

124-
x, _, _, _ = self.get_bounding_box()
124+
try:
125+
x, _, _, _ = self.get_bounding_box()
126+
except TypeError as error:
127+
raise Exception(
128+
"Font file does not have the FONTBOUNDINGBOX property. Try a different font"
129+
) from error
125130

126131
self.file.seek(0)
127132
while True:

0 commit comments

Comments
 (0)