diff --git a/assets/fonts-subset-min/LiberationMono-Bold.ttf b/assets/fonts-subset-min/LiberationMono-Bold.ttf index 13494fd..62df308 100644 Binary files a/assets/fonts-subset-min/LiberationMono-Bold.ttf and b/assets/fonts-subset-min/LiberationMono-Bold.ttf differ diff --git a/assets/fonts-subset-min/LiberationMono-BoldItalic.ttf b/assets/fonts-subset-min/LiberationMono-BoldItalic.ttf index d69f1de..b519ba2 100644 Binary files a/assets/fonts-subset-min/LiberationMono-BoldItalic.ttf and b/assets/fonts-subset-min/LiberationMono-BoldItalic.ttf differ diff --git a/assets/fonts-subset-min/LiberationMono-Italic.ttf b/assets/fonts-subset-min/LiberationMono-Italic.ttf index 2f7bccf..20628d9 100644 Binary files a/assets/fonts-subset-min/LiberationMono-Italic.ttf and b/assets/fonts-subset-min/LiberationMono-Italic.ttf differ diff --git a/assets/fonts-subset-min/LiberationMono-Regular.ttf b/assets/fonts-subset-min/LiberationMono-Regular.ttf index 2b32b75..15b2acb 100644 Binary files a/assets/fonts-subset-min/LiberationMono-Regular.ttf and b/assets/fonts-subset-min/LiberationMono-Regular.ttf differ diff --git a/assets/fonts-subset-min/LiberationSans-Bold.ttf b/assets/fonts-subset-min/LiberationSans-Bold.ttf index 5f0cc49..638ab65 100644 Binary files a/assets/fonts-subset-min/LiberationSans-Bold.ttf and b/assets/fonts-subset-min/LiberationSans-Bold.ttf differ diff --git a/assets/fonts-subset-min/LiberationSans-BoldItalic.ttf b/assets/fonts-subset-min/LiberationSans-BoldItalic.ttf index df00202..02f6707 100644 Binary files a/assets/fonts-subset-min/LiberationSans-BoldItalic.ttf and b/assets/fonts-subset-min/LiberationSans-BoldItalic.ttf differ diff --git a/assets/fonts-subset-min/LiberationSans-Italic.ttf b/assets/fonts-subset-min/LiberationSans-Italic.ttf index c17a3da..1745a54 100644 Binary files a/assets/fonts-subset-min/LiberationSans-Italic.ttf and b/assets/fonts-subset-min/LiberationSans-Italic.ttf differ diff --git a/assets/fonts-subset-min/LiberationSans-Regular.ttf b/assets/fonts-subset-min/LiberationSans-Regular.ttf index 9c3a7ba..ab59d7b 100644 Binary files a/assets/fonts-subset-min/LiberationSans-Regular.ttf and b/assets/fonts-subset-min/LiberationSans-Regular.ttf differ diff --git a/assets/fonts-subset-min/LiberationSerif-Bold.ttf b/assets/fonts-subset-min/LiberationSerif-Bold.ttf index a68c3e9..59cf255 100644 Binary files a/assets/fonts-subset-min/LiberationSerif-Bold.ttf and b/assets/fonts-subset-min/LiberationSerif-Bold.ttf differ diff --git a/assets/fonts-subset-min/LiberationSerif-BoldItalic.ttf b/assets/fonts-subset-min/LiberationSerif-BoldItalic.ttf index e2e6e80..e5bc827 100644 Binary files a/assets/fonts-subset-min/LiberationSerif-BoldItalic.ttf and b/assets/fonts-subset-min/LiberationSerif-BoldItalic.ttf differ diff --git a/assets/fonts-subset-min/LiberationSerif-Italic.ttf b/assets/fonts-subset-min/LiberationSerif-Italic.ttf index 806ccd4..ff1ed5a 100644 Binary files a/assets/fonts-subset-min/LiberationSerif-Italic.ttf and b/assets/fonts-subset-min/LiberationSerif-Italic.ttf differ diff --git a/assets/fonts-subset-min/LiberationSerif-Regular.ttf b/assets/fonts-subset-min/LiberationSerif-Regular.ttf index 1e456d7..1d5930d 100644 Binary files a/assets/fonts-subset-min/LiberationSerif-Regular.ttf and b/assets/fonts-subset-min/LiberationSerif-Regular.ttf differ diff --git a/docs/STATUS.md b/docs/STATUS.md index ae66e85..f9013c0 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -123,7 +123,7 @@ See `docs/ROADMAP.md` for concrete implementation plans. - `examples/hello.tex`, `examples/boxes.tex`, `examples/compat.tex` compile to one A4 page each; the arXiv template project compiles to 3 Letter pages. - All text faces are embedded Liberation Serif/Mono/Sans (arXiv PDF is about - 3.6 MB and `pdffonts` reports only embedded CID TrueType faces); this avoids + 0.29 MB and `pdffonts` reports only embedded CID TrueType faces); this avoids viewer-dependent glyph substitution. Tables use natural column widths and centered rules; preview and PDF share the same table line coordinates. - `cargo fmt --check` passes; `cargo test --offline` (58 tests: 54 compiler @@ -137,7 +137,7 @@ See `docs/ROADMAP.md` for concrete implementation plans. - Compiler integration tests: 53; server tests: 4; total 57. - `cargo fmt --check` passes. -- arXiv fixture: 3 Letter pages, ~0.53 MB; four serif faces and one monospace face embedded (bold/italic monospace falls back to the regular face). The bundled SubsetTTF faces are pyftsubset outputs with retained glyph ids and a filtered legacy kern table; a second smaller Latin-1/Greek tier is selected when the document charset fits. +- arXiv fixture: 3 Letter pages, ~0.29 MB; four serif faces and one monospace face embedded (bold/italic monospace falls back to the regular face). The bundled SubsetTTF faces are pyftsubset outputs with retained glyph ids and a filtered legacy kern table; a third 110-glyph ASCII/typographic tier is selected when the document charset fits. - Title/author/date/Introduction baselines within 0.3 pt of the XeLaTeX reference; page 1 keeps the closing section-2 line above the footnote. - Table 61.1 mm wide (reference 61.2 mm) with `\multicolumn` spans and @@ -146,4 +146,4 @@ See `docs/ROADMAP.md` for concrete implementation plans. - PDF link annotations are added by reopening the finished PDF with lopdf, since printpdf 0.3.4 has no annotation API. -- Fonts: bundled reserved-glyph subsets in `assets/fonts-subset/` are used when the document charset is covered; arXiv PDF is about 0.53 MB with 58 tests. +- Fonts: bundled reserved-glyph subsets in `assets/fonts-subset/` are used when the document charset is covered; arXiv PDF is about 0.29 MB with 58 tests. diff --git a/examples/hello.tex b/examples/hello.tex index d7748d3..b122479 100644 --- a/examples/hello.tex +++ b/examples/hello.tex @@ -1,4 +1,34 @@ \documentclass{article} \begin{document} -See \href{https://example.com/target}{Click here} now. + +\section*{Compatibility examples} + +Spacing: A\quad B\qquad C, A\thinspace B\enspace C. + +Symbols: \S\P\dag\ddag\copyright\textbullet\textregistered\texttrademark +\ldots\textendash\textemdash\guillemotleft x\guillemotright +\texteuro\textsterling\textyen\textdegree\textpm. + +Letters: \ss\ae\AE\oe\OE\aa\AA\o\O\l\L\i. + +Styles: {\bfseries bold}, {\itshape italic}, {\ttfamily mono}, \textsc{small caps}. + +Breaks: A\nopagebreak[4] B\linebreak[2] C\samepage. + +A\vspace*{6pt} B + +\vspace{6pt} + +A\hspace*{1cm}B + +\begin{center} +Centered text +\end{center} + +\hrule + +\fbox{Framed box} and \mbox{unbreakable box}. + +\parbox{60mm}{A parbox wraps its content to sixty millimetres and stays in the vertical flow.} + \end{document} diff --git a/src/rust_typeset/pdf.rs b/src/rust_typeset/pdf.rs index 289be88..ad0ac11 100644 --- a/src/rust_typeset/pdf.rs +++ b/src/rust_typeset/pdf.rs @@ -3138,17 +3138,30 @@ fn builtin_safe_char(ch: char) -> bool { fn minimal_subset_safe_char(ch: char) -> bool { let code = ch as u32; matches!(code, - 0x09..=0x0A + 0x09 + | 0x0A | 0x20..=0x7E - | 0xA0..=0xFF - | 0x370..=0x3FF - | 0x2000..=0x206F - | 0x2070..=0x209F - | 0x20A0..=0x20CF - | 0x2100..=0x214F - | 0x2190..=0x21FF - | 0x2200..=0x22FF - | 0x25A0..=0x25FF + | 0xA0 + | 0xA9 + | 0xAE + | 0xB0 + | 0xB1 + | 0xB5 + | 0xB7 + | 0xD7 + | 0x2013 + | 0x2014 + | 0x2018 + | 0x2019 + | 0x201C + | 0x201D + | 0x2022 + | 0x2026 + | 0x00B2..=0x00B3 | 0x00B9 + | 0x2070..=0x2079 + | 0x223C + | 0x2248 + | 0x03BC | 0xF0000..=0xFFFFF ) } diff --git a/tests/typeset.rs b/tests/typeset.rs index bc35e40..c6fec82 100644 --- a/tests/typeset.rs +++ b/tests/typeset.rs @@ -130,6 +130,13 @@ fn arxiv_pdf_embeds_a_single_monospace_face() { faces <= 5, "arXiv PDF should embed four serif faces plus one monospace face, got {faces}" ); + if !cfg!(debug_assertions) { + assert!( + pdf.len() < 320_000, + "arXiv PDF should use the compact minimal tier, got {} bytes", + pdf.len() + ); + } } #[test]