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.
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!
This project includes work done by other people, and released under permissive licenses. Specifically, these lovely people:
Dogica (released under SIL Open Font License)
Dogica bold (released under SIL Open Font License)
Peaberry Pixel Font (released under SIL Open Font License)
RaccoonSerif Pixel Font (released under SIL Open Font License)
Vote | Comment | Date |
---|---|---|
No votes yet :( | ||
File | Last edited | Size |
---|---|---|
__init__.py | 2022-01-03 10:48:49 | 4.3 KiB |
README.md | 2022-01-03 10:48:49 | 2.46 KiB |
Cozette13.py | 2022-01-03 10:48:49 | 7.63 KiB |
Dogica8.py | 2022-01-03 10:48:49 | 5.73 KiB |
DogicaBold8.py | 2022-01-03 10:48:49 | 6.05 KiB |
Gohufont11.py | 2022-01-03 10:48:49 | 6.82 KiB |
Gohufont14.py | 2022-01-03 10:48:49 | 8.04 KiB |
GohufontBold11.py | 2022-01-03 10:48:49 | 6.84 KiB |
GohufontBold14.py | 2022-01-03 10:48:49 | 8.05 KiB |
metadata.json | 2022-01-03 10:48:49 | 180 B |
Peaberry16.py | 2022-01-03 10:48:49 | 14.1 KiB |
RaccoonSerifBold16.py | 2022-01-03 10:48:49 | 13.92 KiB |
RaccoonSerifBase16.py | 2022-01-03 10:48:49 | 13.32 KiB |
RaccoonSerifMedium16.py | 2022-01-03 10:48:49 | 13.73 KiB |
RaccoonSerifMini12.py | 2022-01-03 10:48:49 | 7.81 KiB |