📬❄️📦Adafruit Holiday Shipping Deadlines 2019: Attention all domestic customers! Please place UPS Ground and USPS First Class & Priority orders by 11am ET Monday December 9, 2019 📬❄️📦 Attention all international customers! Please place all UPS WORLDWIDE EXPRESS; SAVER, and DHL EXPRESS WORLDWIDE orders by 11am ET Monday December 9, 2019 📬❄️📦
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 38 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 33 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: 9
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

Re: Can the RA8875 change Font?

by rlgjr562 on Sun Sep 01, 2019 5:43 pm

The only way I have been able to print on my display is using the internal fonts. There are several examples out there for the RA8875 and GFX external fonts, that I have not been able to make work. I have been using the following bit of code and it seems to work.

The tft.textEnlarge(0) displays the internal font the number 0 in this case scales the font I have used 0 through 3. the internal font is crude but it is easier to get to work.

You would not need the first two lines they create a black box on a graphic I have displayed.
Code: Select all | TOGGLE FULL SIZE
  tft.graphicsMode();
  tft.fillRect(325, 15, 150, 200, RA8875_BLACK);
  tft.textMode();                 // go to text mode
  //
  tft.textSetCursor(338, 20);
  tft.textTransparent(WHITE);
  tft.textEnlarge(0);
  tft.textWrite("Humidity");

  tft.textSetCursor(256, 35);
  tft.textTransparent(WHITE);
  tft.textEnlarge(2);
  tft.textWrite(humidity);

  tft.textSetCursor(413, 40);
  tft.textTransparent(WHITE);
  tft.textEnlarge(0);
  tft.textWrite("% RH");

rlgjr562
 
Posts: 55
Joined: Sun Jan 21, 2018 5:02 pm

Re: Can the RA8875 change Font?

by DonKrapf on Mon Oct 28, 2019 8:30 pm

I haven't done it but, according to the spec sheet (https://cdn-shop.adafruit.com/datasheets/RA8875_DS_V19_Eng.pdf), you can load a font into the RA8875 internal "CGRAM" (Character Generation RAM) and print with that just as you would with the internal ROM font. Once you have the font loaded, this is much faster and easier than drawing a character at a time.

The steps for loading and using your own font are on pages 113 and 114. Adafruit hasn't created a function to simplify this but, using Adafruit's low-level functions in the RA8875 library, you can can follow the steps in the spec sheet.

DonKrapf
 
Posts: 18
Joined: Tue Mar 22, 2016 10:23 am

Please be positive and constructive with your questions and comments.