SPFD5408 tft lcd font style for text display

Sir,
I have SPFD5408 tft lcd interfaced with arduino mega 2560. I have written the coding for text display on lcd. I want to change the font style of the text. Is there any option available for changing the font style suitable for SPFD5408 tft lcd?

Pls give me the solution.

Best Regards,
Rajan.

Is there any option available for changing the font style suitable for SPFD5408 tft lcd?

If the library that you are using, that you did not post a link to, does not offer that option, no.

Sir,
Sorry. I could not understand your reply what i asked. I have attached SPFD5408 tft lcd library here. Only i need to set the font style of the text like ( example - times new roman, calibri etc). Pls tell me how to write the software code.

Regards,
Rajan.

Sir,
Pls find attachments.

Regards,
Nagarajan.S

TouchScreen.h (800 Bytes)

glcdfont.c (8.16 KB)

pin_magic.h (18.6 KB)

registers.h (5.21 KB)

SPFD5408_Adafruit_GFX.cpp (16 KB)

SPFD5408_Adafruit_GFX.h (3.85 KB)

SPFD5408_Adafruit_TFTLCD.cpp (28.8 KB)

SPFD5408_Adafruit_TFTLCD.h (3.19 KB)

SPFD5408_TouchScreen.cpp (5.28 KB)

The font to be used is defined in glcdfont.c. If you convert each of the hex values in one row in that table to binary, and draw a grid that is 5 by 7 squares, and use each binary value to fill in one column (0 means empty; 1 means filled), you can see how each character is currently drawn.

Create a new 5 by 7 grid, and shade it the way you want each character drawn. Use the filled/unfilled cell information to create new font data for each character. Replace the data in the glcdfont.c file, and you will be using your new font.

Sir,
I got it partially what you replied. Can you give example code for drawing a single character it would be even easily understand for me. Pls reply me.

Regards,
Rajan.

Can you give example code for drawing a single character

You do not do what I suggested with code. You do it with paper and a pencil. I can't supply code for that, because you are missing a port to plug the USB cable into.

Sir,
Still i am in trouble to change the font style. Can you explain with one example. So that i can come to know, otherwise i cant do on my own. I am feeling difficult to do this task.

Regards,
Rajan.

Can you explain with one example.

The second character in the glcdfont.c is drawn using:

	0x3E, 0x5B, 0x4F, 0x5B, 0x3E,

0x3E = 0b00111110
0x5B = 0b01011011
0x4F = 0b01001111
0x5B = 0b01011011
0x3E = 0b00111110

Draw a 5 x 7 grid.
In the top row, color in the 3rd, 4th, 5th, 6th, and 7th squares.
In the next row, color in the 2nd, 4th, 5th, 7th, and 8th squares.
For the next row, where there is a 0 in the value, leave the square empty. Where there is a 1, color in the square.

Mirror the pattern of the 2nd row as the 4th row. Mirror the pattern of the 1st row as the 5th row.

Rotate the picture 90 degrees, to see what the character will look like.

Draw another 5 x 7 grid. Color in the squares that reflect what you want that character to look like.

Post both pictures.

Sir,
I have one more doubt that i want to clarify. I have given a link which explain about adafruit tft.

Will it work for SPDF5408 tft lcd?

Regards,
Rajan.

PaulS:
The second character in the glcdfont.c is drawn using:

	0x3E, 0x5B, 0x4F, 0x5B, 0x3E,

0x3E = 0b00111110
0x5B = 0b01011011
0x4F = 0b01001111
0x5B = 0b01011011
0x3E = 0b00111110

Draw a 5 x 7 grid.
In the top row, color in the 3rd, 4th, 5th, 6th, and 7th squares.
In the next row, color in the 2nd, 4th, 5th, 7th, and 8th squares.
For the next row, where there is a 0 in the value, leave the square empty. Where there is a 1, color in the square.

Mirror the pattern of the 2nd row as the 4th row. Mirror the pattern of the 1st row as the 5th row.

Rotate the picture 90 degrees, to see what the character will look like.

Draw another 5 x 7 grid. Color in the squares that reflect what you want that character to look like.

Post both pictures.

Sir,
I have drawn the character what you suggested. Now i can able to change the font style of the text by changing the hex values given in glcdfont.c

Regards,
Rajan

[/quote]

rajansn24:
Sir,
I have one more doubt that i want to clarify. I have given a link which explain about adafruit tft.

Using Fonts | Adafruit GFX Graphics Library | Adafruit Learning System

Will it work for SPDF5408 tft lcd?

Regards,
Rajan.

Sir,
Adafruit gfx library given 3 font formats Serif, Sans, Mono. Pls go through the link which i quoted previously and tell me whether can i use it for SPFD5408 tft lcd?

rajansn24:
Sir,
Adafruit gfx library given 3 font formats Serif, Sans, Mono. Pls go through the link which i quoted previously and tell me whether can i use it for SPFD5408 tft lcd?

I got it to work with 3 font formats Serif, Sans, Mono by followed the procedure of adafruit gfx library using fonts.