fix(eink): pass UTF-8 through unchanged when Lemon font is active

drawTextCentered/Left/Right/Ellipsized all call translateUTF8ToBlocks
before passing text to print(), which converted Cyrillic (and other
Unicode) to block characters even when the Lemon font was selected.

Override translateUTF8ToBlocks in GxEPDDisplay to skip conversion when
_use_lemon is true — the Lemon/GFX font handles UTF-8 natively.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-05-24 14:47:06 +02:00
parent 1cfe7c168a
commit c375c4b217

View File

@@ -86,6 +86,14 @@ public:
}
void setLemonFont(bool enabled) override { _use_lemon = enabled; _vw_dirty = true; }
bool isLemonFont() const override { return _use_lemon; }
void translateUTF8ToBlocks(char* dest, const char* src, size_t dest_size) override {
if (_use_lemon) {
strncpy(dest, src, dest_size - 1);
dest[dest_size - 1] = '\0';
} else {
translateUTF8Static(dest, src, dest_size);
}
}
bool begin();
bool isOn() override { return _isOn; }