Add a pdfLaTeX oracle and clamp justification glue
This commit is contained in:
1 parent
1e2d4afd6b
commit
9726f5f736
6 files changed
+379
-18
No files matched your search
+14
-8
@@ -60,12 +60,18 @@ class execution are still ahead.
|
||||
|
||||
M1 reads real CMR10 TFM metrics (advances, height/depth, italic correction,
|
||||
kern pairs, ff/fi/fl/ffi/ffl ligatures and the fontdimen glue parameters),
|
||||
hyphenates with the plain-TeX en-US patterns, and has pdfTeX fixtures for line
|
||||
breaking. The demerits/tolerance model is still simplified: the final line keeps
|
||||
its natural width and the last break can differ from TeX when a hyphenated break
|
||||
would be slightly cheaper. `route_d_multiline_bands_track_pdftex` compares the
|
||||
rasterized ink bands of a wrapped paragraph with pdfTeX, so baseline placement
|
||||
and justification are covered for the lines both engines break the same way.
|
||||
hyphenates with the plain-TeX en-US patterns, and is checked against pdfLaTeX
|
||||
by `tests/oracle.rs`: the 150pt fixture matches the oracle word for word and
|
||||
within 0.05pt horizontally. Justification now clamps the glue set ratio to the
|
||||
declared stretch and shrink, so an overfull line stays overfull exactly as in
|
||||
TeX instead of being squeezed into the measure.
|
||||
|
||||
The demerits/tolerance model is still simplified: the final line keeps its
|
||||
natural width and the last break can differ from TeX when the emergency pass
|
||||
would accept a tighter split (the 180pt fixture is `#[ignore]`d until P1).
|
||||
`route_d_multiline_bands_track_pdftex` rasterizes the same oracle-verified
|
||||
150pt paragraph in both engines and compares ink bands, covering baseline
|
||||
placement and justification.
|
||||
|
||||
## Target architecture
|
||||
|
||||
@@ -82,7 +88,7 @@ and justification are covered for the lines both engines break the same way.
|
||||
| Milestone | Content | Acceptance |
|
||||
| --- | --- | --- |
|
||||
| M0 | vertical list, page builder, checkpoint, page hash, edit demo | edit on page 2 rebuilds only page 2 |
|
||||
| M1 | TeX box/glue/penalty + paragraph builder (`\par`, `\hsize`, `\parindent`) | **partial**: item stream, CMR10 metrics, pdfTeX fixture and minimum line fill; hyphenation next |
|
||||
| M1 | TeX box/glue/penalty + paragraph builder (`\par`, `\hsize`, `\parindent`) | **partial**: item stream, CMR10 metrics, hyphenation, TeX glue clamps and a pdfLaTeX oracle at 150pt; demerits/tolerance next |
|
||||
| M2 | page builder + `\output`, `\vsize`, `\topskip`, footnotes, floats | **partial**: `\vsize` page goal, `\topskip`, forced penalties, `Insertion` reserve, running `Mark`s, `OutputRoutine` hook, top/bottom `Float` placement; interpreted `\output`, float pages next |
|
||||
| M3 | `\halign`, `\omit`, `\span`, `\multispan`, booktabs/longtable | **partial**: `Halign` model with natural column widths, spans and rule rows; no `\omit`/`\span` token parsing or PDF painting yet |
|
||||
| M4 | math lists, scripts, fractions, radicals, accents, delimiters | **partial**: `MathAtom` symbol/script/fraction boxes with CMR10 widths; no token conversion, radicals, accents or painter |
|
||||
@@ -278,7 +284,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 168 unit tests plus five route-D integration tests. Workspace verification: `cargo fmt --all -- --check`; `cargo test --workspace --offline` runs 265 tests (168 route-D unit, 5 route-D integration, 71 v1 integration, 19 server, 4 v1 unit, 1 core unit, 2 binary units). v1 remains the live server path.
|
||||
The crate currently has 179 unit tests plus six route-D integration tests and two oracle fixtures (one ignored). Workspace verification: `cargo fmt --all -- --check`; `cargo test --workspace --offline` runs 282 tests (179 route-D unit, 6 route-D integration, 2 oracle, 71 v1 integration, 19 server, 4 v1 unit, 1 core unit, 2 binary units), of which one is ignored. v1 remains the live server path.
|
||||
|
||||
### M0 incremental demo
|
||||
|
||||
|
||||
Reference in new issue
Block a user