16seg AlphaNumeric FONT for TFT

I know… More TFT font stuff? Promise I’ll stop beating this one up, but it has been fun playing with what might be possible that hasn’t already been done in this space.

It occurred to me that emulating a simple 16 segment Alpha/Numeric display might not look all that bad, and would offer some really cheap memory wise answers to simple text requirements without the overhead. I put this one aside to work on the other one that did a much nicer font, but decided to go back and finish this one anyway.

All the characters here map to a single two byte integer rather than a 5 byte dot matrix. The whole sketch with data in Program Space took up 3.5k. Have not compared that to the 5x8 dot option, but figured it might have some nostalgic application someplace.

Below is the code that created the screen shown. The rest of the code is attached if anyone is curious.

  t16FgColor = ILI9341_CYAN;                           // Set new default color
  
  t16Option = 0;                                       //Show lower case actual size
  char temp[]=" !@#$%^&*()_+=-{}[]:;\"'?/<>,.ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";
  draw16String(temp,0,0,1);                            //draw string and wrap screen
  t16FgColor = ILI9341_GREEN;                          // Set new default color

  t16Option = 1;                                       //Use smaller lower case 
  draw16String("Hello World",0,150,2,ILI9341_YELLOW);  //override default color
  t16Option = 2;                                       //Use all cap lower case
  draw16String("Hello World",0,190,2,ILI9341_PINK);

  draw16String("123",160,100,3);

draw16.c (9.28 KB)