Go Down

Topic: UTFT_binFonts: addon library extending standard functionality print function (Read 1 time) previous topic - next topic

DenSyo

Jan 17, 2017, 02:10 pm Last Edit: Mar 31, 2019, 11:54 am by DenSyo Reason: update 2019-03-31
UTFT_binFonts - 31.03.2019

Replacing UTFT functions print() to support any font width. Font format support like the bdf-type, sometimes allows really save memory.

Code: [Select]
#include <UTFT.h>
#include <UTFT_binFonts.h>

extern uint8_t keyrus_8x16_glyph[];
extern uint8_t BigFont_12x16_glyph[];

UTFT myLCD(CTE32HR, 38, 39, 40, 41);
UTFT_binFonts charLCD(&myLCD);

void setup()
{
  myLCD.InitLCD();
  myLCD.clrScr();
}

void loop()
{
  myLCD.setBackColor(0, 0, 0);
  myLCD.setColor(0, 0, 255);
  charLCD.setFont(BigFont_12x16_glyph);
  charLCD.print("0123456789:;<=>?", CENTER, 16);
  charLCD.print("@ABCDEFGHIJKLMNO", CENTER, 32);
  charLCD.print("PQRSTUVWXYZ[\\]^_", CENTER, 48);

  while(1) {};
}


Includes font editor-converter based MS Excel.
https://forum.arduino.cc/index.php?topic=447956.0

Go Up