Reserve invisible space for phantom commands

Text-mode \phantom and \hphantom were unsupported. A text-stage pass measures
the scrubbed argument with the Roman metrics and replaces the command with
\hspace of that width, so the glyphs are omitted but the line keeps their
footprint; \vphantom contributes no horizontal material.

A test renders "A\phantom{wide}B and \vphantom{XX}C and \hphantom{QQ}D." and
checks "AB and C and D." with no warnings and none of the hidden text.
This commit is contained in:
gloamxun committed 2026-10-27 02:06:20 +08:00
1 parent 5fbcc34ddd
commit ebb178bff5
4 files changed
+67 -6

No files matched your search

+2 -2
View File
@@ -14,12 +14,12 @@ cargo fmt --all -- --check
cargo test --workspace --offline
```
The workspace currently passes **1021 tests**:
The workspace currently passes **1022 tests**:
| Suite | Tests |
| --- | --- |
| route-D unit (engine) | 437 |
| engine binary unit | 392 |
| engine binary unit | 393 |
| server integration | 63 |
| v1 integration | 71 |
| pdfLaTeX oracle | 42 |