Commit Graph
102 Commits
Author SHA1 Message Date
gloamxun 4acccaee86 Honour explicit sfcode assignments 2026-10-23 02:29:40 +08:00
gloamxun b5ec36ae2a Split insertions at the page break and hold over the tail 2026-10-23 02:26:56 +08:00
gloamxun b7b75fbff1 Split paragraphs at line boundaries across pages 2026-10-23 02:23:18 +08:00
gloamxun daf9f5c57e Expose TeX carried marks for page headers 2026-10-23 02:00:29 +08:00
gloamxun 8d319b3b0c Apply TeX page offsets in the route-D PDF endpoint 2026-10-23 01:57:48 +08:00
gloamxun 5db7acaff2 Shift the route-D page body by TeX page origin offsets 2026-10-23 01:55:28 +08:00
gloamxun fb33ac6327 Apply the insertion count multiplier to page space 2026-10-23 01:51:19 +08:00
gloamxun 169119a48d Cap page depth at Document max_depth 2026-10-23 01:48:21 +08:00
gloamxun 9599982b91 Feed simple documents through the TeX page builder 2026-10-23 01:45:45 +08:00
gloamxun d4a9c6b4fd Add a TeX page builder over vertical lists 2026-10-23 01:41:06 +08:00
gloamxun 49bd9b63e6 Model TeX interline glue and parskip 2026-10-23 01:36:26 +08:00
gloamxun ac134b3c4e Reproduce TeX paragraph breaking with tolerance passes and demerits
- replace the single-tolerance DP with pass 0 (pretolerance, no hyphenation),
  pass 1 (tolerance, hyphenation) and an optional emergency pass
- add emergencystretch to ParagraphStyle; the emergency pass only runs when it
  is positive, otherwise TeX's overfull fallback applies and each line fills to
  the first break at or past the measure
- compute badness and fitness classes like TeX and fold them with penalties
  into demerits, ignoring the trailing forced penalty on the final line
- keep forward order in the greedy fallback
- enable the 180pt pdfLaTeX oracle fixture and add an emergencystretch test
- give route-D extraction tests scaled body styles so fixed-cell
  ParagraphStyle defaults no longer mix raw units with TFM advances
- document the passes, oracle results and remaining P1 gaps
2026-10-23 00:50:57 +08:00
gloamxun 1e2d4afd6b Plan the complete route-D program 2026-10-23 00:19:59 +08:00
gloamxun 4414f27438 Justify route-D lines and compare ink bands with pdfTeX 2026-10-22 19:45:31 +08:00
gloamxun 93330a85ef Start float pages at the top margin 2026-10-21 12:57:51 +08:00
gloamxun d2df1907be Keep in-text floats in the body flow 2026-10-21 12:55:42 +08:00
gloamxun 830e1f851b Reserve textfloatsep between floats and body text 2026-10-21 12:51:01 +08:00
gloamxun 1014713ec0 Reserve floatsep between stacked floats 2026-10-21 12:46:24 +08:00
gloamxun 8731ec2b9e Subset embedded fonts to the glyphs a document uses 2026-10-21 09:14:46 +08:00
gloamxun 06779fb8dd Support per-class insertion skip
InsertionClass gains skip, matching TeX skip registers for insertion classes. The page builder prefers that value over Document.insertion_skip for the class, in both full and incremental layout; regressions cover a skip that pushes an insertion to the next page and the edit path.
2026-10-21 09:01:12 +08:00
gloamxun 7385b8862a Honour TeX float number limits
Add top_number, bottom_number and total_number to Document with TeX defaults 2, 1 and 12. Top and bottom float branches, including the incremental edit path, refuse an extra float once its placement count or the total page count is reached, so the float moves to the next page.
2026-10-21 08:57:16 +08:00
gloamxun f2deac541e Reuse page prefixes for structural route-D edits
Extract Engine::relayout_from from Engine::edit so a caller can rebuild from any checkpoint with an unchanged unit prefix. Route-D project previews now use the first differing paragraph for both text and structural edits, keeping sealed pages before the change instead of always relaying out the whole document.
2026-10-21 08:53:17 +08:00
gloamxun ceb31c4612 Replay multiple paragraph edits in route-D previews
Apply same-count paragraph edits sequentially from the earliest changed paragraph, reuse the earlier page checkpoints, and report the union of changed pages. Adds a multi-page regression.
2026-10-21 08:46:56 +08:00
gloamxun 180c05e425 Reserve skip before the first insertion class 2026-10-21 08:28:34 +08:00
gloamxun e052a0d0f3 Compress embedded font and ToUnicode streams
Route-D PDFs embedded full FontFile2 programs and ToUnicode CMaps uncompressed. Deflate both streams and declare /Filter /FlateDecode while keeping /Length1 as the uncompressed font length. The minimal route-D PDF now renders to 13.5 KB, and the pdfTeX raster comparison still matches.
2026-10-21 08:19:02 +08:00
gloamxun aeacf53518 Make the pdfTeX raster comparison actually run
pdftoppm --version exits non-zero, so the raster test silently skipped on every host. Probe pdftoppm with -v instead, lay out the route-D paragraph at the same scaled-point geometry the server uses, and compile the pdfTeX control page as Letter (612x792bp). The ink line count and left/right/bottom edges now match exactly.
2026-10-21 08:10:29 +08:00
gloamxun c3277531d3 Export project PDFs through route-D when selected 2026-10-21 01:15:09 +08:00
gloamxun 21cc743236 Document the route-D preview toggle 2026-10-21 01:12:12 +08:00
gloamxun 95760e4a1c Turn TeX hyphen runs into en and em dashes 2026-10-21 01:08:22 +08:00
gloamxun ff97f386da Apply float-page fraction in incremental layout 2026-10-21 01:02:04 +08:00
gloamxun 93dd4e531b Apply bottom float fractions in incremental layout 2026-10-20 23:44:22 +08:00
gloamxun 48d10f901d Apply topfraction in incremental layout 2026-10-20 23:41:31 +08:00
gloamxun d81021d1a3 Honour topfraction for top floats 2026-10-20 23:37:47 +08:00
gloamxun 14a3775206 Honour bottomfraction when placing bottom floats 2026-10-20 23:33:21 +08:00
gloamxun c2dbf405ab Compare route-D raster geometry with pdfTeX 2026-10-20 23:20:28 +08:00
gloamxun ea69301804 Reuse route-D page checkpoints in project previews 2026-10-20 23:13:49 +08:00
gloamxun fe7fd68321 Let project previews opt into the route-D core 2026-10-20 23:09:32 +08:00
gloamxun a8e7499ce3 Honour per-class insertion page limits 2026-10-20 23:02:30 +08:00
gloamxun 67915402a6 Use CMR10 advances for route-D paragraphs and PDF text 2026-10-20 22:55:38 +08:00
gloamxun edf851438b Render enumerate lists in the route-D preview 2026-10-20 22:01:02 +08:00
gloamxun cea9ccddef Render itemize lists in the route-D preview 2026-10-20 21:59:17 +08:00
gloamxun 63593e7ff3 Render display math in the route-D preview 2026-10-20 21:57:12 +08:00
gloamxun 2c4d968659 Map sections and emphasis in the route-D preview 2026-10-20 21:45:34 +08:00
gloamxun ec9ce3b765 Export route-D preview pages as PDF 2026-10-20 21:41:46 +08:00
gloamxun dbccedb579 Expose route-D page-hash diffs for paragraph edits 2026-10-20 21:18:57 +08:00
gloamxun 875f8a7600 Expose route-D pages through a preview endpoint 2026-10-20 21:15:35 +08:00
gloamxun cc9cdf1689 Match a pdfTeX paragraph fixture with CMR10 metrics 2026-10-20 12:24:13 +08:00
gloamxun bf5dae3797 Use CMR10 metrics in the M1 paragraph builder 2026-10-20 12:20:49 +08:00
gloamxun 51beb682f0 Add the M1 box/glue/penalty paragraph builder 2026-10-20 12:11:09 +08:00
gloamxun 99dbb5ebb0 Start route D incremental TeX core with M0 checkpoint spike 2026-10-20 12:06:39 +08:00