From fc39a889e1ed6fbbe3ebe44e9afcd719991c9b00 Mon Sep 17 00:00:00 2001 From: Colin Murdoch Date: Thu, 9 Jan 2025 18:08:19 +0000 Subject: [PATCH 1/9] Changes for multi font Changes for multi-Fonts --- TFT_eSPIDisplay.cpp | 35 +++++++++++++++++++++++++++++++---- TFT_eSPIDisplay.h | 18 +++++++++++++++--- 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/TFT_eSPIDisplay.cpp b/TFT_eSPIDisplay.cpp index e5a755c..9e56f41 100644 --- a/TFT_eSPIDisplay.cpp +++ b/TFT_eSPIDisplay.cpp @@ -25,28 +25,55 @@ bool TFT_eSPIDisplay::_tftInitialised = false; TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour) { _rotation = rotation; - _textSize = textSize; + //_textSize = textSize; + _textSize = 1; // default text size to save amending display routine. _textColour = textColour; _backgroundColour = backgroundColour; if (_tft == nullptr) { _tft = new TFT_eSPI(); } - _gfxFont = TEXT_FONT; + switch (textSize) { + case 1: + _gfxFont = TEXT_FONT; + break; + case 2: + _gfxFont = ALTERNATE_FONT1; + case 3: + _gfxFont = ALTERNATE_FONT2; + break; + default: + _gfxFont = TEXT_FONT; + break; + } } TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour, int csPin) { _rotation = rotation; - _textSize = textSize; + _textSize = 1; // default text size to save amending display routine. _textColour = textColour; _backgroundColour = backgroundColour; _csPin = csPin; if (_tft == nullptr) { _tft = new TFT_eSPI(); } - _gfxFont = TEXT_FONT; + switch (textSize) { + case 1: + _gfxFont = TEXT_FONT; + break; + case 2: + _gfxFont = ALTERNATE_FONT1; + case 3: + _gfxFont = ALTERNATE_FONT2; + break; + default: + _gfxFont = TEXT_FONT; + break; + } + } + void TFT_eSPIDisplay::begin() { LOG(LogLevel::LOG_DEBUG, "TFT_eSPIDisplay::begin[%d]()", _displayId); if (!_tftInitialised) { diff --git a/TFT_eSPIDisplay.h b/TFT_eSPIDisplay.h index e1c223c..04599f0 100644 --- a/TFT_eSPIDisplay.h +++ b/TFT_eSPIDisplay.h @@ -35,18 +35,28 @@ #define FONT_TFT_ESPI_MEDIUM_SANS &FreeSans12pt7b #define FONT_TFT_ESPI_LARGE_SANS &FreeSans18pt7b #define FONT_TFT_ESPI_XLARGE_SANS &FreeSans24pt7b +#define FONT_TFT_ESPI_MEDIUM_BOLD &FreeMonoBold12pt7b +#define FONT_TFT_ESPI_SERIF_BOLD_ITALIC &FreeSerifBoldItalic12pt7b // If not overridden by myConfig.h, set the font #ifndef TEXT_FONT -#define TEXT_FONT FONT_TFT_ESPI_MEDIUM -#endif // TEXT_FONT - +#define TEXT_FONT FONT_TFT_ESPI_MEDIUM_BOLD +#endif +#ifndef ALTERNATE_FONT1 +#define ALTERNATE_FONT1 FONT_TFT_ESPI_MEDIUM_BOLD +#endif +#ifndef ALTERNATE_FONT2 +#define ALTERNATE_FONT2 FONT_TFT_ESPI_SERIF_BOLD_ITALIC +#endif + +//#define LOCAL_FONT FONT_TFT /// @brief Display class for TFT_eSPI based displays class TFT_eSPIDisplay : public DisplayInterface { public: /// @brief Constructor for a TFT_eSPIDisplay instance /// @param rotation Rotation of the display, 0 - 3, refer to TFT_eSPI documentation for details /// @param textSize Multiplier for the text size, refer to TFT_eSPI documentation for details + // Now used as the alternate font ID. /// @param textColour Default 16bit text colour, refer to TFT_eSPI documentation for details /// @param backgroundColour Default 16bit background colour, refer to TFT_eSPI documentation for details TFT_eSPIDisplay(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour); @@ -59,6 +69,8 @@ class TFT_eSPIDisplay : public DisplayInterface { /// @param csPin Pin this display's chip select (CS) pin is connected to to enable manual display switching TFT_eSPIDisplay(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour, int csPin); + + /// @brief Perform any initial once off setup or configuration here and call only once void begin() override; From fb72d9f1c1d15a3963354d9aa305d0f64790abca Mon Sep 17 00:00:00 2001 From: Colin Murdoch Date: Fri, 10 Jan 2025 19:12:34 +0000 Subject: [PATCH 2/9] Multi Font Changes Changes to Display definition to allow multi fonts. --- TFT_eSPIDisplay.cpp | 72 +++++++++++++++++++++++++-------------------- TFT_eSPIDisplay.h | 38 +++++++++++++----------- 2 files changed, 61 insertions(+), 49 deletions(-) diff --git a/TFT_eSPIDisplay.cpp b/TFT_eSPIDisplay.cpp index 9e56f41..7bf0e43 100644 --- a/TFT_eSPIDisplay.cpp +++ b/TFT_eSPIDisplay.cpp @@ -23,7 +23,8 @@ TFT_eSPI *TFT_eSPIDisplay::_tft = nullptr; bool TFT_eSPIDisplay::_tftInitialised = false; -TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour) { +//TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour) { +TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, GFXfont textFont, uint16_t textColour, uint16_t backgroundColour) { _rotation = rotation; //_textSize = textSize; _textSize = 1; // default text size to save amending display routine. @@ -32,22 +33,23 @@ TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, uint8_t textSize, uint16_t te if (_tft == nullptr) { _tft = new TFT_eSPI(); } - switch (textSize) { - case 1: - _gfxFont = TEXT_FONT; - break; - case 2: - _gfxFont = ALTERNATE_FONT1; - case 3: - _gfxFont = ALTERNATE_FONT2; - break; - default: - _gfxFont = TEXT_FONT; - break; - } + _gfxFont = textFont; + // switch (textSize) { + // case 1: + // _gfxFont = TEXT_FONT; + // break; + // case 2: + // _gfxFont = ALTERNATE_FONT1; + // case 3: + // _gfxFont = ALTERNATE_FONT2; + // break; + // default: + // _gfxFont = TEXT_FONT; + // break; + // } } -TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour, +TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, GFXfont textFont, uint16_t textColour, uint16_t backgroundColour, int csPin) { _rotation = rotation; _textSize = 1; // default text size to save amending display routine. @@ -57,19 +59,20 @@ TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, uint8_t textSize, uint16_t te if (_tft == nullptr) { _tft = new TFT_eSPI(); } - switch (textSize) { - case 1: - _gfxFont = TEXT_FONT; - break; - case 2: - _gfxFont = ALTERNATE_FONT1; - case 3: - _gfxFont = ALTERNATE_FONT2; - break; - default: - _gfxFont = TEXT_FONT; - break; - } + _gfxFont = textFont; + // switch (textSize) { + // case 1: + // _gfxFont = TEXT_FONT; + // break; + // case 2: + // _gfxFont = ALTERNATE_FONT1; + // case 3: + // _gfxFont = ALTERNATE_FONT2; + // break; + // default: + // _gfxFont = TEXT_FONT; + // break; + // } } @@ -171,15 +174,20 @@ TFT_eSPI *TFT_eSPIDisplay::getTFT_eSPIInstance() { bool TFT_eSPIDisplay::tftInitialised() { return _tftInitialised; } -TFT_eSPIDisplay *TFT_eSPIDisplay::create(uint8_t rotation, uint8_t textSize, uint16_t textColour, +// TFT_eSPIDisplay *TFT_eSPIDisplay::create(uint8_t rotation, uint8_t textSize, uint16_t textColour, +// uint16_t backgroundColour) { +// TFT_eSPIDisplay *newDisplay = new TFT_eSPIDisplay(rotation, textSize, textColour, backgroundColour); +// return newDisplay; +// } +TFT_eSPIDisplay *TFT_eSPIDisplay::create(uint8_t rotation, GFXfont textFont, uint16_t textColour, uint16_t backgroundColour) { - TFT_eSPIDisplay *newDisplay = new TFT_eSPIDisplay(rotation, textSize, textColour, backgroundColour); + TFT_eSPIDisplay *newDisplay = new TFT_eSPIDisplay(rotation, textFont, textColour, backgroundColour); return newDisplay; } -TFT_eSPIDisplay *TFT_eSPIDisplay::create(uint8_t rotation, uint8_t textSize, uint16_t textColour, +TFT_eSPIDisplay *TFT_eSPIDisplay::create(uint8_t rotation, GFXfont textFont, uint16_t textColour, uint16_t backgroundColour, int csPin) { - TFT_eSPIDisplay *newDisplay = new TFT_eSPIDisplay(rotation, textSize, textColour, backgroundColour, csPin); + TFT_eSPIDisplay *newDisplay = new TFT_eSPIDisplay(rotation, textFont, textColour, backgroundColour, csPin); return newDisplay; } diff --git a/TFT_eSPIDisplay.h b/TFT_eSPIDisplay.h index 04599f0..3c0e228 100644 --- a/TFT_eSPIDisplay.h +++ b/TFT_eSPIDisplay.h @@ -27,27 +27,27 @@ #include // Define the standard fonts available for this display type -#define FONT_TFT_ESPI_SMALL &FreeMono9pt7b -#define FONT_TFT_ESPI_MEDIUM &FreeMono12pt7b -#define FONT_TFT_ESPI_LARGE &FreeMono18pt7b +// #define FONT_TFT_ESPI_SMALL &FreeMono9pt7b +// #define FONT_TFT_ESPI_MEDIUM &FreeMono12pt7b +// #define FONT_TFT_ESPI_LARGE &FreeMono18pt7b #define FONT_TFT_ESPI_XLARGE &FreeMono24pt7b #define FONT_TFT_ESPI_SMALL_SANS &FreeSans9pt7b #define FONT_TFT_ESPI_MEDIUM_SANS &FreeSans12pt7b #define FONT_TFT_ESPI_LARGE_SANS &FreeSans18pt7b #define FONT_TFT_ESPI_XLARGE_SANS &FreeSans24pt7b -#define FONT_TFT_ESPI_MEDIUM_BOLD &FreeMonoBold12pt7b -#define FONT_TFT_ESPI_SERIF_BOLD_ITALIC &FreeSerifBoldItalic12pt7b +//#define FONT_TFT_ESPI_MEDIUM_BOLD &FreeMonoBold12pt7b +//#define FONT_TFT_ESPI_SERIF_BOLD_ITALIC &FreeSerifBoldItalic12pt7b // If not overridden by myConfig.h, set the font #ifndef TEXT_FONT #define TEXT_FONT FONT_TFT_ESPI_MEDIUM_BOLD #endif -#ifndef ALTERNATE_FONT1 -#define ALTERNATE_FONT1 FONT_TFT_ESPI_MEDIUM_BOLD -#endif -#ifndef ALTERNATE_FONT2 -#define ALTERNATE_FONT2 FONT_TFT_ESPI_SERIF_BOLD_ITALIC -#endif +// #ifndef ALTERNATE_FONT1 +// #define ALTERNATE_FONT1 FONT_TFT_ESPI_MEDIUM_BOLD +// #endif +// #ifndef ALTERNATE_FONT2 +// #define ALTERNATE_FONT2 FONT_TFT_ESPI_SERIF_BOLD_ITALIC +// #endif //#define LOCAL_FONT FONT_TFT /// @brief Display class for TFT_eSPI based displays @@ -59,7 +59,8 @@ class TFT_eSPIDisplay : public DisplayInterface { // Now used as the alternate font ID. /// @param textColour Default 16bit text colour, refer to TFT_eSPI documentation for details /// @param backgroundColour Default 16bit background colour, refer to TFT_eSPI documentation for details - TFT_eSPIDisplay(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour); + //TFT_eSPIDisplay(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour); + TFT_eSPIDisplay(uint8_t rotation, GFXfont *textfont, uint16_t textColour, uint16_t backgroundColour); /// @brief Alternate constructor for a TFT_eSPIDisplay instance to specify the CS pin to allow for two displays /// @param rotation Rotation of the display, 0 - 3, refer to TFT_eSPI documentation for details @@ -67,8 +68,8 @@ class TFT_eSPIDisplay : public DisplayInterface { /// @param textColour Default 16bit text colour, refer to TFT_eSPI documentation for details /// @param backgroundColour Default 16bit background colour, refer to TFT_eSPI documentation for details /// @param csPin Pin this display's chip select (CS) pin is connected to to enable manual display switching - TFT_eSPIDisplay(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour, int csPin); - + //TFT_eSPIDisplay(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour, int csPin); + TFT_eSPIDisplay(uint8_t rotation, GFXfont *textfont, uint16_t textColour, uint16_t backgroundColour, int csPin); /// @brief Perform any initial once off setup or configuration here and call only once @@ -110,7 +111,8 @@ class TFT_eSPIDisplay : public DisplayInterface { /// @param textColour Default 16bit text colour, refer to TFT_eSPI documentation for details /// @param backgroundColour Default 16bit background colour, refer to TFT_eSPI documentation for details /// @return Pointer to a new TFT_eSPIDisplay instance - static TFT_eSPIDisplay *create(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour); + //static TFT_eSPIDisplay *create(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour); + static TFT_eSPIDisplay *create(uint8_t rotation, GFXfont textFont, uint16_t textColour, uint16_t backgroundColour); /// @brief Alternate static method to enable the compiler to generate create commands from myDevices.h entries /// @param rotation rotation Rotation of the display, 0 - 3, refer to TFT_eSPI documentation for details @@ -119,8 +121,10 @@ class TFT_eSPIDisplay : public DisplayInterface { /// @param backgroundColour Default 16bit background colour, refer to TFT_eSPI documentation for details /// @param csPin Pin this display's chip select (CS) pin is connected to to enable manual display switching /// @return Pointer to a new TFT_eSPIDisplay instance - static TFT_eSPIDisplay *create(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour, - int csPin); + // static TFT_eSPIDisplay *create(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour, + // int csPin); + static TFT_eSPIDisplay *create(uint8_t rotation, GFXfont textFont, uint16_t textColour, uint16_t backgroundColour, + int csPin); /// @brief Destructor for the TFT_eSPIDisplay ~TFT_eSPIDisplay() override; From 900c78e0fef8d354d7f3b60945f19aa06e8b5289 Mon Sep 17 00:00:00 2001 From: Colin Murdoch Date: Sat, 11 Jan 2025 12:53:30 +0000 Subject: [PATCH 3/9] Correct Pointers Correct GFXFont pointers --- TFT_eSPIDisplay.cpp | 8 ++++---- TFT_eSPIDisplay.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/TFT_eSPIDisplay.cpp b/TFT_eSPIDisplay.cpp index 7bf0e43..aa81d0a 100644 --- a/TFT_eSPIDisplay.cpp +++ b/TFT_eSPIDisplay.cpp @@ -24,7 +24,7 @@ TFT_eSPI *TFT_eSPIDisplay::_tft = nullptr; bool TFT_eSPIDisplay::_tftInitialised = false; //TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour) { -TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, GFXfont textFont, uint16_t textColour, uint16_t backgroundColour) { +TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, const GFXfont *textFont, uint16_t textColour, uint16_t backgroundColour) { _rotation = rotation; //_textSize = textSize; _textSize = 1; // default text size to save amending display routine. @@ -49,7 +49,7 @@ TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, GFXfont textFont, uint16_t te // } } -TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, GFXfont textFont, uint16_t textColour, uint16_t backgroundColour, +TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, const GFXfont *textFont, uint16_t textColour, uint16_t backgroundColour, int csPin) { _rotation = rotation; _textSize = 1; // default text size to save amending display routine. @@ -179,13 +179,13 @@ bool TFT_eSPIDisplay::tftInitialised() { return _tftInitialised; } // TFT_eSPIDisplay *newDisplay = new TFT_eSPIDisplay(rotation, textSize, textColour, backgroundColour); // return newDisplay; // } -TFT_eSPIDisplay *TFT_eSPIDisplay::create(uint8_t rotation, GFXfont textFont, uint16_t textColour, +TFT_eSPIDisplay *TFT_eSPIDisplay::create(uint8_t rotation, const GFXfont *textFont, uint16_t textColour, uint16_t backgroundColour) { TFT_eSPIDisplay *newDisplay = new TFT_eSPIDisplay(rotation, textFont, textColour, backgroundColour); return newDisplay; } -TFT_eSPIDisplay *TFT_eSPIDisplay::create(uint8_t rotation, GFXfont textFont, uint16_t textColour, +TFT_eSPIDisplay *TFT_eSPIDisplay::create(uint8_t rotation, const GFXfont *textFont, uint16_t textColour, uint16_t backgroundColour, int csPin) { TFT_eSPIDisplay *newDisplay = new TFT_eSPIDisplay(rotation, textFont, textColour, backgroundColour, csPin); return newDisplay; diff --git a/TFT_eSPIDisplay.h b/TFT_eSPIDisplay.h index 3c0e228..66cfd9f 100644 --- a/TFT_eSPIDisplay.h +++ b/TFT_eSPIDisplay.h @@ -60,7 +60,7 @@ class TFT_eSPIDisplay : public DisplayInterface { /// @param textColour Default 16bit text colour, refer to TFT_eSPI documentation for details /// @param backgroundColour Default 16bit background colour, refer to TFT_eSPI documentation for details //TFT_eSPIDisplay(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour); - TFT_eSPIDisplay(uint8_t rotation, GFXfont *textfont, uint16_t textColour, uint16_t backgroundColour); + TFT_eSPIDisplay(uint8_t rotation, const GFXfont *textfont, uint16_t textColour, uint16_t backgroundColour); /// @brief Alternate constructor for a TFT_eSPIDisplay instance to specify the CS pin to allow for two displays /// @param rotation Rotation of the display, 0 - 3, refer to TFT_eSPI documentation for details @@ -69,7 +69,7 @@ class TFT_eSPIDisplay : public DisplayInterface { /// @param backgroundColour Default 16bit background colour, refer to TFT_eSPI documentation for details /// @param csPin Pin this display's chip select (CS) pin is connected to to enable manual display switching //TFT_eSPIDisplay(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour, int csPin); - TFT_eSPIDisplay(uint8_t rotation, GFXfont *textfont, uint16_t textColour, uint16_t backgroundColour, int csPin); + TFT_eSPIDisplay(uint8_t rotation, const GFXfont *textfont, uint16_t textColour, uint16_t backgroundColour, int csPin); /// @brief Perform any initial once off setup or configuration here and call only once @@ -112,7 +112,7 @@ class TFT_eSPIDisplay : public DisplayInterface { /// @param backgroundColour Default 16bit background colour, refer to TFT_eSPI documentation for details /// @return Pointer to a new TFT_eSPIDisplay instance //static TFT_eSPIDisplay *create(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour); - static TFT_eSPIDisplay *create(uint8_t rotation, GFXfont textFont, uint16_t textColour, uint16_t backgroundColour); + static TFT_eSPIDisplay *create(uint8_t rotation, const GFXfont *textFont, uint16_t textColour, uint16_t backgroundColour); /// @brief Alternate static method to enable the compiler to generate create commands from myDevices.h entries /// @param rotation rotation Rotation of the display, 0 - 3, refer to TFT_eSPI documentation for details @@ -123,7 +123,7 @@ class TFT_eSPIDisplay : public DisplayInterface { /// @return Pointer to a new TFT_eSPIDisplay instance // static TFT_eSPIDisplay *create(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour, // int csPin); - static TFT_eSPIDisplay *create(uint8_t rotation, GFXfont textFont, uint16_t textColour, uint16_t backgroundColour, + static TFT_eSPIDisplay *create(uint8_t rotation, const GFXfont *textFont, uint16_t textColour, uint16_t backgroundColour, int csPin); /// @brief Destructor for the TFT_eSPIDisplay From 1304a0a267bbea034c47460d4fc3fd68a109e0b7 Mon Sep 17 00:00:00 2001 From: Colin Murdoch Date: Sat, 11 Jan 2025 16:37:02 +0000 Subject: [PATCH 4/9] Remove old code Remove Old Code --- TFT_eSPIDisplay.cpp | 34 +--------------------------------- TFT_eSPIDisplay.h | 28 ++++++++++------------------ 2 files changed, 11 insertions(+), 51 deletions(-) diff --git a/TFT_eSPIDisplay.cpp b/TFT_eSPIDisplay.cpp index aa81d0a..d29cf93 100644 --- a/TFT_eSPIDisplay.cpp +++ b/TFT_eSPIDisplay.cpp @@ -23,10 +23,8 @@ TFT_eSPI *TFT_eSPIDisplay::_tft = nullptr; bool TFT_eSPIDisplay::_tftInitialised = false; -//TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour) { TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, const GFXfont *textFont, uint16_t textColour, uint16_t backgroundColour) { _rotation = rotation; - //_textSize = textSize; _textSize = 1; // default text size to save amending display routine. _textColour = textColour; _backgroundColour = backgroundColour; @@ -34,19 +32,7 @@ TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, const GFXfont *textFont, uint _tft = new TFT_eSPI(); } _gfxFont = textFont; - // switch (textSize) { - // case 1: - // _gfxFont = TEXT_FONT; - // break; - // case 2: - // _gfxFont = ALTERNATE_FONT1; - // case 3: - // _gfxFont = ALTERNATE_FONT2; - // break; - // default: - // _gfxFont = TEXT_FONT; - // break; - // } + } TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, const GFXfont *textFont, uint16_t textColour, uint16_t backgroundColour, @@ -60,19 +46,6 @@ TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, const GFXfont *textFont, uint _tft = new TFT_eSPI(); } _gfxFont = textFont; - // switch (textSize) { - // case 1: - // _gfxFont = TEXT_FONT; - // break; - // case 2: - // _gfxFont = ALTERNATE_FONT1; - // case 3: - // _gfxFont = ALTERNATE_FONT2; - // break; - // default: - // _gfxFont = TEXT_FONT; - // break; - // } } @@ -174,11 +147,6 @@ TFT_eSPI *TFT_eSPIDisplay::getTFT_eSPIInstance() { bool TFT_eSPIDisplay::tftInitialised() { return _tftInitialised; } -// TFT_eSPIDisplay *TFT_eSPIDisplay::create(uint8_t rotation, uint8_t textSize, uint16_t textColour, -// uint16_t backgroundColour) { -// TFT_eSPIDisplay *newDisplay = new TFT_eSPIDisplay(rotation, textSize, textColour, backgroundColour); -// return newDisplay; -// } TFT_eSPIDisplay *TFT_eSPIDisplay::create(uint8_t rotation, const GFXfont *textFont, uint16_t textColour, uint16_t backgroundColour) { TFT_eSPIDisplay *newDisplay = new TFT_eSPIDisplay(rotation, textFont, textColour, backgroundColour); diff --git a/TFT_eSPIDisplay.h b/TFT_eSPIDisplay.h index 66cfd9f..6163a0c 100644 --- a/TFT_eSPIDisplay.h +++ b/TFT_eSPIDisplay.h @@ -30,10 +30,10 @@ // #define FONT_TFT_ESPI_SMALL &FreeMono9pt7b // #define FONT_TFT_ESPI_MEDIUM &FreeMono12pt7b // #define FONT_TFT_ESPI_LARGE &FreeMono18pt7b -#define FONT_TFT_ESPI_XLARGE &FreeMono24pt7b -#define FONT_TFT_ESPI_SMALL_SANS &FreeSans9pt7b -#define FONT_TFT_ESPI_MEDIUM_SANS &FreeSans12pt7b -#define FONT_TFT_ESPI_LARGE_SANS &FreeSans18pt7b +// #define FONT_TFT_ESPI_XLARGE &FreeMono24pt7b +// #define FONT_TFT_ESPI_SMALL_SANS &FreeSans9pt7b +// #define FONT_TFT_ESPI_MEDIUM_SANS &FreeSans12pt7b +// #define FONT_TFT_ESPI_LARGE_SANS &FreeSans18pt7b #define FONT_TFT_ESPI_XLARGE_SANS &FreeSans24pt7b //#define FONT_TFT_ESPI_MEDIUM_BOLD &FreeMonoBold12pt7b //#define FONT_TFT_ESPI_SERIF_BOLD_ITALIC &FreeSerifBoldItalic12pt7b @@ -42,12 +42,6 @@ #ifndef TEXT_FONT #define TEXT_FONT FONT_TFT_ESPI_MEDIUM_BOLD #endif -// #ifndef ALTERNATE_FONT1 -// #define ALTERNATE_FONT1 FONT_TFT_ESPI_MEDIUM_BOLD -// #endif -// #ifndef ALTERNATE_FONT2 -// #define ALTERNATE_FONT2 FONT_TFT_ESPI_SERIF_BOLD_ITALIC -// #endif //#define LOCAL_FONT FONT_TFT /// @brief Display class for TFT_eSPI based displays @@ -55,21 +49,19 @@ class TFT_eSPIDisplay : public DisplayInterface { public: /// @brief Constructor for a TFT_eSPIDisplay instance /// @param rotation Rotation of the display, 0 - 3, refer to TFT_eSPI documentation for details - /// @param textSize Multiplier for the text size, refer to TFT_eSPI documentation for details - // Now used as the alternate font ID. + /// @param textFont The identiy of the font for this display. /// @param textColour Default 16bit text colour, refer to TFT_eSPI documentation for details /// @param backgroundColour Default 16bit background colour, refer to TFT_eSPI documentation for details - //TFT_eSPIDisplay(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour); - TFT_eSPIDisplay(uint8_t rotation, const GFXfont *textfont, uint16_t textColour, uint16_t backgroundColour); + TFT_eSPIDisplay(uint8_t rotation, const GFXfont *textFont, uint16_t textColour, uint16_t backgroundColour); /// @brief Alternate constructor for a TFT_eSPIDisplay instance to specify the CS pin to allow for two displays /// @param rotation Rotation of the display, 0 - 3, refer to TFT_eSPI documentation for details - /// @param textSize Multiplier for the text size, refer to TFT_eSPI documentation for details + /// @param textFont The identiy of the font for this display. /// @param textColour Default 16bit text colour, refer to TFT_eSPI documentation for details /// @param backgroundColour Default 16bit background colour, refer to TFT_eSPI documentation for details /// @param csPin Pin this display's chip select (CS) pin is connected to to enable manual display switching //TFT_eSPIDisplay(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour, int csPin); - TFT_eSPIDisplay(uint8_t rotation, const GFXfont *textfont, uint16_t textColour, uint16_t backgroundColour, int csPin); + TFT_eSPIDisplay(uint8_t rotation, const GFXfont *textFont, uint16_t textColour, uint16_t backgroundColour, int csPin); /// @brief Perform any initial once off setup or configuration here and call only once @@ -107,7 +99,7 @@ class TFT_eSPIDisplay : public DisplayInterface { /// @brief Static method to enable the compiler to generate create commands from myDevices.h entries /// @param rotation rotation Rotation of the display, 0 - 3, refer to TFT_eSPI documentation for details - /// @param textSize Multiplier for the text size, refer to TFT_eSPI documentation for details + /// @param textFont The identiy of the font for this display. /// @param textColour Default 16bit text colour, refer to TFT_eSPI documentation for details /// @param backgroundColour Default 16bit background colour, refer to TFT_eSPI documentation for details /// @return Pointer to a new TFT_eSPIDisplay instance @@ -116,7 +108,7 @@ class TFT_eSPIDisplay : public DisplayInterface { /// @brief Alternate static method to enable the compiler to generate create commands from myDevices.h entries /// @param rotation rotation Rotation of the display, 0 - 3, refer to TFT_eSPI documentation for details - /// @param textSize Multiplier for the text size, refer to TFT_eSPI documentation for details + /// @param textFont The identiy of the font for this display. /// @param textColour Default 16bit text colour, refer to TFT_eSPI documentation for details /// @param backgroundColour Default 16bit background colour, refer to TFT_eSPI documentation for details /// @param csPin Pin this display's chip select (CS) pin is connected to to enable manual display switching From 06d9ef6e94bd2909cb77f873bc029830f4b778db Mon Sep 17 00:00:00 2001 From: peteGSX Date: Sun, 12 Jan 2025 07:48:38 +1000 Subject: [PATCH 5/9] Uncomment fonts, add setFreeFont() --- TFT_eSPIDisplay.cpp | 14 +++++++------- TFT_eSPIDisplay.h | 38 +++++++++++++++++--------------------- 2 files changed, 24 insertions(+), 28 deletions(-) diff --git a/TFT_eSPIDisplay.cpp b/TFT_eSPIDisplay.cpp index d29cf93..db71238 100644 --- a/TFT_eSPIDisplay.cpp +++ b/TFT_eSPIDisplay.cpp @@ -23,7 +23,8 @@ TFT_eSPI *TFT_eSPIDisplay::_tft = nullptr; bool TFT_eSPIDisplay::_tftInitialised = false; -TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, const GFXfont *textFont, uint16_t textColour, uint16_t backgroundColour) { +TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, const GFXfont *textFont, uint16_t textColour, + uint16_t backgroundColour) { _rotation = rotation; _textSize = 1; // default text size to save amending display routine. _textColour = textColour; @@ -32,13 +33,12 @@ TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, const GFXfont *textFont, uint _tft = new TFT_eSPI(); } _gfxFont = textFont; - } -TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, const GFXfont *textFont, uint16_t textColour, uint16_t backgroundColour, - int csPin) { +TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, const GFXfont *textFont, uint16_t textColour, + uint16_t backgroundColour, int csPin) { _rotation = rotation; - _textSize = 1; // default text size to save amending display routine. + _textSize = 1; // default text size to save amending display routine. _textColour = textColour; _backgroundColour = backgroundColour; _csPin = csPin; @@ -46,10 +46,8 @@ TFT_eSPIDisplay::TFT_eSPIDisplay(uint8_t rotation, const GFXfont *textFont, uint _tft = new TFT_eSPI(); } _gfxFont = textFont; - } - void TFT_eSPIDisplay::begin() { LOG(LogLevel::LOG_DEBUG, "TFT_eSPIDisplay::begin[%d]()", _displayId); if (!_tftInitialised) { @@ -98,6 +96,7 @@ void TFT_eSPIDisplay::displayRow(uint8_t row, const char *text, bool underlined, if (text == nullptr) { return; } + _tft->setFreeFont(_gfxFont); int32_t x = 0; int32_t y = 0; _getRowPosition(column, row, x, y); @@ -121,6 +120,7 @@ void TFT_eSPIDisplay::clearRow(uint8_t row) { void TFT_eSPIDisplay::displayStartupInfo(const char *version) { LOG(LogLevel::LOG_DEBUG, "TFT_eSPIDisplay::displayStartupInfo[%d](%s)", _displayId, version); + _tft->setFreeFont(_gfxFont); _tft->fillScreen(0xFFFF); int32_t x = 0; int32_t y = 0; diff --git a/TFT_eSPIDisplay.h b/TFT_eSPIDisplay.h index 6163a0c..bdce104 100644 --- a/TFT_eSPIDisplay.h +++ b/TFT_eSPIDisplay.h @@ -27,23 +27,23 @@ #include // Define the standard fonts available for this display type -// #define FONT_TFT_ESPI_SMALL &FreeMono9pt7b -// #define FONT_TFT_ESPI_MEDIUM &FreeMono12pt7b -// #define FONT_TFT_ESPI_LARGE &FreeMono18pt7b -// #define FONT_TFT_ESPI_XLARGE &FreeMono24pt7b -// #define FONT_TFT_ESPI_SMALL_SANS &FreeSans9pt7b -// #define FONT_TFT_ESPI_MEDIUM_SANS &FreeSans12pt7b -// #define FONT_TFT_ESPI_LARGE_SANS &FreeSans18pt7b +#define FONT_TFT_ESPI_SMALL &FreeMono9pt7b +#define FONT_TFT_ESPI_MEDIUM &FreeMono12pt7b +#define FONT_TFT_ESPI_LARGE &FreeMono18pt7b +#define FONT_TFT_ESPI_XLARGE &FreeMono24pt7b +#define FONT_TFT_ESPI_SMALL_SANS &FreeSans9pt7b +#define FONT_TFT_ESPI_MEDIUM_SANS &FreeSans12pt7b +#define FONT_TFT_ESPI_LARGE_SANS &FreeSans18pt7b #define FONT_TFT_ESPI_XLARGE_SANS &FreeSans24pt7b -//#define FONT_TFT_ESPI_MEDIUM_BOLD &FreeMonoBold12pt7b -//#define FONT_TFT_ESPI_SERIF_BOLD_ITALIC &FreeSerifBoldItalic12pt7b +#define FONT_TFT_ESPI_MEDIUM_BOLD &FreeMonoBold12pt7b +#define FONT_TFT_ESPI_SERIF_BOLD_ITALIC &FreeSerifBoldItalic12pt7b // If not overridden by myConfig.h, set the font #ifndef TEXT_FONT #define TEXT_FONT FONT_TFT_ESPI_MEDIUM_BOLD -#endif +#endif -//#define LOCAL_FONT FONT_TFT +// #define LOCAL_FONT FONT_TFT /// @brief Display class for TFT_eSPI based displays class TFT_eSPIDisplay : public DisplayInterface { public: @@ -60,10 +60,8 @@ class TFT_eSPIDisplay : public DisplayInterface { /// @param textColour Default 16bit text colour, refer to TFT_eSPI documentation for details /// @param backgroundColour Default 16bit background colour, refer to TFT_eSPI documentation for details /// @param csPin Pin this display's chip select (CS) pin is connected to to enable manual display switching - //TFT_eSPIDisplay(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour, int csPin); - TFT_eSPIDisplay(uint8_t rotation, const GFXfont *textFont, uint16_t textColour, uint16_t backgroundColour, int csPin); - - + TFT_eSPIDisplay(uint8_t rotation, const GFXfont *textFont, uint16_t textColour, uint16_t backgroundColour, int csPin); + /// @brief Perform any initial once off setup or configuration here and call only once void begin() override; @@ -103,8 +101,8 @@ class TFT_eSPIDisplay : public DisplayInterface { /// @param textColour Default 16bit text colour, refer to TFT_eSPI documentation for details /// @param backgroundColour Default 16bit background colour, refer to TFT_eSPI documentation for details /// @return Pointer to a new TFT_eSPIDisplay instance - //static TFT_eSPIDisplay *create(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour); - static TFT_eSPIDisplay *create(uint8_t rotation, const GFXfont *textFont, uint16_t textColour, uint16_t backgroundColour); + static TFT_eSPIDisplay *create(uint8_t rotation, const GFXfont *textFont, uint16_t textColour, + uint16_t backgroundColour); /// @brief Alternate static method to enable the compiler to generate create commands from myDevices.h entries /// @param rotation rotation Rotation of the display, 0 - 3, refer to TFT_eSPI documentation for details @@ -113,10 +111,8 @@ class TFT_eSPIDisplay : public DisplayInterface { /// @param backgroundColour Default 16bit background colour, refer to TFT_eSPI documentation for details /// @param csPin Pin this display's chip select (CS) pin is connected to to enable manual display switching /// @return Pointer to a new TFT_eSPIDisplay instance - // static TFT_eSPIDisplay *create(uint8_t rotation, uint8_t textSize, uint16_t textColour, uint16_t backgroundColour, - // int csPin); - static TFT_eSPIDisplay *create(uint8_t rotation, const GFXfont *textFont, uint16_t textColour, uint16_t backgroundColour, - int csPin); + static TFT_eSPIDisplay *create(uint8_t rotation, const GFXfont *textFont, uint16_t textColour, + uint16_t backgroundColour, int csPin); /// @brief Destructor for the TFT_eSPIDisplay ~TFT_eSPIDisplay() override; From e10a228c58bceffe315b917b7c8e0e71323b588e Mon Sep 17 00:00:00 2001 From: Colin Murdoch Date: Sun, 12 Jan 2025 16:53:51 +0000 Subject: [PATCH 6/9] Update TFT_eSPIDisplay.cpp Attempt to correct rotation. --- TFT_eSPIDisplay.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/TFT_eSPIDisplay.cpp b/TFT_eSPIDisplay.cpp index db71238..bca3a50 100644 --- a/TFT_eSPIDisplay.cpp +++ b/TFT_eSPIDisplay.cpp @@ -120,6 +120,7 @@ void TFT_eSPIDisplay::clearRow(uint8_t row) { void TFT_eSPIDisplay::displayStartupInfo(const char *version) { LOG(LogLevel::LOG_DEBUG, "TFT_eSPIDisplay::displayStartupInfo[%d](%s)", _displayId, version); + _tft->setRotation(_rotation); _tft->setFreeFont(_gfxFont); _tft->fillScreen(0xFFFF); int32_t x = 0; From 02fb3d8030344eef02f85623b9adc2aba9206d86 Mon Sep 17 00:00:00 2001 From: Colin Murdoch Date: Mon, 13 Jan 2025 14:29:41 +0000 Subject: [PATCH 7/9] Update sample config Update myConfig.example.h & myDevices.example.h --- myConfig.example.h | 8 ++++++++ myDevices.example.h | 40 +++++++++++++++++++++++++++++++--------- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/myConfig.example.h b/myConfig.example.h index 35ae249..312e9a3 100644 --- a/myConfig.example.h +++ b/myConfig.example.h @@ -51,3 +51,11 @@ * @brief Option to force a touch screen to enter calibration mode even if the current calibration is valid */ // #define FORCE_CALIBRATION + +/** + * @brief Option provide an alternative option from the GFXFF FreeFonts that is not yet defined in the display type header file + * e.g. set the text font to Free Sans Bold Oblique 18pt high. - uncomment the line below + * which will replace the default definition or replace it with another. + */ + +// #define TEXT_FONT &FreeSansBoldOblique18pt7b diff --git a/myDevices.example.h b/myDevices.example.h index 3462e9f..c642d24 100644 --- a/myDevices.example.h +++ b/myDevices.example.h @@ -31,23 +31,45 @@ /** * Display devices using the TFT_eSPI display library * - * USER_DISPLAY(TFT_eSPIDisplay, rotation, text size, text colour, background colour, *chip select pin) + * USER_DISPLAY(TFT_eSPIDisplay, rotation, text font, text colour, background colour, *chip select pin) * - * Example for a single display with rotation set to 1, text size 1, white text colour, and black background colour - * Omit the final chip select pin parameter for a single display - * USER_DISPLAY(TFT_eSPIDisplay, 1, 1, TFT_WHITE, TFT_BLACK) + * Example for a single display with rotation set to 1, text font FreeMono12pt7b, white text colour, and black background colour + * Omit the final chip select pin parameter for a single display. + * TEXT_FONT is a default font provided in the display header file and is set to FONT_TFT_ESPI_MEDIUM i.e. FreeMono12pt7b. + * If a defferent font is requires substitute the font define for TEXT_FONT in the example below. + * USER_DISPLAY(TFT_eSPIDisplay, 1, TEXT_FONT, TFT_WHITE, TFT_BLACK) * * Example for two displays as above, but specifying the chip select pin to manually switch the displays * This is necessary as the TFT_eSPI library doesn't directly support multiple displays - * USER_DISPLAY(TFT_eSPIDisplay, 1, 1, TFT_WHITE, TFT_BLACK, 15) - * USER_DISPLAY(TFT_eSPIDisplay, 1, 1, TFT_WHITE, TFT_BLACK, 16) + * USER_DISPLAY(TFT_eSPIDisplay, 1, TEXT_FONT, TFT_WHITE, TFT_BLACK, 15) + * USER_DISPLAY(TFT_eSPIDisplay, 1, TEXT_FONT, TFT_WHITE, TFT_BLACK, 16) + * + * The available fonts that are defined for use are listed at the top of the appropriate display header file + * In the case of TFT_eSPI screens that is TFT_eSPIDisplay.h. These are a selection of fonts that have been define from the + * library GFXFF FreeFonts. + * + * If you wish to use a font that is not defined in the header file, it is possible to add an elternative (see config.example.h) * * Uncomment and edit one or more lines below as required for your setup. */ -// USER_DISPLAY(TFT_eSPIDisplay, 1, 1, TFT_WHITE, TFT_BLACK) -// USER_DISPLAY(TFT_eSPIDisplay, 1, 1, TFT_WHITE, TFT_BLACK, 15) -// USER_DISPLAY(TFT_eSPIDisplay, 1, 1, TFT_WHITE, TFT_BLACK, 16) +// USER_DISPLAY(TFT_eSPIDisplay, 1, TEXT_FONT, TFT_WHITE, TFT_BLACK) +// USER_DISPLAY(TFT_eSPIDisplay, 1, TEXT_FONT, TFT_WHITE, TFT_BLACK, 15) +// USER_DISPLAY(TFT_eSPIDisplay, 1, 1TEXT_FONT, TFT_WHITE, TFT_BLACK, 16) + +/** +* If using multiple displays on a processor that can support this, it is possible to set a specific font for each screen. +* The following three lines give an example that has been tested with three SPI displays on an ESP32. Each display is +* configured with a different font from the list available. +* Note that each screen has been given a different orientation. This works to a point but has a limitation imposed by the +* library. Orientations 180 degrees opposed work OK, but an orientation 90 degrees to the first will not have the background +* rendered correctly i.e the height and width attributes do not adjust. +* If using mixed orientations its best to use 0 & 2 or 1 & 3. +* +* USER_DISPLAY(TFT_eSPIDisplay, 1, FONT_TFT_ESPI_SMALL, TFT_WHITE, TFT_BLACK, 12) +* USER_DISPLAY(TFT_eSPIDisplay, 2, FONT_TFT_ESPI_SERIF_BOLD_ITALIC, TFT_WHITE, TFT_BLUE, 13) +* USER_DISPLAY(TFT_eSPIDisplay, 3, FONT_TFT_ESPI_LARGE, TFT_WHITE, TFT_RED, 14) +*/ /** * Display devices using the MCUFRIEND_kbv display library From 9477e02e045ab903d62e2a560c4348a3bf3130a0 Mon Sep 17 00:00:00 2001 From: Colin Murdoch Date: Mon, 13 Jan 2025 14:39:59 +0000 Subject: [PATCH 8/9] Remove unwanted lines Remove unwanted lines --- TFT_eSPIDisplay.cpp | 1 - TFT_eSPIDisplay.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/TFT_eSPIDisplay.cpp b/TFT_eSPIDisplay.cpp index bca3a50..db71238 100644 --- a/TFT_eSPIDisplay.cpp +++ b/TFT_eSPIDisplay.cpp @@ -120,7 +120,6 @@ void TFT_eSPIDisplay::clearRow(uint8_t row) { void TFT_eSPIDisplay::displayStartupInfo(const char *version) { LOG(LogLevel::LOG_DEBUG, "TFT_eSPIDisplay::displayStartupInfo[%d](%s)", _displayId, version); - _tft->setRotation(_rotation); _tft->setFreeFont(_gfxFont); _tft->fillScreen(0xFFFF); int32_t x = 0; diff --git a/TFT_eSPIDisplay.h b/TFT_eSPIDisplay.h index bdce104..1b50b29 100644 --- a/TFT_eSPIDisplay.h +++ b/TFT_eSPIDisplay.h @@ -40,7 +40,7 @@ // If not overridden by myConfig.h, set the font #ifndef TEXT_FONT -#define TEXT_FONT FONT_TFT_ESPI_MEDIUM_BOLD +#define TEXT_FONT FONT_TFT_ESPI_MEDIUM #endif // #define LOCAL_FONT FONT_TFT From 0c68ac751a1fde670a3b2b3d61efc607400bdacf Mon Sep 17 00:00:00 2001 From: Colin Murdoch Date: Mon, 13 Jan 2025 14:50:44 +0000 Subject: [PATCH 9/9] Revert "Remove unwanted lines" This reverts commit 9477e02e045ab903d62e2a560c4348a3bf3130a0. --- TFT_eSPIDisplay.cpp | 1 + TFT_eSPIDisplay.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/TFT_eSPIDisplay.cpp b/TFT_eSPIDisplay.cpp index db71238..bca3a50 100644 --- a/TFT_eSPIDisplay.cpp +++ b/TFT_eSPIDisplay.cpp @@ -120,6 +120,7 @@ void TFT_eSPIDisplay::clearRow(uint8_t row) { void TFT_eSPIDisplay::displayStartupInfo(const char *version) { LOG(LogLevel::LOG_DEBUG, "TFT_eSPIDisplay::displayStartupInfo[%d](%s)", _displayId, version); + _tft->setRotation(_rotation); _tft->setFreeFont(_gfxFont); _tft->fillScreen(0xFFFF); int32_t x = 0; diff --git a/TFT_eSPIDisplay.h b/TFT_eSPIDisplay.h index 1b50b29..bdce104 100644 --- a/TFT_eSPIDisplay.h +++ b/TFT_eSPIDisplay.h @@ -40,7 +40,7 @@ // If not overridden by myConfig.h, set the font #ifndef TEXT_FONT -#define TEXT_FONT FONT_TFT_ESPI_MEDIUM +#define TEXT_FONT FONT_TFT_ESPI_MEDIUM_BOLD #endif // #define LOCAL_FONT FONT_TFT