Execute positioned TeX specials through native PDF devices

This commit is contained in:
gloamxun committed 2026-11-21 11:24:46 +08:00
1 parent 05e633bb14
commit ce8a780031
21 files changed
+519 -29

No files matched your search

@@ -8,6 +8,26 @@ pub enum PdfLiteralMode {
Origin,
Page,
Direct,
XdvOrigin,
XdvDirect,
}
impl PdfLiteralMode {
pub(crate) fn xdv_origin(
self,
point: [i64; 2],
page_height: i64,
magnification: i32,
) -> Option<[i64; 2]> {
match self {
Self::XdvOrigin => Some(point),
Self::XdvDirect => {
let inch = super::unmagnify(4_736_286, magnification);
Some([inch, page_height - inch])
}
_ => None,
}
}
}
#[derive(Clone, Debug, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]