Lay out insertion classes through the page builder

This commit is contained in:
gloamxun committed 2026-10-23 02:53:04 +08:00
1 parent 6305f059ac
commit 6cf8221ba7
6 files changed
+452 -61

No files matched your search

+7 -5
View File
@@ -48,7 +48,7 @@ floats (`\floatsep`, `\textfloatsep`, `\intextsep`, `\topfraction`,
`\bottomnumber`, `\totalnumber`), insertion classes (`\skip`, fraction and
absolute limits, splitting), marks, Rust output hook, multi-page PDF, and the
route-D service endpoints (`/api/route-d/preview|pdf|edit`, project preview and
PDF opt-in with `?engine=route-d`). 333 workspace tests are green and no oracle
PDF opt-in with `?engine=route-d`). 336 workspace tests are green and no oracle
fixture is ignored.
Known gaps, in dependency order:
@@ -66,7 +66,8 @@ yet generic `fil`/`fill` glue
policies, now with line-level paragraph splits; `page::PageBuilder`
implements the candidate-breakpoint cost model (badness + penalty, glue
setting, `\topskip`, `\maxdepth`) and `Engine::layout_paged` runs it for
documents made of box/glue/penalty/mark units, but floats, insertions and incremental
documents made of box/glue/penalty/mark units and insertion classes
(per-class limits with held-over material), but floats and incremental
checkpoint replay still use the scrolling builder, and an interpreted
`\output` is absent;
3. `\insert` classes model `\count`/`\dimen`/`\skip` but are not TeX
@@ -260,9 +261,10 @@ goal, so overfull pages take the least overfull break. `Document::h_offset` and
`v_offset` feed the PDF writer's `pdf::PageOrigin`, which translates the page
body without moving the sheet; a route-D integration fixture checks the shift
with `pdftotext -bbox`, and the PDF endpoint reads leading `\hoffset`/`\voffset`
dimension assignments from the source. Floats, insertions and checkpoint replay still fall back
to the scrolling builder, which stays the default until it has a paged
equivalent. Next: port those paths, then paper margins and the interpreted
dimension assignments from the source. Insertion classes are placed by the
paged builder with their limits and held-over material; floats and checkpoint
replay still fall back to the scrolling builder, which stays the default until
it has a paged equivalent. Next: port those paths, then paper margins and the interpreted
`\output`.
Acceptance: 10 page fixtures (article text, footnotes, floats, forced breaks);