diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index e45a6f7..5fd480d 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -10,7 +10,9 @@ #include "src/WiFiConnect.h" #include "src/WiFiConnectParam.h" #include "src/FONT16.h" +#include "src/FONT16_CHS.h" #include "src/FONT28.h" +#include "src/FONT28_CHS.h" #include "src/FONT48DEC.h" #include "src/TEF6686.h" #include "src/constants.h" @@ -5927,6 +5929,11 @@ void DefaultSettings() { } 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 (font == FONT16) font = FONT16_CHS; + else if (font == FONT28) font = FONT28_CHS; + } + if (currentFont != font || resetFontOnNextCall) { if (currentFont != nullptr) tft.unloadFont(); tft.loadFont(font); @@ -5946,6 +5953,11 @@ 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 (font == FONT16) font = FONT16_CHS; + else if (font == FONT28) font = FONT28_CHS; + } + if (currentFont != font || resetFontOnNextCall) { if (currentFont != nullptr) tft.unloadFont(); diff --git a/src/constants.h b/src/constants.h index 455a289..420436f 100644 --- a/src/constants.h +++ b/src/constants.h @@ -20,6 +20,8 @@ #define BAT_LEVEL_FULL 2270 #define BAT_LEVEL_STAGE 4 +#define LANGUAGE_CHS 14 + #define FREQ_MW_STEP_9K 9 #define FREQ_MW_STEP_10K 10 #define FREQ_SW_STEP_5K 5