Commit Graph
439 Commits
Author SHA1 Message Date
gloamxun 4f4a4567ea Emit native PDF page resources and named transparency states 2026-11-21 00:53:46 +08:00
gloamxun 6d54af5350 Expand deferred TeX input without recursive dispatch frames 2026-11-20 23:40:14 +08:00
gloamxun ebbc9e2c17 Implement native automatic font expansion for paragraphs 2026-11-20 23:29:37 +08:00
gloamxun 4777d66fc8 Apply native font protrusion during line breaking and packing 2026-11-20 17:18:25 +08:00
gloamxun 361e8d070f Reuse decoded Type 1 fonts across native revisions 2026-11-20 16:55:48 +08:00
gloamxun 6e573dc1ce Run cancellable pdfTeX matching in native frontends 2026-11-20 16:43:48 +08:00
gloamxun 091458d329 Verify schema 28 format round trips and rejection gates 2026-11-20 16:21:19 +08:00
gloamxun 4eeb5686b8 Implement native text accents for unmodified LaTeX jobs 2026-11-20 16:15:30 +08:00
gloamxun 0a21eb27a7 Reuse session-verified source versions in native source maps 2026-11-20 14:18:42 +08:00
gloamxun 592d1ef2a3 Reuse byte-verified source versions after checkpoint resume 2026-11-20 13:02:50 +08:00
gloamxun 287d4a7cf0 Validate live checkpoint reuse across atomic project file changes 2026-11-20 08:26:44 +08:00
gloamxun 24ea6ef7ee Reuse fixed file identity within a live alias scan 2026-11-19 22:02:53 +08:00
gloamxun 10a08c4597 Batch native state fingerprint writes for live editing 2026-11-19 21:15:54 +08:00
gloamxun ee22f25ee0 Resolve TeX inputs with the default suffix alternatives 2026-11-19 20:01:08 +08:00
gloamxun 48c980c871 Share TeX hyphenation patterns and reuse verified state fingerprints 2026-11-19 19:00:55 +08:00
gloamxun ab50ca7dad Reuse project directory indexes within a revision 2026-11-19 18:14:31 +08:00
gloamxun 393fba42d8 Reuse closed events and line breaking after a checkpoint 2026-11-19 16:39:08 +08:00
gloamxun 28668ea10f Refresh interactive TeX state across successive edits 2026-11-19 16:19:29 +08:00
gloamxun 38e4822370 Integrate native repeat boxes and PDF bookmarks 2026-11-19 16:06:28 +08:00
gloamxun 9ce878efd4 Match paragraph tokens in macro delimiters 2026-11-19 15:06:50 +08:00
gloamxun 72ed779749 Promote verified native PDF and box capacity support 2026-11-19 14:39:39 +08:00
gloamxun 43231a48c0 Reuse validated checkpoint executors during native preview 2026-11-19 11:16:40 +08:00
gloamxun 06463399bb Enable automatic native checkpoints and browser preview 2026-11-19 10:05:41 +08:00
gloamxun 0abf700817 Resume native editor jobs through verified checkpoints 2026-11-19 09:35:33 +08:00
gloamxun f4b003bd27 Write native PDF catalogs and open actions 2026-11-19 08:54:04 +08:00
gloamxun a53d9c9bf9 Implement native PDF links and vertical discard lists 2026-11-18 23:39:45 +08:00
gloamxun 2741546ca8 Advance native LaTeX execution and preview 2026-11-18 22:17:21 +08:00
gloamxun 96b40c1c2e Tighten large-operator lower limits 2026-10-29 00:15:15 +08:00
gloamxun 01b3f518cb Add bounded line expansion for Times body text 2026-10-28 23:19:16 +08:00
gloamxun 049365d595 Use Times metrics for table column widths
Halign measured every cell with the CMR default even in Times documents, so the
sample table was wider than TeX and page 3 ink reached x=553. Give Halign an
optional paragraph face and refresh column widths in that face; route-D now
selects TimesRoman for ptm tabulars. Page 3 ink bbox moves to x=540, matching
the reference.
2026-10-28 13:51:00 +08:00
gloamxun 35015853b4 Test that tagged math uses the display measure
Assert TaggedWidth.width equals the measure, protecting the right-margin
equation tag geometry while the formula body remains approximate.

Test count is 1083.
2026-10-28 09:03:37 +08:00
gloamxun e41492b2a0 Keep CMMI/CMSY Type1 math in Times PDFs
The TrueType Times backend also sent math glyphs through Liberation fallbacks,
which changed their size and spacing. Allow the math face slots (6..10) to use
their Computer Modern Type1 programs even when the text backend is TrueType,
and add a PDF test asserting CMMI10 plus LiberationSerif in the same file.

Test count is 1082.
2026-10-28 08:54:55 +08:00
gloamxun 676eb7f323 Keep sum superscripts above the operator
Large-operator limits used the ordinary-base superscript gap, which could
leave N just below the sum baseline. Use a negative gap for large operators
so both limits straddle the operator, and add a unit test asserting the
subscript is below and the superscript above the base within 12pt.

Test count is 1080.
2026-10-28 08:28:17 +08:00
gloamxun 02742d201f Keep large-operator limits close to the operator
Display limits under \sum used the operator glyph depth, which pushed i=1 far
below the fraction and made the denominator look detached. Use the normal
limit gap for big operators while preserving the depth-based placement that
the existing \mathop oracle validates for ordinary bases.

Test count stays 1079.
2026-10-28 08:17:57 +08:00
gloamxun d5de8b9fe6 Attach math scripts across ignored spaces
TeX ignores spaces in math mode, but parse_sequence looked for _ or ^ at the
raw next index. Source such as \alpha _{i} therefore rendered the underscore
as a literal symbol at full size. Skip math spaces after the base before
checking for scripts.

The arXiv equation now has real subscripts and superscripts instead of literal
underscores. Test count is 1078.
2026-10-28 00:48:51 +08:00
gloamxun 742986e4dd Correct fraction depth and subscript placement
The fraction box added bar clearance twice to its depth, leaving extra space
below the denominator. Use the painted extent instead. Scripts now include
script space after the base, and subscripts drop by the base depth plus 2pt
rather than sitting on the baseline when the base has no depth.

Test count stays 1077.
2026-10-28 00:43:25 +08:00
gloamxun 802526c352 Reserve full fraction extents in math layout
Fraction layout scaled numerator and denominator extents by 0.7 while painting
both at the full size, underestimating the box height and depth. Use the full
extents plus the bar clearance so the display equation no longer compresses its
fraction vertically.

Test count stays 1077.
2026-10-28 00:39:05 +08:00
gloamxun 764bc18850 Place display equation tags at the right margin
Tagged display math used the body width as its box, so the equation number sat
immediately after the formula. Add a TaggedWidth atom carrying the line
measure: the body is centred in the measure and the tag is painted at its right
edge.

The arXiv equation number now matches the TeX right-margin placement; the
formula body remains approximate. Test count stays 1077.
2026-10-28 00:32:56 +08:00
gloamxun 37b956c0a6 Use Unicode math glyphs in table cells
Table conversion previously fell back to Size (um), approx. 100 and 10**6.
Emit µ, ~, ×, ±, Greek letters and Unicode superscripts instead, with ASCII
equivalents for width measurement when the CMR table lacks the glyph.

The arXiv table now reads Size (µm), ~100 and 10⁶ in both PDF and SVG; test
count stays 1076.
2026-10-28 00:14:55 +08:00
gloamxun fd9ee0740b Use Times metrics for bold and italic text
Add ptmb8t/ptmri8t/ptmbi8t metrics and TimesBold/TimesItalic/TimesBoldItalic
paragraph faces. A ptm document now maps Roman, bold, italic and bold-italic
base faces to the Times family, so headings and emphasised runs use Times
widths while the PDF backend continues to embed Liberation Serif.

The arXiv output is unchanged at 3 pages; previews measured 12.5-17.5 ms warm
and 191 ms cold. Test count is 1076.
2026-10-28 00:08:19 +08:00
gloamxun e9bbd4bd87 Use Times metrics for ptm documents
Add a merged ptmr8t TFM asset, a TimesRoman paragraph face and Cmr10Metrics
entry, map a ptm Roman paragraph to it, and select the Liberation Serif
TrueType PDF backend for those projects. The title is uppercased rather than
small-capped so its widths use Times metrics.

The arXiv PDF now embeds Liberation Serif for body text; title/author/abstract
land at y=88/173/277pt with three pages and all references. Headings and bold/
italic Times faces still use CMR metrics.

Test count is 1075.
2026-10-28 00:00:34 +08:00
gloamxun 2ef5e29329 Embed raster images in the SVG preview
The SVG preview painted every DisplayItem::Image as a grey rectangle. Encode
the raw RGB image as a PNG (zlib via flate2, CRC32, base64) and emit an SVG
<image> data URI; keep the grey fallback for images above four megapixels.

The article preview now contains the real 480x240 plot and the framed rule
figure is visible while editing. Test count stays 1074.
2026-10-27 23:50:48 +08:00
gloamxun 576626fe04 Centre table floats without losing rules or columns
The rule rectangle used width-margin for its right edge, so a centred table
shrank or lost its booktabs rules. Derive the right edge from the last column
offset instead, then centre a table float by shifting its margin. All three
columns and the rules now stay inside the measure.

Test count stays 1074.
2026-10-27 23:42:15 +08:00
gloamxun aa2f3cb0af Centre raster images inside floats
Add an x offset to VerticalItem::Image and use it when placing a decoded image
in a float, so a 0.4\textwidth plot is centred while its caption remains
centred across the float. Other image uses keep x=0.

Test count stays 1074.
2026-10-27 23:37:54 +08:00
gloamxun d00402a745 Use pixel dimensions for PDF image XObjects
The display-list conversion stored the layout width/height (scaled points)
as PdfImage.width/height, so an image XObject claimed 12 million pixels and
pdfimages reported bad image parameters; the image never appeared. Keep the
layout rectangle in DisplayItem::Image but use the raster pixel dimensions for
the XObject.

Verified pdfimages now lists the 480x240 plot and the article PDF shows it.
Test count stays 1074.
2026-10-27 23:30:26 +08:00
gloamxun 16dd2e1f62 Count image height in float content
VerticalItem::Image was missing from Float::content_height, so image floats
reported zero content height and could overlap following text. Include the
image height and add a regression test.

Test count is 1074.
2026-10-27 23:21:52 +08:00
gloamxun b1e3e03f00 Fix the arXiv-template PDF output
The user-supplied template PDF exposed four concrete problems:

- title/headings were letter-spaced: plain text in a large paragraph took the
  SizedText segment path and was scaled twice; the fallback run now stays at
  the base size and is scaled once by the paragraph;
- the table lost its third column because unsupported math glyphs were sent
  through the PDF fallback font; table-cell math now has a readable ASCII
  fallback (Size (um), approx. 100, 10**6);
- fancyhdr's \cfoot{\thepage} was painted together with route-D's default page
  number; default numbering is skipped for a fancy pagestyle;
- .bib data was ignored; simple @article/@inproceedings entries are now parsed
  from project .bib files, inlined as thebibliography entries, and resolved by
  the existing citation pass, producing References and [1]-[3].

The regenerated 3-page PDF was checked for title/heading spacing, table text,
references and a single page number per page. A project regression test covers
the .bib path, and the table/heading fixes have unit tests.

Remaining visible limits in this template: the complex display equation, the
\fbox/rule figure body, vector/PDF images and the author block layout.
Test count moves to 1069 (444 core, 432 engine, 65 server).
2026-10-27 13:38:36 +08:00
gloamxun 263fa36fb5 Activate dormant tests and clear route-D warnings
Three test functions in texrra-tex-core (PDF metadata, Type1 outline embedding
and \noalign row glue) were missing their #[test] attribute and only produced
dead-code warnings. With the attributes added they pass and raise the core suite
from 439 to 442 tests. The unused `mut` on the PDF entry point geometry is gone
too, leaving no route-D/PDF/lib compiler warnings in `cargo check
--workspace --all-targets`.
2026-10-27 04:09:26 +08:00
gloamxun 4068366190 Support xrightarrow and xleftarrow
The amsmath extensible arrows were unknown, so their labels fell back to plain
text. The math parser now reads \xrightarrow/\xleftarrow, an optional [below]
label, and the above label, and builds nested Stack atoms around the arrow
symbol: above stacks upward, an optional below label stacks downward.

The math test compares the bare arrow with the labeled form (width/height grow)
and with the two-label form (total height plus depth grows).
2026-10-27 03:18:20 +08:00
gloamxun 8307fc8918 Map boldsymbol to the bold math alphabet
\boldsymbol and \bm were unknown math commands, so a bold symbol fell back to
the default layout. Both names now select the same bold alphabet as \mathbf;
symbol-heavy arguments still use the regular symbol metrics, which is the
existing alphabet approximation.

A math test compares \boldsymbol{x} with \mathbf{x} for equal width and height.
2026-10-27 03:15:16 +08:00