Packed Font brings in some really nice quality-of-life improvements like larger fonts, text alignment, and contains a script + instructions for packing your own custom font. There’s even a screenshot utility that Mark used to capture these demo shots.
According to Mark
A Packed Font has the following features:
- Uses a binary format to encode font data in a memory efficent manner.
- When creating a Packed Font you can select just the characters you need for your application, further saving on memory.
- Supports proportional width fonts (i.e. each character can have a different width) which is more appropriate for larger fonts.
- Can be used to store icons as well as characters.
- Can be loaded/unloaded at runtime. You don’t need to build a new version of MicroPython from source to add a new font.
Its pretty wonderful to see people picking up PiicoDev and running with it. Variable fonts is something we would have really liked to release in time for the launch of the OLED module but - commercial constraints being what they are - we relied on the built-in font that comes with the
framebuff MicroPython class.
Mark messaged us through Support to give us the heads-up that they’d been working on this project and we’re super grateful for it. I’ve been able to road-test Packed Font on one of our latest test jigs where it’s performing beautifully. Here’s some shots demonstrating the 16-pixel packed font working seamlessly with other
PiicoDev_SSD1306.py features like shapes and graphics.
This pass graphic is actually a ‘baked’ bitmap image containing the “Pass” text and the tick graphic. This is a standard graphic used in many of our test jigs for visual clarity. The “Check LED” message is printed as text over the top of the image.
Packed Font addresses a few of the reasons for making this graphic ie. the large bold font could be baked as a new font, and the checkmark symbol could be shown as an image, or invoked as a symbol from a custom font set. That would allow positioning this text anywhere on the screen. As-is, the graphics are centred in the artwork so that’s where it has to be displayed.
Love your work, Mark Appreciate ya