Files
iptvnator/tools
4grayandClaude Fable 5 ae7077c283 fix(release): assume uncalibrated scripts are full-width
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>
2026-08-27 10:28:04 +02:00
..