I added a simple font2c tool, very much in the style of png2c and obj2c. It uses freetype2 to create bitmaps of the entire ASCII set of glyphs out of a given font file (e.g. a .ttf file).
I also added a test case using the "LibreBaskerville-Regular.ttf" font that was already in the repo.
Some thoughts:
The addition to nobuild.c (line 11) needs work, as the include and link flags are system dependent. I was not sure on how to implement a smarter solution (probably using "pkg-config --cflags freetype2" ?)
LibreBaskerville looks a bit odd when rendered this way, because the olive.c text rendering mechanism only supports monospaced glyphs. I opted to align all glyphs to the left edge of their space, and some narrow letters look a little lost. There may be a way to be smarter about aligning the glyphs (centered?), or to add non-monospaced font support.
The tool uses 16pt font size for a 72dpi display (tools/font2c.c line 113), and there is no way for the user to configure this yet.
I added a simple font2c tool, very much in the style of png2c and obj2c. It uses freetype2 to create bitmaps of the entire ASCII set of glyphs out of a given font file (e.g. a .ttf file).
I also added a test case using the "LibreBaskerville-Regular.ttf" font that was already in the repo.
Some thoughts: