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.setCursor(0, 50);

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:


Does anybody have experience to share loading these fonts?

3 Answers 3


Newer versions of the library CAN use fonts.

#include <Fonts/FreeSerifBold12pt7b.h>

and then...


Whether they work or not, I dunno. Case closed, lol!


Tested on Windows, with newest libraries Adafruit-GFX and Adafruit_PCD8544 (Nokia5110 LCD connected to Arduino Nano).

#include <Fonts/FreeSerifBold12pt7b.h>

and then


Then there is one very important difference how to use function drawChar(...). Coordinates of character (x,y) begins in left-bottom corner of character instead of top-left corner so this will not work (you will see only about 1 px of character):

matrix.drawChar(0,0,'1', 1, 0, 6),

Use this to show all pixels of character:

matrix.drawChar(20,20,'1', 1, 0, 6),

Full manual for using fonts here: Adafruit GFX Graphics Library - Using Fonts


Looking further into documentation on the Adafruit website they indicate that indeed, their GFX library published on GitHub does not handle different fornts.

Case closed :-)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.