u8g2 custom font: missing rightmost pixels

Hi folks.

I'm trying to create (actually modify) a font for use with u8g2, in 8x8 mode. I followed this readme: https://github.com/olikraus/u8g2/blob/master/doc/faq.txt#L233

Problem is, my only test glyph is missing two pixels to the right... like they were removed to create a two pixel column "margin" sort of thing.

I looked at the actual font I was trying to modify (u8x8_font_pxplustandynewtv_f) and I saw characters that take the full 8x8 pixel square, no margins on those. So my guess is that it's not a margin added by the library.

I was wondering if I'm missing something on the command line for bdfconv or the export options in Fonty.

Here's my bdfconv: bdfconv -f 2 -m "32-255" -n "" -o tres.c Untitled.bdf

Fonty has some options I really don't know about, but to test I went with height 8px and ascent 8px... (I don't know what those do exactly). Left the other things as default.

Anyways, if you guys have any idea or tutorial to try out, That would be lovely.

Also, does anybody know of a way to reverse engineer a font? That is, get the data from the u8x8_fonts.c and get the bitmaps out of that. That way I could see how the pixels are drawn on a working font.

Thanks for the help.

There is no need to do reverse engineering. U8g2 includes the font sources. The conversion is documented here:

https://github.com/olikraus/u8g2/blob/99b63a38a3fde09a453fe0143c567bfa242d1c09/tools/font/build/build.c#L1241

 { 0,  "-r 72 -p 8", "PxPlus_TandyNew_TV.ttf", "pxplustandynewtv", 14, 0, BM_8, FM_C|FM_8, MM_F|MM_R|MM_U|MM_N, "" , ""},

So the source is the above named .ttf file, which can be found here:

https://github.com/olikraus/u8g2/tree/master/tools/font/ttf

Oliver