mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-02 10:16:11 +00:00
fix: apply UTF-8 transliteration in drawTextEllipsized
Names printed via drawTextEllipsized (contacts, senders) bypassed translateUTF8ToBlocks, causing raw UTF-8 bytes to render as garbage on the Adafruit font. Now transliteration happens inside the method. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
9ec4fddbbc
commit
d1d524aab1
@@ -110,10 +110,7 @@ public:
|
|||||||
// draw text with ellipsis if it exceeds max_width
|
// draw text with ellipsis if it exceeds max_width
|
||||||
virtual void drawTextEllipsized(int x, int y, int max_width, const char* str) {
|
virtual void drawTextEllipsized(int x, int y, int max_width, const char* str) {
|
||||||
char temp_str[256]; // reasonable buffer size
|
char temp_str[256]; // reasonable buffer size
|
||||||
size_t len = strlen(str);
|
translateUTF8ToBlocks(temp_str, str, sizeof(temp_str));
|
||||||
if (len >= sizeof(temp_str)) len = sizeof(temp_str) - 1;
|
|
||||||
memcpy(temp_str, str, len);
|
|
||||||
temp_str[len] = 0;
|
|
||||||
|
|
||||||
if (getTextWidth(temp_str) <= max_width) {
|
if (getTextWidth(temp_str) <= max_width) {
|
||||||
setCursor(x, y);
|
setCursor(x, y);
|
||||||
|
|||||||
Reference in New Issue
Block a user