Wire the TFM parser into the route-D core

This commit is contained in:
gloamxun committed 2026-10-20 20:46:14 +08:00
1 parent f909e8199c
commit a703f2dcc0
2 files changed
+4 -3

No files matched your search

+1
View File
@@ -3,6 +3,7 @@ pub mod math;
pub mod paragraph;
pub mod pdf;
pub mod render;
pub mod tfm;
pub use cmr10::Cmr10Metrics;
pub use paragraph::{
+3 -3
View File
@@ -229,7 +229,7 @@ for a later overlaid slash.
| M2 vertical/page builder | partial | vsize, topskip, insertions, marks, output hook, top/bottom floats, rules, vskip, penalties; interpreted `\output` and float pages absent |
| M3 halign | partial | natural columns, spans, omit, hline rows, templates, noalign skip, rules; no PDF painter |
| M4 math | partial | atoms, scripts, fractions, roots, delimiters, accents, operators, classes, braces, boxed, negated; no math painter/shrink wrapping |
| M5 NFSS/TFM | partial | CMR10 widths, per-face Base-14 PDF resources, and SVG font-family/weight/style for Roman/Bold/Italic/Mono; paragraph units carry a ParagraphFont face; TFM loading and font embedding absent |
| M5 NFSS/TFM | partial | CMR10 widths, per-face Base-14 PDF resources, and SVG font-family/weight/style for Roman/Bold/Italic/Mono; paragraph units carry a ParagraphFont face; embedded `cmr10.tfm` is parsed at runtime for widths/height/depth, but PDF font embedding and real NFSS families are absent |
| M6 specials/XObject | partial | raw specials, RGB image XObjects, URI link annotations; class/package execution absent |
| M7 incremental integration | partial | edit replay + page hashes, not wired into v1 preview |
@@ -251,7 +251,7 @@ M3 painter: `Page::display_list()` and `Halign::display_list()` produce absolute
PDF writer: `crates/texrra-tex-core/src/pdf.rs` writes multi-page PDF 1.4 with Base-14 Times/Courier resources, filled rectangles, diagonal rules, raw-RGB `/XObject` images, `/Annots` URI links and arbitrary `/special` operators. TFM/NFSS embedded fonts remain open.
M5 (partial): display-list text carries `FontFace::{Roman,Bold,Italic,BoldItalic,Mono}`; PDF resources map them to Times and Courier faces, and SVG emits matching family/weight/style. TFM parsing and embedded font subsets are still open.
M5 (partial): display-list text carries `FontFace::{Roman,Bold,Italic,BoldItalic,Mono}`; PDF resources map them to Times and Courier faces, and SVG emits matching family/weight/style. The embedded `cmr10.tfm` is parsed at runtime; PDF font embedding, ligature/kern tables and real NFSS families are still open.
M6 (partial): `DisplayItem::Image` becomes a PDF XObject; `DisplayItem::Link` becomes `/Annots /Subtype /Link /URI`; `DisplayItem::Special` injects raw content-stream operators. SVG previews show images as grey rectangles and specials as comments.
@@ -288,7 +288,7 @@ deliberately open rather than approximated:
- **M1**: TeX tolerance/demerits are still fitted to a few fixtures; multi-width
pdfTeX line breaks and full hyphenation demerits are not reproduced generally.
- **M5**: TFM parsing and embedded NFSS fonts are not implemented. Display-list text
- **M5**: `cmr10.tfm` is parsed at runtime with widths and glyph heights/depths, but embedded NFSS fonts are not implemented. Display-list text
uses Base-14 Times/Courier faces; Unicode coverage beyond Latin-1 is limited.
- **M6**: `\output`, `\insert`, mark/float output policies, class-file execution and
math limit policies are only partially modeled.