0

Can the RA8875 change Font?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Can the RA8875 change Font?

by Forge on Fri Oct 06, 2017 6:42 pm

So I have been trying to get a little prototype for a product going and I am running into a silly issue I can not solve. I have a Arduino Mega 2560 R3 hooked up to a 7" TFT LCD with a RA8875 chip. I am simply trying to change my font; specifically to any of the ones included with the adafruit_gfx library. I'll post some code here to see if anyone can spot anything wrong.

Note that everything compiles and uploads smoothly without error. The LCD touchscreen also works very well and visual stuff such as the adafruit graphics demo runs well too.
I just cant change font. I also noticed

Code: Select all | TOGGLE FULL SIZE
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_RA8875.h>

#include <Fonts/FreeSansBold24pt7b.h>

#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;
float xScale = 1024.0F/850.0;
float yScale = 1024.0F/545.0;

void setup() {
  Serial.begin(9600);
  tft.begin(RA8875_800x480);
  tft.displayOn(true);
  tft.GPIOX(true);
  tft.PWM1config(true, RA8875_PWM_CLK_DIV1024);
  tft.PWM1out(255);

  tft.textMode();
  tft.setFont(&FreeSansBold24pt7b);
  tft.textSetCursor(80,200);
  tft.textEnlarge(8);
  tft.print("AXCDW0129314");
}

void loop() {

}

Forge
 
Posts: 1
Joined: Fri Oct 06, 2017 6:35 pm

Re: Can the RA8875 change Font?

by adafruit_support_rick on Sat Oct 07, 2017 9:03 am

tft.textMode sets the RA8875 to use its internal font. Don't go into text mode if you want to use a GFX font

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Can the RA8875 change Font?

by Tim_wb0wuq on Sat Jan 12, 2019 1:53 pm

I have the same issue. I have the Adafruit metro mini https://www.adafruit.com/product/2590 The Adafruit https://www.adafruit.com/?q=ra8875

The sketch compiles and loads, but does not render the fonts.

This same sketch compiles and loads with the 2.8" TFT LCD with touchscreen. https://www.adafruit.com/product/1770 and works great.

Please help!!

Tim
Attachments
font_test.ino
(1.76 KiB) Downloaded 23 times

Tim_wb0wuq
 
Posts: 3
Joined: Wed Jan 09, 2019 7:19 pm

Re: Can the RA8875 change Font?

by Tim_wb0wuq on Sat Jan 12, 2019 1:54 pm

I have the same issue. I have the Adafruit metro mini https://www.adafruit.com/product/2590 The Adafruit https://www.adafruit.com/?q=ra8875 with this screen https://www.adafruit.com/product/2354

All adafruit items.

The sketch compiles and loads, but does not render the fonts.

This same sketch compiles and loads with the 2.8" TFT LCD with touchscreen. https://www.adafruit.com/product/1770 and works great.

Please help!!

Tim
Attachments
font_test.ino
(1.76 KiB) Downloaded 21 times

Tim_wb0wuq
 
Posts: 3
Joined: Wed Jan 09, 2019 7:19 pm

Re: Can the RA8875 change Font?

by DocS2 on Mon Jul 29, 2019 1:23 pm

So, how do we display text without doing tft.SetTextMode()??

DocS2
 
Posts: 8
Joined: Mon Apr 16, 2018 1:22 pm

Re: Can the RA8875 change Font?

by clayton on Sat Aug 10, 2019 8:09 pm

Well, I can show you how to write one character.

Code: Select all | TOGGLE FULL SIZE
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_RA8875.h>

#include <Fonts/FreeSansBold24pt7b.h>

#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;
float xScale = 1024.0F/850.0;
float yScale = 1024.0F/545.0;

void setup() {
  Serial.begin(9600);
  tft.begin(RA8875_800x480);
  tft.displayOn(true);
  tft.GPIOX(true);
  tft.PWM1config(true, RA8875_PWM_CLK_DIV1024);
  tft.PWM1out(255);
 
  tft.fillScreen(RA8875_BLUE);
  unsigned char c = 'D';
  tft.setFont(&FreeSansBold24pt7b);
  tft.drawChar(400, 240, c, RA8875_WHITE, RA8875_BLUE, 2);
}

void loop() { }


Change the last five statements of your program to the last four above. The " tft.setFont" and "tft.drawChar" methods are from Adafruit_GFX library. If you can show me how to write more than one character at a time I would appreciate it.

clayton
 
Posts: 19
Joined: Wed Apr 18, 2012 1:20 pm

Please be positive and constructive with your questions and comments.