One “gotcha” to be aware of with new fonts: there is no “background” color option…
you can set this value but it will be ignored. This is on purpose and by design.
The default "classic" font is stored in the library file glcdfont.c, and is selected by calling setFont() with no argument, or NULL. The font is based on Code Page 437, the font used by the original IBM PC.
If you read over the link from @jremington, the documentation mentions a couple of ways to blank out the previous text in the background color before writing new text. It does not mention a very simple method, save the previous text that was written to the display, then re-write that in the background color before writing the new text.
I don't consider this as a "very simple method".
Say, if you use a half of dozen texts in different screen areas - you will need to store them all for a future rewrites.
To draw a rectangle with a background color seems to be a much suitable.
I tend to get a bit more flicker when drawing a rectangle than when overwriting the old text in the background color.
Using getTextBounds() has the disadvantage that you still need to either save the old text, or save the bounds of the old text, when using a proportional-spaced font. A bit less complex to just overwrite using a fixed size rectangle for the largest possible text area.
Thanks @david_2018, initially I just wanted to know what the default was so I can see if it is applicable for my application... which it is not. Also, the background fill of the default font is not so great either. It kind of starts exactly at the same pixel of the font rather than encompassing the font.
Have you guys tried the drawBitMap function with some of the fonts available in the font's library to stop the blink as stated in the GFX library documentation. So far it works, but I cannot seem to get the font any bigger. Even when I change text size.
// In global declarations:
GFXcanvas1 canvas(240, 320); // 240x320 pixel canvas
// In code later:
tft.setFont(&FreeMono9pt7b);
tft.setTextSize(1);
canvas.println("Loading...");
tft.drawBitmap(30, 155, canvas.getBuffer(), 240, 320, ST77XX_WHITE, ST77XX_BLACK);
The Adafruit GFX library has most of the font files in 9, 12, 18, and 24pt size. If you need another size, there is a folder with a fontconvert utility that can be used to generate the font in any size you want, you just need the source font ttf file.
Be careful, large fonts take a lot of memory.