MCH2022 badge?
go to mch2022.badge.team

pixelfont_gallery rev. 1 (by hirnsalat)

Pixelfont Gallery

Renders pixelfonts in micropython. Why do this? Pixelfonts are often more legible at small sizes than vector fonts. Also, you can add new fonts without modifying the firmware.

How to use in your own app

Copy writer_card10.py and any fonts to your app folder and import them. Fonts take a lot of RAM, so it's best not to use too many. Importing all the fonts in the demo at once will crash your app!

Use the TextBuffer and MultilineTextBuffer classes to render your text. Both of these internally handle FrameBuffers, so it's best to not make too many of these objects often.

TextBuffer displays a single line of text. It's perfect for sensor readouts and similar displays. It only rerenders the text if it changes, so putting it on the display is very fast otherwise.

MultilineTextBuffer is for displaying bigger amounts of text, like instructions or notifications. You can construct writers with different fonts and mix them, for creating bold text and similar effects.

If you want to encode your own fonts, take a look at the micropython-font-to-py repository. Be aware that you have to use the -x flag when encoding!

Attribution/Open Source Licenses

This project includes work done by other people, and released under permissive licenses. Specifically, these lovely people:

Category: graphics
Status: unknown
Vote Comment Date
No votes yet :(
Compatibility
  • card10: unknown
Dependencies
  • No dependencies found
Dependants
  • No dependants found
File Last edited Size
writer_card10.py 2022-01-03 10:48:49 12.52 KiB