U8G2 -7 Segment font type

Good Afternoon,

Has anyone here ever create or come across a U8G2 (Numeric Only) font that resembled a 7 segment display? I'm looking for a nice bold (boxy) font about the size of the u8g2_font_logisoso34_tn.

I really only need numeric characters in this font...

Any help or pointers would be truly appreciated.

Have a great holiday weekend all!
Vin

Some discussion on this topic happend here: Add 7 Segment Font · Issue #253 · olikraus/u8g2 · GitHub

It includes some examples also.

Another option might be this buildin font: fntgrpu8g · olikraus/u8g2 Wiki · GitHub

Oliver

Oliver,

Thanks for the link, the font style "digitalnumbers_68_tn" is perfect for this project, however it is just about one size too big to fit 4 digits onto my display.
Can you possibly explain how I can reduce the size a little bit? I tried a few things but couldn't get results.

BTW, I added the font file you posted into the u8g2_fonts.c library and kept getting errors until I finally added the font name to the u8g2.h font list. Then everything loaded without error.

Here is your font file you posted in the other forum thread:

const uint8_t digitalnumbers_68_tn[347] U8G2_FONT_SECTION("digitalnumbers_68_tn") = 
  "\13\0\5\6\5\6\4\2\7\36+\0\0+\0+\0\0\0\0\0\1B \6\0\300\241\0\60%{"
  "]\303\342\62\62\341\7.Q\371\377b!\14\346`\4j`\14\346 \24\242\362\377\305\37\270\204\314\270"
  "\10\0\61\27E\365\245\42\60\6\341\7\66a\60\2c\20~\300\22\6# \0\62$ze\303\302\62"
  "\60A\23\62\2S\213\377o\134\4&`\211\313 X\342\377Y\214\310\4M\300\14\213\0\0\63\37y"
  "m\303\242\62.!\23\60\342B\213\377O\134\302\325\270\242\305\377'.!\26.\243\42\0\64\35[\335"
  "\303\42P\3c\60\7\241\20\225\377\277\250\13\231\221e\213\377\277;\310\1\1\0\65\42{]\303\342\62"
  "\62\241\26\62\242`\213\377g\63B\23\66A#\62\266\370\377D&\324Bf\134\4\0\66 {]\303"
  "\342\62\62\241\26\62\242`\213\377w\61\4\63\62A\27\225\377\27\x7f\340\22\62\343\42\0\67\36Z\345\303"
  "\302\62\60A\23\62\2S\213\377\317\16p\0\17l\241\26\377\377\354\0\7\4\0\70 {]\303\342\62"
  "\62\341\7.Q\371\x7f\21\24\62\343\62\62\1\24\225\377\27\x7f\340\22\62\343\42\0\71\36{]\303\342\62"
  "\62\341\7.Q\371\x7fQ\27\62#\313\26\377\237\310\204Z\310\214\213\0\0\0\0\0";

For anyone else having build errors, I added this line to the clib u8g2.h file font list and everything works great for me:

extern const uint8_t u8g2_font_digitalnumbers_68_tn[] U8G2_FONT_SECTION("u8g2_font_digitalnumbers_68_tn");

Thank you Oliver very much for all your hard work on this library!
Vince

The BDF source files are attached to the above mentioned U8g2 issue. You can import the bdf file into Fony.exe (fony) modify the font, export again as bdf and use bdfconv.exe from the u8g2 project to generate the font array.

One more point: You do not need to put the array into u8g2_fonts.c and update u8g2.h. You can just paste the array into your .ino file.

Oliver

Oliver,

Got the links and modified the BDF font. I then downloaded bdfconv.exe and ran it but it just flashes on the screen and goes away. I'm using Windows 10 64b, Could this be an issue with bdfconv.exe not running?

Thanks a lot,
Vin

vin7102:
Got the links and modified the BDF font. I then downloaded bdfconv.exe and ran it but it just flashes on the screen and goes away. I'm using Windows 10 64b, Could this be an issue with bdfconv.exe not running?

bdfconv.exe is a commandline tool. You have to run it within cmd.exe. The above mentioned u8g2 issue mentions the required commandline options.

Oliver

Oliver,

Thanks for the response. I read through the entire posts and I figured it out about 20min ago and just logged back in here to tell you I got it all working.. Great tool!!!

Thanks again for all your help!
Vince

vin7102:
Great tool!!!

Thanks. And all without having a GUI :wink:

Oliver

And all without having a GUI :wink:

Yeah for sure... wish everything was that simple!