mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-08 19:42:05 +00:00
Cause: `visual_gaps` mapped a gap at a run boundary to the gap before the later run's first item, which for a run nested inside another (a Chinese word in a Hebrew phrase in Chinese text, made with embedding marks) is a gap inside the embedding: one boundary took it, another got none, and the line came up a gap short of the box's edge. Fix: each gap is reordered with the line as a glyph of no width at the lower of its two neighbours' levels (rule N1 for a space between them), through the same `visual_order`: items and gaps keep alternating and each gap lands once at the boundary it belongs to. Test row with explicit embedding marks (red before: "char 8 moved 2 (want 1)"). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>