Once I had to use a Chinese TTF font in a project were storage was limited, and I managed to reduce the font size with FontForge open-source editor. It works well as long as your system support standard font formats like TrueType or OpenType, but on embedded systems with even fewer resources, it may not be workable due to the size of the font file, and the footprint of the required libraries.
Instead, you may have to prepare the font in an image editor and convert those into code with a script and that can be cumbersome. So Dominik Kapusta decided to write a little tool to simplify the process. Meet FontEdit.
The program allows you to import fonts, edit glyphs, and potentially add your own custom drawings. It does have some limitations as it only works with general-purpose fixed-width desktop font and imports font glyphs for characters in the ASCII printable range (32…126 or 0x20…0x7e). You can still add more glyphs manually outside of this range.
Once you’re done, you can export the font to an array compatible with C/C++, Arduino (using PROGMEM), or MicroPython/Python (list or bytes objects). Options for the export function include MSB and LSB mode, invert all the bits, tab size, and the font array name.
Once you’ve flashed the board with your program with the embedded font, you can try it out.
FontEdit is written in C++17 and relies on the Qt framework. It’s been tested on macOS, Ubuntu 18.04/19.10, Windows 10 as well as Raspberry Pi OS / Raspbian. You’ll find the installation packages and the source code on Github, as well as some documentation on Dominik’s blog.
Via embedsys on Twitter.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
Very nice, thanks for the rundown.
I’ve been looking for something like this. I need an 8×8 font for an LED display and all the ‘8×8’ fonts I can find are meant for larger matrixes–so they leave a blank row of pixels at the bottom as a border for the next line. I don’t have a next line, so that’s a waste of pixels. Thanks!
Thanks. That’s amazing!