Pretty Bold (all caps) vector Font for TFT

So I really needed to dump the dots for the text in a current clock calendar project, and so I wrote this short program to actually draw out the capital letters, numbers, and a few other key characters. Figured I would share in case someone else would like some pretty titles on their little TFT.

It really came out a lot smaller than I expected when I started. Efforts to try and bit map patterns just used up more space so I just stuck with the hard coded version. Plus it is a bit easier to add new characters if anyone is interested. Total sketch was 13838 bytes.

It is fairly well documented and tested, and not really hard to use. Here is a picture of what it can do and the code that created the picture as a reference, shown with an Adafruit_ILI9341 2.8 touch and an Arduino UNO.

Right now it clears with a background color, but you could easily remove that one line and use it to write over existing images.

The larger entire code file is attached as-is for anyone interested.


  vtextDirection = 1;  
  vtextDirection = 0;
  vtextDrawString("HELLO WORLD",0,0,1,ILI9341_GREEN);
  vtextDirection = 1;  
  vtextDrawString("HELLO WORLD",0,0,1,ILI9341_RED);
  vtextDirection = 2;  
  vtextDrawString("HELLO WORLD",0,0,1,ILI9341_MAGENTA);
  vtextDirection = 3;  
  vtextDrawString("HELLO WORLD",0,0,1,ILI9341_YELLOW); 
  vtextDirection = 1;    
  vtextDrawString("Limited Characters",25,195,2,ILI9341_CYAN);  
  vtextDrawString("Lower Case Caps",25,220,2,ILI9341_CYAN);

vtext.c (14.7 KB)

Thank you once again, you are a very useful Newbie :D

And where is a version for those that prefer compressed coding ;) Kidding of course, keep on this way.

That's funny! :)

Grew up with COBOL, but always loved APL. Sort of opposite ends of the code size spectrum.