Using old BDF fonts in LVGL

I refined the Apple II bdf file in FontForge, which found Bad Glyph Names (that it corrected on export), and I removed glyphs above 0x7F to trim it down, then saved a new bdf. I then ran it through my modified bdf2lvgl script.

However, I still had the same only-displays-fallback-font issue. I then realized the c file had 0 cmap entries (a bdf with just the printable ascii range should have one cmap, and larger unicode fonts have more).

Then I noticed it also hade codepoints for the control chars (0x00 to 0x1F). I removed these in FontForge and tweaked the bdf a bit in a text editor to simplify the properties and verify glyphs were only defined for 0x20 to 0x7F and that is has a single cmap entry.

Finally it converted properly and displayed in lvgl and a double-sized version as well:
bmfont_9px_6x9_apple_II

So I am pretty happy that I got it running.

Attached is my modified bdf2lvgl python script:
gil-modified-bdf2lvgl-0.1.0.zip (31.3 KB)

And some bitmap (1bbp) font files:
gil-master-bdf-fonts.zip (39.2 KB)
gil-master-lvgl-c-fonts-from-bdf2lvgl.zip (52.8 KB)

1 Like