Execute and render TeX--XeT direction spans in native layouts

This commit is contained in:
gloamxun committed 2026-11-21 16:46:17 +08:00
1 parent a93d1bb902
commit 22e3ba993d
17 files changed
+460 -54

No files matched your search

@@ -58,6 +58,7 @@ pub enum DiagnosticNode {
AccentKern(i32),
AutoKern(i32),
MarginKern { width: i32, right: bool },
Direction(DirectionBoundary),
}
/// A semantic view, without recursively copying the box's painted contents.
#[derive(Clone, Debug, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
@@ -240,6 +241,7 @@ pub(super) fn text_nodes(nodes: &[TextNode]) -> Vec<DiagnosticNode> {
width: *width,
explicit: *explicit,
},
TextNode::Direction(boundary) => DiagnosticNode::Direction(*boundary),
TextNode::MathBoundary { width, after } => DiagnosticNode::Math {
width: *width,
after: *after,
@@ -533,6 +535,7 @@ impl Printer<'_> {
}
self.number(*width as i64);
}
DiagnosticNode::Direction(boundary) => self.command(boundary.name()),
DiagnosticNode::Math { width, after } => {
self.command(if *after { "mathoff" } else { "mathon" });
if *width != 0 {