Epaper fonts - martinberlin/cale-idf GitHub Wiki

Using Adafruit GFX library Fontconvert tools can convert TrueType fonts into C readable fonts. To understand how that works please read the "Using fonts" section in Adafruit.

Adding new fonts

If you want to create new font sizes not included with the library, or adapt entirely new fonts, we have a command-line tool (in the “fontconvert” folder) for this. It should work on many Linux- or UNIX-like systems. Building this tool requires the gcc compiler and FreeType library. Most Linux distributions include both by default. To use this tool from the root of this repository just go to the fontconvert folder:

cd components/Adafruit-GFX/fontconvert

And use it as described in Adafruit documentation:

./fontconvert /usr/share/fonts/truetype/ubuntu/Ubuntu-M.ttf 18 32 252 > ../Fonts/Ubuntu_M18pt8b.h

fontconvert expects at least two arguments: a font filename (such as a scalable TrueType vector font) and a size, in points (72 points = 1 inch; the code presumes a screen resolution similar to the Adafruit 2.8" TFT displays).

fontconvert /path/to/ttf size_in_points from_char to_char > destination.h

The to_char is useful to add characters that are outside the standard alphabet, like german umlauten (äöü) and spanish/french accents (ó ñ).