Hi,
I used Dot Factory v0.1.4 to generate the code for 0123456789 Microsoft Sans Serif 16pts following @peekay123 pdf guide on https://github.com/pkourany/Adafruit_mfGFX_Library but I was not able to print to the 2.4"spi tft screen. Below is my test code:
testFontCus.ino
void test(void)
{
tft.setTextColor(ILI9341_BLACK, ILI9341_WHITE);
tft.setFont(MSS_16); // Microsoft Sans Serif 16pts
tft.setTextColor(ILI9341_RED, ILI9341_WHITE);
tft.setTextSize(1);
tft.setCursor(1,1);
tft.print("1"); // <---Not printing to tft display
tft.setFont(ARIAL_8);
tft.print("2"); //<-- works
}
fonts.cpp mod:
const uint8_t microsoftSansSerif_16ptBitmaps[] =
{
0x00, 0x90,
0x1E, 0x00, 0x3F, 0x00, 0x61, 0x80, 0x61, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xE1, 0xC0, 0x61, 0x80, 0x3F, 0x00, 0x1E, 0x00,
0x0C, 0x0C, 0x1C, 0xFC, 0xEC, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
0x3F, 0x00, 0x7F, 0x80, 0xE1, 0xC0, 0xC0, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0x80, 0x01, 0x80, 0x07, 0x00, 0x0C, 0x00, 0x18, 0x00, 0x30, 0x00, 0x60, 0x00, 0xFF, 0xC0, 0xFF, 0xC0,
0x3E, 0x00, 0x7F, 0x00, 0xE3, 0x80, 0xC1, 0x80, 0x01, 0x80, 0x03, 0x80, 0x0F, 0x00, 0x0F, 0x80, 0x01, 0x80, 0x00, 0xC0, 0x00, 0xC0, 0xC0, 0xC0, 0xE1, 0xC0, 0x7F, 0x80, 0x3E, 0x00,
0x01, 0x80, 0x03, 0x80, 0x07, 0x80, 0x07, 0x80, 0x0D, 0x80, 0x19, 0x80, 0x31, 0x80, 0x61, 0x80, 0xC1, 0x80, 0xFF, 0xE0, 0xFF, 0xE0, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80,
0x3F, 0x80, 0x3F, 0x80, 0x30, 0x00, 0x30, 0x00, 0x60, 0x00, 0x7F, 0x00, 0x7F, 0x80, 0x61, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0xC0, 0xC0, 0xE1, 0x80, 0x7F, 0x80, 0x3E, 0x00,
0x1F, 0x00, 0x3F, 0x80, 0x71, 0xC0, 0x60, 0xC0, 0xC0, 0x00, 0xDF, 0x00, 0xFF, 0x80, 0xE1, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x60, 0xC0, 0x71, 0x80, 0x3F, 0x80, 0x1E, 0x00,
0xFF, 0xC0, 0xFF, 0xC0, 0x00, 0xC0, 0x01, 0x80, 0x01, 0x80, 0x03, 0x00, 0x03, 0x00, 0x06, 0x00, 0x06, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x18, 0x00, 0x18, 0x00, 0x30, 0x00,
0x1E, 0x00, 0x3F, 0x00, 0x61, 0x80, 0x61, 0x80, 0x61, 0x80, 0x33, 0x00, 0x1E, 0x00, 0x3F, 0x00, 0x73, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xE1, 0xC0, 0x7F, 0x80, 0x3F, 0x00,
0x1E, 0x00, 0x7F, 0x00, 0x63, 0x80, 0xC1, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x61, 0xC0, 0x7F, 0xC0, 0x3E, 0xC0, 0x00, 0xC0, 0xC1, 0x80, 0xE3, 0x80, 0x7F, 0x00, 0x3E, 0x00,
};
const FontDescriptor microsoftSansSerif_16ptDescriptors[] =
{
{10, 15, 0},
{6, 15, 30},
{10, 15, 45},
{10, 15, 75},
{11, 15, 105},
{10, 15, 135},
{10, 15, 165},
{10, 15, 195},
{10, 15, 225},
{10, 15, 255}
};
fonts.h mod:
#define MSS_16 6
extern const uint8_t microsoftSansSerif_16ptBitmaps[];
extern const FontDescriptor microsoftSansSerif_16ptDescriptors[];
Adafruit_mfGFX.cpp mod:
case TEST:
fontData = testBitmaps;
fontDesc = testDescriptors;
fontKern = 1;
break;
case MSS_16:
Serial.println("IHERE"); //test info
fontData = microsoftSansSerif_16ptBitmaps;
fontDesc = microsoftSansSerif_16ptDescriptors;
fontKern = 1;
Serial.println("hereEnd"); //test info
break;
default:
font = ARIAL_8;
fontData = arial_8ptBitmaps;
fontDesc = arial_8ptDescriptors;
fontKern = 1;
break;
The custom font is being call and entering the case statement of Adafruit_mfGFX.cpp but I canβt figure out why its not displaying into the display. Any help will be grateful.
Thanks in advance.