Skip to content

Add font customization #47

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

Merged
merged 2 commits into from
Sep 5, 2023
Merged

Add font customization #47

merged 2 commits into from
Sep 5, 2023

Conversation

jerr0328
Copy link
Contributor

@jerr0328 jerr0328 commented Jul 22, 2023

The font is bundled in the framebuf dependency's examples (see: adafruit/Adafruit_CircuitPython_framebuf#11)

I don't have this board to test with, just contributing from Europython 2023 Sprints 👋

Copy link
Member

@tekktrik tekktrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small request, but otherwise looks ready to go!

"""
Draw text in the 8x8 matrix.

:param str strg: string to place in to display
:param int xpos: x position of LED in matrix
:param int ypos: y position of LED in matrix
:param int bit_value: > 1 sets the text, otherwise resets
:param str font_name: path to binary font file (default: "font5x8.bin")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding based on looking how FrameBuffer.text() works is that once the font is set for the Matrix8x8 it can't be changed, and it is set on the first call to this method. It may be helpful then to add that fact here to prevent future confusion.

@tekktrik
Copy link
Member

I am going to unlink the issue though, since that seems to be more of a problem with the default font not being included rather than the ability to alter it.

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a note about the font not being able to be changed after the first time.

This looks good to me now.

@FoamyGuy FoamyGuy merged commit 8b29b58 into adafruit:main Sep 5, 2023
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants