Hi! Recently we've been really pushing up against the limits of what we can fit in Bangle.js's firmware (not helped by ~90k of Tensorflow!). One of the big blobs that takes up space in Bangle.js is actually the vector font (5kB), and I've been itching to try and find a way to improve it as it doesn't look great at the moment.
These are old-school vector fonts designed for plotters. It seems they could be packed into about a 1.5kB of flash, and would scale down really nicely. The gotcha is we'd need a way to draw lines bigger than 1 pixel wide, and they won't render very quickly because it's not easy to fill large areas.
Design our own vector font
I'm imagining a filled font where each character was:
in a 16x16 grid (lets us pack XY into one byte, and will scale down to 16px high).
A single polygon (such that we can pass it into the existing draw routines)
We could just have an SVG file and a write a script to extract the data from it.
I'd tried to export existing fonts, but we're pretty limited in what we can get in such a small footprint (see the GitHub issue) so I think we need something that embraces the limitations (ie polygons rather than smooth).
Would anyone be up for giving this a try? I uploaded my rough and ready test SVG file here - I reckon something in that form would be great - realistically for now it only needs to be the top half as well.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi! Recently we've been really pushing up against the limits of what we can fit in Bangle.js's firmware (not helped by ~90k of Tensorflow!). One of the big blobs that takes up space in Bangle.js is actually the vector font (5kB), and I've been itching to try and find a way to improve it as it doesn't look great at the moment.
There's an issue on GitHub open for it at https://github.com/espruino/Espruino/issues/1721
But basically it boils down to:
Use a Hershey font
These are old-school vector fonts designed for plotters. It seems they could be packed into about a 1.5kB of flash, and would scale down really nicely. The gotcha is we'd need a way to draw lines bigger than 1 pixel wide, and they won't render very quickly because it's not easy to fill large areas.
Design our own vector font
I'm imagining a filled font where each character was:
We could just have an SVG file and a write a script to extract the data from it.
I'd tried to export existing fonts, but we're pretty limited in what we can get in such a small footprint (see the GitHub issue) so I think we need something that embraces the limitations (ie polygons rather than smooth).
Would anyone be up for giving this a try? I uploaded my rough and ready test SVG file here - I reckon something in that form would be great - realistically for now it only needs to be the top half as well.
2 Attachments