Register virtual fonts in native PDF shipout order

This commit is contained in:
gloamxun committed 2026-11-21 09:18:03 +08:00
1 parent b008c0693a
commit 614f09aa9b
11 files changed
+708 -139

No files matched your search

@@ -771,6 +771,28 @@ impl NativeBox {
}
}
pub(super) fn visit_shipout_font_uses(
&self,
mut emit: impl FnMut(usize, &std::sync::Arc<crate::native_font::NativeFont>, u8),
) -> Result<(), String> {
use crate::math_engine_tex::MathItem;
let mut output_count = 0;
self.walk(0, 0, &mut |_, _, node| match node {
BoxPaint::Output(_) => output_count += 1,
BoxPaint::Box(b) => {
if let Some(geometry) = &b.math_geometry {
for item in &geometry.items {
if let MathItem::NativeGlyph { font, slot, .. } = &item.item {
emit(output_count, font, *slot);
}
}
}
}
_ => {}
})?;
Ok(())
}
pub(super) fn positioned_outputs(&self) -> Vec<[i64; 2]> {
let mut positions = Vec::new();
self.walk(0, 0, &mut |x, y, node| {