Fit a cluster that draws wider than its cells #29
No reviewers
Labels
No labels
Area/ci
Area/cli
Area/client
Area/client-core
Area/daemon
Area/deps
Area/docs
Area/grid
Area/manual
Area/nix
Area/protocol
Area/pty
Area/render
Area/shaping
Area/skills
Area/transport
Area/vt
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Performance
Kind/Security
Kind/Testing
perf-regression-accepted
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Blocked
Status
Need More Info
Status
Upstream
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
felis-terminal/felis!29
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/fit-clusters"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #17.
A single glyph wider than its cells is already shrunk to fit them. A multi-codepoint cluster was not: its glyphs were drawn at full size and placed by raw pen advance, so it covered the next character whenever the font could not join what the grid joined.
Changes
🇦🇦(no flag glyph), non-RGI ZWJ sequences,😀🏻, keycaps swash does not ligate,※́, and a❤️left in one cell by a refused VS16 widen.char_span) or OSC 66w, not the base char's width. Sized-cluster alignment now uses the same span; it undercounted a widened❤️and overcounted a refused one.SlotKey::FittedGlyph(glyph, px)), because U+0301 can be native in one cluster and shrunk in another. The measurement is memoised in theGlyphIndex, so a font reload drops it; the shape frame carries each cell'sfit_pxto emission.apply_shaped_runnow has the overflow checktext-shaping.mddescribed. A ligature wider than its source cells (one pixel per cell of slack) is dropped, and the per-character path draws those characters.Verification
just checkgreen.Tests on the pinned font set cover fill and centring, the bare-char equivalence, unfitted clusters, the memo, and the pen under an OSC 66 fractional scale. Mock-atlas tests cover the fitted lookup and the grid-span block.
The tests avoid
🇦🇦: swash panics on it in debug builds (#22).Before / after renders (offscreen renderer, Moralerspace Neon HW) of each repro row:
Not changed
①́and字́still draw their mark past the cell. Their advance does not overrun, so the fit does not apply; the mark's position comes from the font.※́come out small. swash does not ligate them, so the fit shrinks a whole row of side-by-side glyphs into the cell.1705c03901cd32546a85