Read parshape measures from route-D sources

This commit is contained in:
gloamxun committed 2026-10-23 13:58:15 +08:00
1 parent f86b507615
commit dc68e76cd3
3 files changed
+41 -5

No files matched your search

+2 -2
View File
@@ -48,14 +48,14 @@ 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`). 429 workspace tests are green and no oracle
PDF opt-in with `?engine=route-d`). 430 workspace tests are green and no oracle
fixture is ignored.
Known gaps, in dependency order:
1. paragraph breaking reproduces TeX's passes and demerits (including
`\adjdemerits`, `\doublehyphendemerits`, `\finalhyphendemerits`,
and source-level `\hyphenation{...}` exceptions,
source-level `\hyphenation{...}` exceptions and `\parshape` measures,
`\hyphenpenalty`, `\exhyphenpenalty`, `\hyphenation` exceptions,
`\hangindent`/`\hangafter`/`\parshape` line geometry, `\parfillskip`
with or without `fil`, default `\sfcode` sentence spacing,
+3 -2
View File
@@ -72,7 +72,8 @@ tolerance and otherwise the first prefix that overflows. Justification
stretches normal glue past its nominal stretch (badness simply exceeds 100)
and clamps shrink at the declared limit, so overfull lines stay overfull
exactly as in TeX. Each line can take its measure and left offset from
`\hangindent`/`\hangafter` or an explicit `\parshape` list; the display list
`\hangindent`/`\hangafter` or an explicit `\parshape` list (the route-D
service reads `\parshape=...` lines from the source); the display list
honours the same offsets. The bounds and hyphen demerits are `ParagraphStyle`
fields mirroring `\pretolerance`, `\tolerance`, `\hyphenpenalty` and
`\exhyphenpenalty`, `\linepenalty`, `\adjdemerits`,
@@ -347,7 +348,7 @@ Math coverage includes fractions/roots, scripts, `\left...\right` with body-scal
Paragraph units carry a `ParagraphFont`; `Unit::paragraph_with_face` and `Unit::paragraph_with_style_and_face` select Roman, bold, italic, mono, or sans. The corresponding Computer Modern TFM (`cmr10`, `cmbx10`, `cmti10`, `cmbxti10`, `cmtt10`, `cmss10`) supplies advances, kerns, ligatures, and italic correction for layout, while the display list and PDF select the matching Liberation face. `Engine::edit` preserves the face when reflowing an edited paragraph.
The crate currently has 289 unit tests plus seven route-D integration tests and twenty-seven oracle fixtures. Workspace verification: `cargo fmt --all -- --check`; `cargo test --workspace --offline` runs 429 tests (289 route-D unit, 7 route-D integration, 27 oracle, 71 v1 integration, 26 server, 4 v1 unit, 1 core unit, 4 binary units), with none ignored. v1 remains the live server path.
The crate currently has 289 unit tests plus seven route-D integration tests and twenty-seven oracle fixtures. Workspace verification: `cargo fmt --all -- --check`; `cargo test --workspace --offline` runs 430 tests (289 route-D unit, 7 route-D integration, 27 oracle, 71 v1 integration, 26 server, 4 v1 unit, 1 core unit, 5 binary units), with none ignored. v1 remains the live server path.
### M0 incremental demo