Files
iptvnator/tools/release
4grayandClaude Fable 5 a32ab20b0b fix(release): invert the width model so it cannot under-estimate
Chasing individual wide glyphs does not converge. Each review pass found
another one the list had missed — `W`, then CJK and emoji, then the `ae`
ligature, which passes the Latin range check and took the lowercase 0.6
factor while rendering about 1.05 em. Every miss crops the card silently,
because an under-estimate skips both the wrap and the textLength clamp.

The model is now inverted: narrow characters are enumerated and everything
else is assumed wide (1.15 em). Accented Latin, ligatures, Cyrillic, Greek,
CJK, kana, hangul and emoji all take the wide default, so the estimate can
only ever run high — and running high costs an early line break nobody
sees. There is no list left to miss an entry from.

The real guard is a new test that renders each sample through sharp and
asserts the estimate never falls below the measured ink width. It covers
Latin, ligatures, CJK, hangul, Cyrillic, symbols and accents, and would
have caught every one of the preceding rounds at once. Measured locally:
34 `W` renders 1669px against a 2033px estimate, 34 `ae` 1601px, 28 `CJK`
1459px — every case over-estimated, including both widths reported in
review from a different font environment.

190 tests passing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-27 10:38:14 +02:00
..