You've already forked TEF6686_ESP32
Fix for Chinese fonts
This commit is contained in:
@@ -4768,8 +4768,11 @@ 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 (font == FONT16) font = FONT16_CHS;
|
||||
else if (font == FONT28) font = FONT28_CHS;
|
||||
if (memcmp(font, FONT16, sizeof(FONT16)) == 0) {
|
||||
font = FONT16_CHS;
|
||||
} else if (memcmp(font, FONT28, sizeof(FONT28)) == 0) {
|
||||
font = FONT28_CHS;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentFont != font || resetFontOnNextCall) {
|
||||
@@ -4792,13 +4795,15 @@ 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;
|
||||
if (font == FONT28) font = FONT28_CHS;
|
||||
if (memcmp(font, FONT16, sizeof(FONT16)) == 0) {
|
||||
font = FONT16_CHS;
|
||||
} else if (memcmp(font, FONT28, sizeof(FONT28)) == 0) {
|
||||
font = FONT28_CHS;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentFont != font || resetFontOnNextCall) {
|
||||
if (currentFont != nullptr) tft.unloadFont();
|
||||
|
||||
tft.loadFont(font);
|
||||
currentFont = font;
|
||||
resetFontOnNextCall = false;
|
||||
|
||||
Reference in New Issue
Block a user