Build native PDF article threads and bead rings

This commit is contained in:
gloamxun committed 2026-11-28 16:03:37 +08:00
1 parent de4bd1fa76
commit 4fb0f2c89b
15 files changed
+528 -28

No files matched your search

@@ -117,6 +117,9 @@ pub enum Primitive {
Pdfsave,
Pdfstartlink,
Pdfannot,
Pdfthread,
Pdfstartthread,
Pdfendthread,
Pdfendlink,
Pdfrunninglinkoff,
Pdfrunninglinkon,
@@ -972,6 +975,9 @@ const PDFTEX_ONLY_PRIMITIVES: &[(&str, Primitive)] = {
("pdfsave", Pdfsave),
("pdfstartlink", Pdfstartlink),
("pdfannot", Pdfannot),
("pdfthread", Pdfthread),
("pdfstartthread", Pdfstartthread),
("pdfendthread", Pdfendthread),
("pdfendlink", Pdfendlink),
("pdfrunninglinkoff", Pdfrunninglinkoff),
("pdfrunninglinkon", Pdfrunninglinkon),
@@ -1989,6 +1995,18 @@ impl State {
}
}
pub(super) fn install_pdf_thread_commands(&mut self) {
let enabled = self.input_profile != super::InputProfile::XeTeX;
for (name, primitive) in [
("pdfthread", Primitive::Pdfthread),
("pdfstartthread", Primitive::Pdfstartthread),
("pdfendthread", Primitive::Pdfendthread),
] {
self.update_profile_command(name, Meaning::Primitive(primitive), enabled);
}
self.update_profile_command("pdfthreadmargin", Meaning::Parameter(Parameter::Pdfthreadmargin), enabled);
}
fn install_pdftex_primitives(&mut self) {
let enabled = self.input_profile != super::InputProfile::XeTeX;
for &(name, primitive) in PDFTEX_ONLY_PRIMITIVES {