Set a text selection as warichu inside the parent line (#280)

* Set warichu as smaller lines inside the parent line.

Type › Warichu stacks the selected run after the line is broken, closes up the rest of the line, and round-trips the IDML warichu properties. The line break itself still sees the full-size run.

* Keep clicks, the caret, and Up/Down on each warichu row.

The glyphs were already stacked inside the parent line, but hit testing, the caret, and vertical movement still used that parent line. Break minimums, row widths, spacing, and tab leaders now follow the small lines, and underlines sit on the small baseline.

---------

Co-authored-by: Brandon Thomas <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
authored and GitHub committed 2026-10-10 03:47:14 -04:00
1 parent 74a81f9fb0
commit d0d4812ada
19 files changed
+935 -43

No files matched your search

+12 -1
View File
@@ -122,7 +122,18 @@ All set after line layout like today's ruby, but able to affect line height:
- **Kenten**: position, size, alignment, colour, font (the kinds and a custom character are
there).
- **Warichu**: an inline run set in 2+ smaller lines inside one line height, with size, line
spacing, alignment and breaking rules.
spacing, alignment and breaking rules. Type › Warichu (`type.warichu`) does this after the
line is broken: the run is scaled and stacked, and the rest of that line closes up. It does
not pull more characters onto the line. The first small line keeps at least
`WarichuCharsBeforeBreak` glyphs and the last at least `WarichuCharsAfterBreak`; the glyphs
are split so those lines are as close in width as the minimums allow. Line spacing of 0 keeps
the baselines one small em apart, a positive value adds to that em, and a negative value
tightens it down to a shared baseline. The caret, the selection, and hit testing follow the
small line the character sits on, and Up and Down move between those lines before leaving the
parent line. Underlines follow the small baseline. Right-to-left and tate-chu-yoko runs are
left as body text. IDML reads and writes `Warichu`, `WarichuLines`, `WarichuSize`,
`WarichuLineSpacing`, `WarichuAlignment`, `WarichuCharsBeforeBreak` and
`WarichuCharsAfterBreak`.
- **Tate-chu-yoko**: scale-to-fit-em, automatic TCY for runs of N digits (with or without
Latin), rensuji (offsets are there).
- **Shatai** (oblique in the CJK sense: angle and magnification, keeping the em box),