mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-11 19:46:16 -08:00
The width model classified anything uncased as narrow lowercase (0.6 em), so a 60-glyph CJK headline estimated small enough to skip both the wrap and the textLength clamp, and painted into the canvas's right margin. Emoji fell through the same way. Character classification is now fail-safe: outside the calibrated scripts (Latin through Extended-B, Greek, Cyrillic, ASCII punctuation) a glyph is assumed full-width. CJK, kana, hangul and emoji really are about one em, and for a genuinely narrow script the cost of guessing wide is an early line break — invisible — against a cropped card for guessing narrow. Keeping the estimate rather than measuring preserves this module as pure, dependency-free and unit-testable; the fail-safe default is what makes an estimate acceptable there. Verified by rendering a 60-glyph CJK headline with an emoji body through sharp: both stay inside the canvas. 189 tests passing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>