mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 23:08:11 +00:00
The wrap loop used to memcpy a growing substring and call getTextWidth on it for every appended codepoint — O(n²) UTF-8 decoding with Lemon font, ~5-20 ms on a full e-ink redraw of a long message. Add DisplayDriver::getCodepointWidth(cp) (default: build a UTF-8 buffer and forward to getTextWidth) plus DisplayDriver::decodeCodepoint() as the shared UTF-8 walker. Override getCodepointWidth in GxEPDDisplay (direct lemonXAdvance for Lemon size 1) and SH1106Display (lemonXAdvance for Lemon, fixed 6*sz for built-in font). FullscreenMsgView now walks codepoints once and sums widths incrementally. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>