Files
wordcraft/crates/layout
James Parrish Coleman IIIandClaude Opus 5.5 627ded32c7 Layout: a multiple-spaced line stays on the page while its text fits, as in Word
Multiple line spacing above single puts its extra leading below the text,
and Word lets that leading of a page's last line run into the bottom
margin: only the text has to fit. WordCraft required the whole line box
to fit, so multiple-spaced pages ended up to a line early (one line fewer
per page in many double-spaced documents).

Observed black-box with synthetic pages pushed down step by step: at
double spacing (14 steps), 1.15 and 1.5 (12 steps each) Word holds one
more line than WordCraft did whenever the last line's leading crosses the
margin; with this change all 38 page breaks match Word's. Only the bottom
margin takes the leading: a footer taller than the margin, or footnotes,
still keep the whole line clear (a document with a four-line footer kept
Word's page breaks only with this limit).

Tests: a_page_ends_when_a_multiple_spaced_lines_text_no_longer_fits
(1.15, 1.5 and double; fails before this change).
space_after_may_overflow_the_bottom_margin_without_notes now checks the
last line's text against the margin, since the leading may run past it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:10:32 -05:00
..
2026-10-22 01:47:34 +00:00