Implement XeTeX contextual interword spacing and shipout shaping

This commit is contained in:
gloamxun committed 2026-11-26 09:23:45 +08:00
1 parent 7e5428ec35
commit 4a77540e46
23 files changed
+491 -42

No files matched your search

@@ -57,6 +57,7 @@ pub enum DiagnosticNode {
Unsupported(String),
AccentKern(i32),
AutoKern(i32),
SpaceAdjustment(i32),
MarginKern { width: i32, right: bool },
Direction(DirectionBoundary),
}
@@ -226,13 +227,14 @@ pub(super) fn text_nodes(nodes: &[TextNode]) -> Vec<DiagnosticNode> {
value: *g,
name: Some(*p),
},
TextNode::Glue(g) => DiagnosticNode::Glue {
TextNode::Glue(g) | TextNode::FontSpace(g, _, _) => DiagnosticNode::Glue {
value: *g,
name: None,
},
TextNode::Leaders(leader) => leader_node(leader),
TextNode::AccentKern(width) => DiagnosticNode::AccentKern(*width),
TextNode::AutoKern(width) => DiagnosticNode::AutoKern(*width),
TextNode::SpaceAdjustment(width) => DiagnosticNode::SpaceAdjustment(*width),
TextNode::MarginKern { width, right, .. } => DiagnosticNode::MarginKern {
width: *width,
right: *right,
@@ -522,6 +524,11 @@ impl Printer<'_> {
self.number(i64::from(*width));
self.literal(" (for accent)");
}
DiagnosticNode::SpaceAdjustment(width) => {
self.command("kern");
self.number(i64::from(*width));
self.literal(" (space adjustment)");
}
DiagnosticNode::AutoKern(width) => {
self.command("kern");
self.literal(" ");