TFT display Adafruit Library text Fonts stay defaut

Hello, I bought a 7 "tft screen with the RA8875 shield and an arduino mega of buy.display. (See link)

Here is my problem: :confused:
When I try to change the font with those provided by the adafruit free library, the text remains with the default font.I read several post and forum, tried several different things in text mode and graphics mode, nothing works, font character remains by default.

I thank in advance anyone who can help me.

The adafruit Library Guide say:

Using GFX Fonts in Arduino Sketches
After #including the Adafruit_GFX and display-specific libraries, include the font file(s) you plan
to use in your sketch. For example:
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_TFTLCD.h> // Hardware-specific library
#include <Fonts/FreeMonoBoldOblique12pt7b.h>
#include <Fonts/FreeSerif9pt7b.h>

Each font takes up a bit of program space; larger fonts typically require more room. This is a
finite resource (about 32K max on an Arduino Uno for font data and all of your sketch code), so
choose carefully. Too big and the code will refuse to compile (or in some edge cases, may
compile but then won’t upload to the board). If this happens, use fewer or smaller fonts, or use
the standard built-in font.

Inside these .h files are several data structures, including one main font structure which will
usually have the same name as the font file (minus the .h). To select a font for subsequent
graphics operations, use the setFont() function, passing the address of this structure, such as:

tft.setFont(&FreeMonoBoldOblique12pt7b);

Subsequent calls to tft.print() will now use this font. Most other attributes that previously worked
with the built-in font (color, size, etc.) work similarly here.
To return to the standard fixed-size font, call setFont(), passing either NULL or no arguments:
tft.setFont();

Here is the code taken from an example of the library provided on the site buy display which I try to change the character font without success:

#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_RA8875.h"
#include <Fonts/FreeSerif12pt7b.h>

// Library only supports hardware SPI at this time
//Arduino DUE,Arduino mega2560,Arduino UNO
#define RA8875_INT 4
#define RA8875_CS 10
#define RA8875_RESET 9

Adafruit_RA8875 tft = Adafruit_RA8875(RA8875_CS, RA8875_RESET);
uint16_t tx, ty;

void setup()
{
Serial.begin(9600);
Serial.println("RA8875 start");

/* Initialise the display using 'RA8875_480x272' or 'RA8875_800x480' */
if (!tft.begin(RA8875_800x480)) {
Serial.println("RA8875 Not Found!");
while (1);
}

tft.displayOn(true);
tft.GPIOX(true); // Enable TFT - display enable tied to GPIOX
tft.PWM1config(true, RA8875_PWM_CLK_DIV1024); // PWM output for backlight
tft.PWM1out(255);
tft.fillScreen(RA8875_BLACK);

/* Switch to text mode */
tft.textMode();

//
tft.textMode();
//tft.graphicsMode();
tft.textSetCursor(100, 100);
tft.setFont(&FreeSerif12pt7b);
tft.textEnlarge(1);
tft.textTransparent(RA8875_GREEN);
tft.print("test");
delay(2000);

}

void loop()
{

}

RA8875-TextMod.ino (1.37 KB)

I ended up using another library than the one provided on the buy display site.

Several examples of font usage are provided and working well.

here is the link

Unfortunately, same issue for me with a RA8875 4.3" TFT from the same seller. :confused:

RA8875 has several built in fonts. And can access an external Font chip in hardware at blinding speed.

Yes, you can always provide Fonts in software.

David.

Problem is, the SumoToy library is no longer actively supported.

The problem seems to occur with any display I connect to an Adafruit RA8875 breakout board - only default fonts seem to work. Does anyone know a way to use the Adafruit GFX fonts with the RA8875 other than the SumoToy library?

Surely Adafruit_RA8875 library would be suitable e.g. GitHub - adafruit/Adafruit_RA8875: Adafruit Arduino library driver for the RA8875 TFT driver
Especially if you bought the RA8875 display from Adafruit in the first olace.

No, I have never tried Adafruit_RA8875

David.