Mods on Chinese display with external .cpp

This commit is contained in:
Sjef Verhoeven PE5PVB
2023-08-04 14:18:14 +02:00
parent 1135242056
commit 0362fd38b0
3 changed files with 32 additions and 11 deletions
+5 -10
View File
@@ -4768,11 +4768,8 @@ void DefaultSettings(byte userhardwaremodel) {
void tftPrint(int8_t offset, const String & text, int16_t x, int16_t y, int color, int smoothcolor, const uint8_t* font) {
if (language == LANGUAGE_CHS) {
if (memcmp(font, FONT16, sizeof(FONT16)) == 0) {
font = FONT16_CHS;
} else if (memcmp(font, FONT28, sizeof(FONT28)) == 0) {
font = FONT28_CHS;
}
if (font == FONT16) font = FONT16_CHS;
else if (font == FONT28) font = FONT28_CHS;
}
if (currentFont != font || resetFontOnNextCall) {
@@ -4795,15 +4792,13 @@ void tftPrint(int8_t offset, const String & text, int16_t x, int16_t y, int colo
void tftReplace(int8_t offset, const String & textold, const String & text, int16_t x, int16_t y, int color, int smoothcolor, const uint8_t* font) {
if (language == LANGUAGE_CHS) {
if (memcmp(font, FONT16, sizeof(FONT16)) == 0) {
font = FONT16_CHS;
} else if (memcmp(font, FONT28, sizeof(FONT28)) == 0) {
font = FONT28_CHS;
}
if (font == FONT16) font = FONT16_CHS;
if (font == FONT28) font = FONT28_CHS;
}
if (currentFont != font || resetFontOnNextCall) {
if (currentFont != nullptr) tft.unloadFont();
tft.loadFont(font);
currentFont = font;
resetFontOnNextCall = false;