Honour finite parfillskip on the last line

This commit is contained in:
gloamxun committed 2026-10-23 01:22:16 +08:00
1 parent 8993186005
commit bd109d03c5
6 files changed
+146 -16

No files matched your search

+10 -7
View File
@@ -88,7 +88,9 @@ solutions. Two further fixtures pin register behaviour at 120pt:
`\pretolerance=10000` stops before hyphenation and `\hyphenpenalty=10000`
inhibits it, leaving the overfull first-fit lines TeX produces. A 120pt
fixture with `\hangindent=20pt \hangafter=1` checks every line origin
against pdfLaTeX as well as the word positions inside each line. `route_d_multiline_bands_track_pdftex` rasterizes the same
against pdfLaTeX as well as the word positions inside each line, and a
`\parfillskip=0pt` fixture checks that a final line without `fil` glue is
justified like any other line (the default `0pt plus 1fil` leaves it short). `route_d_multiline_bands_track_pdftex` rasterizes the same
paragraph in both engines and compares ink bands, covering baseline placement
and justification.
@@ -124,8 +126,8 @@ and justification.
`\hyphenation` exceptions are inserted into the pattern trie, and
`\hangindent`/`\hangafter`/`\parshape` change each line's measure and left
offset. Remaining gaps are `\looseness`, spacefactor/`\sfcode`,
`\parfillskip`/fil glue orders, and the vertical-list skips
(`\baselineskip`, `\lineskip`, `\parskip`).
generic `fil`/`fill` glue orders outside `\parfillskip`, and the
vertical-list skips (`\baselineskip`, `\lineskip`, `\parskip`).
The pdfLaTeX oracle pins six measures (100-240pt) and all match; no oracle
fixture is ignored.
@@ -297,7 +299,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 184 unit tests plus six route-D integration tests and six oracle fixtures. Workspace verification: `cargo fmt --all -- --check`; `cargo test --workspace --offline` runs 293 tests (184 route-D unit, 6 route-D integration, 6 oracle, 71 v1 integration, 19 server, 4 v1 unit, 1 core unit, 2 binary units), with none ignored. v1 remains the live server path.
The crate currently has 186 unit tests plus six route-D integration tests and seven oracle fixtures. Workspace verification: `cargo fmt --all -- --check`; `cargo test --workspace --offline` runs 296 tests (186 route-D unit, 6 route-D integration, 7 oracle, 71 v1 integration, 19 server, 4 v1 unit, 1 core unit, 2 binary units), with none ignored. v1 remains the live server path.
### M0 incremental demo
@@ -325,9 +327,10 @@ The staged program that closes these milestones is described in
Route D currently covers M0-M4/M6 as a working subset. The remaining milestones are
deliberately open rather than approximated:
- **M1**: `\looseness`, spacefactor/`\sfcode`, `\parfillskip`/fil glue orders
and the vertical-list skips are still open; the tolerance, penalty and demerit
registers, `\hyphenation` exceptions, and `\hangindent`/`\parshape` are
- **M1**: `\looseness`, spacefactor/`\sfcode`, generic `fil`/`fill` glue
orders and the vertical-list skips are still open; the tolerance, penalty and
demerit registers, `\hyphenation` exceptions,
`\hangindent`/`\parshape`, and `\parfillskip` with or without `fil` are
modelled.
- **M5**: `cmr10.tfm` is parsed at runtime with widths, glyph heights/depths and kern pairs. only used text faces embed Liberation Serif/Mono as Type0/Identity-H; each face is subset to the glyphs actually used (composite components included, glyph IDs retained); FontFile2 and ToUnicode streams use Flate compression; the ToUnicode CMap follows the used characters; ff/fi/fl/ffi/ffl ligatures come from TFM, and CMR10 italic corrections are applied at line ends; full NFSS family switching is not implemented.
- **M6**: `\output`, `\insert`, mark/float output policies, class-file execution and