I get a compile error when I try to set a different font in Adafruit GFX on a TFT display on my Arduino Uno.
I'm testing a new TFT shield for Arduino equipped with an ILI9341 by using the Adafuit GFX libraries and examples. The test program supplied with the library works fine out of the box displaying text and all kind of drawings on the screen.
However, the standard font built into the Adafruit GFX library is "blocky" to save memory space. They do provide other fonts, but I get an error when I try to invoke them.
The segment of code that throws the compile error is this one:
unsigned long testText1() {
tft.setFont(); // When I remove this line the sketch compiles OK
tft.fillScreen(BLACK);
tft.setCursor(0, 50);
tft.setTextColor(RED);
tft.setTextSize(13);
tft.println("1234");
}
When compiling I get this error:
"error: ‘class Adafruit_ILI9341_8bit_AS’ has no member named ‘setFont’"
According to Adafruit's GFX manual, the setFont()
procedure allows to define a new font or revert to the standard one.
I examined the libraries and nowhere could I find a procedure to select a font, yet the example has declarations like these below, so changing fonts should be possible:
#include <Adafruit_GFX_AS.h>
#include <Adafruit_ILI9341_8bit_AS.h>
#include <Font16.h>
// #include <Font32.h>
// #include <Font64.h>
// #include <Font72.h>
#include <Font7s.h>
#include <Load_fonts.h>
I would like to load the 7segment font with:
tft.setFont(&Font7s);
Does anybody have experience to share loading these fonts?