Skip to content

Issue specifying font through show_badge #9

Closed
@ericklein

Description

@ericklein

when passing a .bdf font through pybadger.show_badge

pybadger.show_badge(hello_string="Ola!", name_string="Blinka", hello_font="Helvetica-Bold-16.bdf", hello_scale=2, my_name_is_scale=1, name_scale=2)

causes the following exception:

Traceback (most recent call last):
File "code.py", line 14, in
File "adafruit_pybadger.py", line 332, in show_badge
File "adafruit_display_text/label.py", line 73, in init
AttributeError: 'str' object has no attribute 'get_bounding_box'

I've tested with the adafruit generated fonts Helvetica-Bold-16.bdf and Noto-18.bdf, both which work when using:

name_font = bitmap_font.load_font(name_font_name)
name_font.load_glyphs(NAME_STRING.encode('utf-8'))

I also renamed *.bdf to *.FONT on the off chance that the libraries were looking for that extension, as in the example terminalio.FONT, but that did not change the exception returned.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions