Apply float-page fraction in incremental layout

This commit is contained in:
gloamxun committed 2026-10-21 01:02:04 +08:00
1 parent 93dd4e531b
commit ff97f386da
3 files changed
+36 -10

No files matched your search

+5 -6
View File
@@ -465,15 +465,14 @@ variant for delimiters and large display operators, and builds taller glyphs
from the font's MATH assembly parts. `\\left...\\right` target sizing follows
the assignable TeX parameters `\\delimiterfactor` (default 901) and
`\\delimitershortfall` (default 5pt), including local and global assignments.
Route-D integration can also be checked against a real TeX page: `cargo test -p texrra-tex-core --test route_d` includes `Route-D float placement also mirrors `\bottomfraction`: Route-D top floats follow `\topfraction` as well: `Engine::edit` also applies `text_fraction_percent` and `bottom_fraction_percent` when it meets a bottom float, so incremental layout matches full layout.
The same rule is applied by `Engine::edit`, so a body unit that starts after an oversized top float stays on the next page after an incremental edit.
Route-D integration can also be checked against a real TeX page: `cargo test -p texrra-tex-core --test route_d` includes `route_d_page_matches_pdftex_raster_geometry`, which renders the route-D PDF and a pdfTeX page at the same geometry, rasterizes both with `pdftoppm`, and compares ink line and edge positions. It is skipped when `pdflatex`/`pdftoppm` are unavailable.
`Document::top_fraction_percent` defaults to 70, so a top float taller than 70% of the page keeps the body on the next page.
Route-D float placement mirrors TeX fractions:
`Document::bottom_fraction_percent` defaults to 30, so a bottom float taller than 30% of the page moves to the following page.
route_d_page_matches_pdftex_raster_geometry`, which renders the route-D PDF and a pdfTeX page at the same geometry, rasterizes both with `pdftoppm`, and compares ink line and edge positions. It is skipped when `pdflatex`/`pdftoppm` are unavailable.
- `Document::top_fraction_percent` defaults to 70 (`\topfraction`); a taller top float keeps body text off its page.
- `Document::bottom_fraction_percent` defaults to 30 (`\bottomfraction`); a taller bottom float moves to the next page.
- `Engine::edit` applies `top_fraction_percent`, `text_fraction_percent`, `bottom_fraction_percent`, and `float_page_fraction_percent`, so incremental layout matches full layout.
These glyphs are rasterized at
600 dpi and shared by PDF and SVG. Ordinary math atom glyphs are rasterized from