Integrate native repeat boxes and PDF bookmarks

This commit is contained in:
gloamxun committed 2026-11-19 16:06:28 +08:00
1 parent 5163fc9854
commit 38e4822370
33 files changed
+1208 -143

No files matched your search

+4 -2
View File
@@ -164,6 +164,7 @@ pub enum MathNode {
Glue(Glue),
/// Normal-unit glue, including explicit spaces and horizontal skip commands.
ExplicitSpace(Glue, Option<Parameter>),
Leaders(LeaderGlue),
Kern {
amount: i32,
mu: bool,
@@ -441,7 +442,7 @@ impl Converter<'_> {
}
pub(super) fn clean(&self, nodes: &[TextNode]) -> Result<MathGeometry, String> {
let b = self.measure(nodes)?;
if !b.output_nodes().is_empty() {
if b.contains_output()? {
return Err("deferred output in flattened native math fields requires retained semantic math boxes".into());
}
b.geometry()
@@ -462,7 +463,7 @@ impl Converter<'_> {
self.clean(&[TextNode::Box(math_box(g))])
}
MathField::Box(b) => {
if !b.output_nodes().is_empty() {
if b.contains_output()? {
return Err("deferred output in flattened native math fields requires retained semantic math boxes".into());
}
if b.shift == 0 {
@@ -701,6 +702,7 @@ impl Converter<'_> {
Some(parameter) => TextNode::NamedGlue(*glue, *parameter),
None => TextNode::Glue(*glue),
}],
MathNode::Leaders(leader) => vec![TextNode::Leaders(leader.clone())],
MathNode::Glue(g) => vec![TextNode::Glue(self.glue(*g, style)?)],
MathNode::Kern {
amount,