mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 14:58:12 +00:00
fix(eink): render Lemon font UTF-8 correctly by bypassing GFX write()
Adafruit GFX write(uint8_t) treats each byte as a glyph index and cannot decode multi-byte UTF-8 sequences, so Cyrillic and other non-ASCII chars were rendered as garbage even with the Lemon font selected. Add decodeUtf8 + drawLemonChar + lemonXAdvance to GxEPDDisplay, mirroring the existing SH1106Display implementation. Override print() for Lemon mode to decode UTF-8 codepoints and draw each glyph directly; override getTextWidth() to sum per-codepoint advances. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -54,9 +54,13 @@ class GxEPDDisplay : public DisplayDriver {
|
||||
CRC32 display_crc;
|
||||
int last_display_crc_value = 0;
|
||||
int _text_sz = 1;
|
||||
uint8_t _full_refresh_interval = 0; // 0=never, N=full refresh every N partial refreshes
|
||||
uint8_t _full_refresh_interval = 0;
|
||||
uint8_t _partial_count = 0;
|
||||
|
||||
static uint32_t decodeUtf8(const uint8_t*& p);
|
||||
int16_t drawLemonChar(int16_t x, int16_t y, uint32_t cp);
|
||||
uint8_t lemonXAdvance(uint32_t cp);
|
||||
|
||||
public:
|
||||
#if defined(EINK_DISPLAY_MODEL)
|
||||
GxEPDDisplay() : DisplayDriver(EINK_DISP_W, EINK_DISP_H),
|
||||
|
||||
Reference in New Issue
Block a user