Execute native PDF device extensions in math lists
This commit is contained in:
1 parent
d1ddf4bfeb
commit
278b1f35e2
5 files changed
+78
-36
No files matched your search
@@ -3611,10 +3611,6 @@ impl Executor {
|
||||
Cr | Crcr | Span | Omit | Noalign => {
|
||||
return self.fail("misplaced native alignment command");
|
||||
}
|
||||
Pdfglyphtounicode => self.glyph_to_unicode(files)?,
|
||||
Pdffontattr | Pdfnobuiltintounicode => {
|
||||
self.pdf_font_settings(primitive, files)?;
|
||||
}
|
||||
Explicitspace => {
|
||||
if self.paragraph.is_some() {
|
||||
let space = self.explicit_space()?;
|
||||
@@ -3791,31 +3787,7 @@ impl Executor {
|
||||
});
|
||||
}
|
||||
Openin | Closein => self.input_stream(primitive == Openin, files)?,
|
||||
Openout | Closeout | Write | Immediate => {
|
||||
self.output_command(primitive, token.span, files)?
|
||||
}
|
||||
Pdfcolorstack => self.scan_pdf_color_action(token.span, files)?,
|
||||
Pdfsave | Pdfsetmatrix | Pdfrestore | Pdfliteral => {
|
||||
self.scan_pdf_graphics(primitive, token.span, files)?
|
||||
}
|
||||
Pdfstartlink | Pdfendlink | Pdfdest | Pdfrunninglinkoff | Pdfrunninglinkon => {
|
||||
self.scan_pdf_link(primitive, token.span, files)?;
|
||||
}
|
||||
Pdfinterwordspaceon | Pdfinterwordspaceoff | Pdffakespace | Pdfspacefont => {
|
||||
self.scan_pdf_space(primitive, token.span, files)?;
|
||||
}
|
||||
Pdfsetrandomseed => {
|
||||
let seed = self.integer(files)?;
|
||||
self.reads.insert(Dependency::PdfRandomState);
|
||||
self.state.reseed_random(seed);
|
||||
}
|
||||
Pdfobj => self.scan_pdf_object(false, files)?,
|
||||
Pdfrefobj => self.scan_pdf_object_reference(token.span, files)?,
|
||||
Pdfcatalog => self.scan_pdf_catalog(files)?,
|
||||
Pdfoutline => self.scan_pdf_outline(files)?,
|
||||
Pdfinfo => self.scan_pdf_info(files)?,
|
||||
Pdfximage => self.scan_pdf_image(&token, false, files)?,
|
||||
Pdfrefximage => self.reference_pdf_image(&token, files)?,
|
||||
_ if self.execute_output_extension(primitive, &token, files)? => {}
|
||||
_ => {
|
||||
self.assignment(Some(primitive), None, files)?;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,50 @@
|
||||
use super::*;
|
||||
use crate::pdf_device::{PdfFileOptions, PdfPageData};
|
||||
impl Executor {
|
||||
/// TeX extension commands share the scanner and produce their normal
|
||||
/// effects in math as well as in vertical and horizontal lists.
|
||||
pub(super) fn execute_output_extension(
|
||||
&mut self,
|
||||
primitive: Primitive,
|
||||
token: &Token,
|
||||
files: &mut impl SourceProvider,
|
||||
) -> Result<bool, Error> {
|
||||
use Primitive::*;
|
||||
match primitive {
|
||||
Pdfglyphtounicode => self.glyph_to_unicode(files)?,
|
||||
Pdffontattr | Pdfnobuiltintounicode => {
|
||||
self.pdf_font_settings(primitive, files)?;
|
||||
}
|
||||
Openout | Closeout | Write | Immediate => {
|
||||
self.output_command(primitive, token.span, files)?
|
||||
}
|
||||
Pdfcolorstack => self.scan_pdf_color_action(token.span, files)?,
|
||||
Pdfsave | Pdfsetmatrix | Pdfrestore | Pdfliteral => {
|
||||
self.scan_pdf_graphics(primitive, token.span, files)?
|
||||
}
|
||||
Pdfstartlink | Pdfendlink | Pdfdest | Pdfrunninglinkoff | Pdfrunninglinkon => {
|
||||
self.scan_pdf_link(primitive, token.span, files)?;
|
||||
}
|
||||
Pdfinterwordspaceon | Pdfinterwordspaceoff | Pdffakespace | Pdfspacefont => {
|
||||
self.scan_pdf_space(primitive, token.span, files)?;
|
||||
}
|
||||
Pdfsetrandomseed => {
|
||||
let seed = self.integer(files)?;
|
||||
self.reads.insert(Dependency::PdfRandomState);
|
||||
self.state.reseed_random(seed);
|
||||
}
|
||||
Pdfobj => self.scan_pdf_object(false, files)?,
|
||||
Pdfrefobj => self.scan_pdf_object_reference(token.span, files)?,
|
||||
Pdfcatalog => self.scan_pdf_catalog(files)?,
|
||||
Pdfoutline => self.scan_pdf_outline(files)?,
|
||||
Pdfinfo => self.scan_pdf_info(files)?,
|
||||
Pdfximage => self.scan_pdf_image(token, false, files)?,
|
||||
Pdfrefximage => self.reference_pdf_image(token, files)?,
|
||||
_ => return Ok(false),
|
||||
}
|
||||
Ok(true)
|
||||
}
|
||||
|
||||
pub(super) fn pdf_token_parameter_bytes(
|
||||
&mut self,
|
||||
parameter: TokenParameter,
|
||||
|
||||
@@ -546,11 +546,7 @@ impl Executor {
|
||||
)?,
|
||||
Vcenter => self.box_command(*p, boxes::Destination::Append, token.span, files)?,
|
||||
Hbox | Vbox | Vtop | Box | Copy | Setbox | Wd | Ht | Dp | Lastbox | Raise
|
||||
| Lower | Vsplit | Mark | Marks | Vadjust | Insert | Shipout | Openout
|
||||
| Closeout | Write | Pdfcolorstack | Pdfsave | Pdfsetmatrix | Pdfrestore | Pdfcatalog | Pdfoutline
|
||||
| Pdfglyphtounicode | Pdffontattr | Pdfnobuiltintounicode
|
||||
| Pdfrunninglinkoff | Pdfrunninglinkon
|
||||
| Pdfinterwordspaceon | Pdfinterwordspaceoff | Pdffakespace | Pdfspacefont
|
||||
| Lower | Vsplit | Mark | Marks | Vadjust | Insert | Shipout
|
||||
| Ignorespaces | Unskip | Unkern | Unpenalty => {
|
||||
return Ok(false);
|
||||
}
|
||||
@@ -791,9 +787,10 @@ impl Executor {
|
||||
| Scriptscriptfont | Endlinechar | Newlinechar | Escapechar | Globaldefs | Time
|
||||
| Day | Month | Year | BeginGroup | EndGroup | Relax | Message | Errmessage
|
||||
| Endinput | Showbox | Show | Showthe | Discretionary | DiscretionaryHyphen
|
||||
| Parshape | Partokenname | Pdfliteral => {
|
||||
| Parshape | Partokenname => {
|
||||
return Ok(false);
|
||||
}
|
||||
_ if self.execute_output_extension(*p, token, files)? => {}
|
||||
_ => return self.fail(format!("unsupported native math primitive: {p:?}")),
|
||||
},
|
||||
Meaning::Count(_)
|
||||
|
||||
+22
-1
@@ -1232,12 +1232,33 @@ MediaBox 供实际 PDF 消费。页面和根字典的间接引用进入与普通
|
||||
参考与原生分别从各自格式重载,页属性和根属性继续生效。编辑第二页的
|
||||
裁切/旋转复用950步,只重发第二页。PDF、SVG 和归一化来源映射与
|
||||
独立零复用一致。追加页面 Group 时,PDF 合成预览继续采用该页
|
||||
240 × 160 bp 的视口。
|
||||
240 × 160 bp 的视口。 修改作业尾部的根 Rotate 复用1458步,只重发继承该属性的
|
||||
第1、3页。第二页有独立旋转,继续复用 SVG。该修订也与独立零复用一致。
|
||||
旋转后的原生 SVG 规则框与来源框和实际 PDF 的 144 DPI 墨迹边缘相比,
|
||||
误差不超过1像素。根 CropBox 和 Rotate 使用间接对象的对照,实际裁切
|
||||
和 144 DPI 灰度图一致。五项原有 PDF 配置和链接回归通过。
|
||||
|
||||
在 `target/p3-pdf-page-dictionary-native` 保留实际回执。
|
||||
|
||||
- `receipt.json` 为 `1d6ee45530a70951b88bc3e4469cc871f316b861d8c3236c6dd371fbb4dc6e79`。
|
||||
- `checkpoint/receipt.json` 为 `94f1ff6e479b5344f802dee6101dfb0b13960500b149e6dcc7d8187d78363520`。
|
||||
- `root-edit/receipt.json` 为 `2ca9b1e2b08237b6315c72530158fca93fe814a09e7eb316aa5ef16f7521f76f`。
|
||||
- `checkpoint/geometry-receipt.json` 为 `d293ad492362433f176c418d02788e8e1270774ce72b026d38e08a5258c6ddb7`。
|
||||
|
||||
### 数学列表中的设备扩展
|
||||
|
||||
数学、横向和纵向执行共用现有 I/O 与 PDF 扩展扫描。数学字段本身的
|
||||
扫描规则继续由数学执行层处理。写入数学列表的延迟操作继续作为真正的
|
||||
whatsit,只有发页时实际写出。对象保留号、立即写入、目录及信息字典继续
|
||||
使用同一对象表与设备状态。没有改变格式数据结构,可直接重载已冻存的
|
||||
schema43。
|
||||
|
||||
原样 ACM 双栏在标题标签结构中调用 \pdfobj reserveobjnum,为该边界的
|
||||
原始证据。实际 INITEX 参照使用同一组数学 TFM。释出的数学盒中立即与延迟
|
||||
创建的对象均能由目录真实引用,未发页盒的对象未写入。文档 Info 字段
|
||||
一致,实际规则所在页的144 DPI灰度像素一致。
|
||||
|
||||
回执为 `target/p3-pdf-math-extensions-native/receipt.json`,SHA-256 为 `2eb409028f556ded23ebf69a457a3e9512bfde7113263377fbd9f3a0df8b90db`。
|
||||
|
||||
### PDF 字面中的矩阵与来源映射
|
||||
|
||||
|
||||
@@ -602,6 +602,14 @@ schema42 优化版从同一原样格式入口构建,并加载相同的44个输
|
||||
- `acm-format/receipt.json` 为 `bc9b7003c755002dd8a780cd687c3332c2d87152ebd47867e0132d7af4c02461`。
|
||||
- `acm-acmtog/receipt.json` 为 `a1164a2ef06e695fc49c7eca94d3a2a84eff09acb9e8330d310c5bc62c93966a`。
|
||||
|
||||
schema43 优化版用同一 format 入口、44个冻结输入与字体映射越过页面字典,
|
||||
到达标题处理中的标签结构写出。实际首个错误为数学列表不接受
|
||||
\pdfobj reserveobjnum。该轮未形成 PDF,保留此前 tagpdf 的实际警告与
|
||||
停止记录。回执位于 `target/p3-pdf-page-dictionary-native`。
|
||||
|
||||
- `acm-format/receipt.json` 为 `ca532cfc24bca15b7481896729beeda9dde972d5165fe004536d983ac72a8d93`。
|
||||
- `acm-acmtog/receipt.json` 为 `ebea20c97e3ea4a1705ff7f81090bbaaeaeabacbb30367b83fd44c000016c152`。
|
||||
|
||||
最终矩阵 `target/publisher-template-matrix/acm-official/matrix-schema29-utf8/report.json`
|
||||
SHA-256 为 `d914d7c7dfa1ee28dff20e77231fef35e390041cde6180bcc361de83288ec9e1`。其 `preparation/acmart` 保存
|
||||
DocStrip 记录。同目录的前序依赖失败、补充包指纹和原样源均保留。用现有
|
||||
|
||||
Reference in new issue
Block a user