Export native TeX shipouts as binary DVI
This commit is contained in:
1 parent
34325317d2
commit
d9edc6c6e7
10 files changed
+459
-14
No files matched your search
@@ -207,6 +207,8 @@ impl WalkBudget<'_> {
|
||||
fn inside_leader(&mut self, count: usize) -> Result<(), &'static str> {
|
||||
if self.leader_depth > 0 {
|
||||
self.charge(count)?;
|
||||
} else if self.cancellation.is_some_and(Cancellation::is_cancelled) {
|
||||
return Err("native compilation cancelled");
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
@@ -230,7 +232,7 @@ pub(super) struct BoxLayout {
|
||||
}
|
||||
|
||||
pub(super) enum GeometryItem {
|
||||
Output,
|
||||
Output { special: bool },
|
||||
Paint(crate::math_engine_tex::PositionedItem),
|
||||
PdfColor { x: i64, y: i64 },
|
||||
PdfGraphics { x: i64, y: i64 },
|
||||
@@ -840,10 +842,19 @@ impl NativeBox {
|
||||
Ok(g)
|
||||
}
|
||||
|
||||
pub(super) fn visit_geometry(&self, mut emit: impl FnMut(GeometryItem)) -> Result<(), String> {
|
||||
pub(super) fn visit_geometry(&self, emit: impl FnMut(GeometryItem)) -> Result<(), String> {
|
||||
self.visit_geometry_cancellable(None, emit)
|
||||
}
|
||||
|
||||
pub(super) fn visit_geometry_cancellable(
|
||||
&self,
|
||||
cancellation: Option<&Cancellation>,
|
||||
mut emit: impl FnMut(GeometryItem),
|
||||
) -> Result<(), String> {
|
||||
use crate::math_engine_tex::PositionedItem;
|
||||
let mut unsupported = false;
|
||||
self.walk(0, 0, &mut |x, y, node| {
|
||||
let mut budget = WalkBudget { cancellation, ..WalkBudget::for_geometry() };
|
||||
self.walk_at(0, 0, 0, false, false, &mut budget, &mut |x, y, node| {
|
||||
let b = match node {
|
||||
BoxPaint::Box(b) => b,
|
||||
BoxPaint::PdfColor => {
|
||||
@@ -858,8 +869,10 @@ impl NativeBox {
|
||||
emit(GeometryItem::PdfTextSpace { x, y, operation });
|
||||
return;
|
||||
}
|
||||
BoxPaint::Output(_) => {
|
||||
emit(GeometryItem::Output);
|
||||
BoxPaint::Output(node) => {
|
||||
emit(GeometryItem::Output {
|
||||
special: matches!(node.operation, OutputOperation::Special { .. }),
|
||||
});
|
||||
return;
|
||||
}
|
||||
BoxPaint::RowStart(_) | BoxPaint::ScopeStart(_) | BoxPaint::ScopeEnd(_)
|
||||
|
||||
Reference in new issue
Block a user