Apply native automatic kerns and protrusion at real line edges

This commit is contained in:
gloamxun committed 2026-11-21 06:00:55 +08:00
1 parent f66a5a7e20
commit 1822ab2d32
22 files changed
+260 -36

No files matched your search

@@ -53,6 +53,7 @@ pub enum DiagnosticNode {
Output(OutputNode),
Unsupported(String),
AccentKern(i32),
AutoKern(i32),
MarginKern { width: i32, right: bool },
}
/// A semantic view, without recursively copying the box's painted contents.
@@ -223,6 +224,7 @@ pub(super) fn text_nodes(nodes: &[TextNode]) -> Vec<DiagnosticNode> {
},
TextNode::Leaders(leader) => leader_node(leader),
TextNode::AccentKern(width) => DiagnosticNode::AccentKern(*width),
TextNode::AutoKern(width) => DiagnosticNode::AutoKern(*width),
TextNode::MarginKern { width, right, .. } => DiagnosticNode::MarginKern {
width: *width,
right: *right,
@@ -505,6 +507,12 @@ impl Printer<'_> {
self.number(i64::from(*width));
self.literal(" (for accent)");
}
DiagnosticNode::AutoKern(width) => {
self.command("kern");
self.literal(" ");
self.number(i64::from(*width));
self.literal(r" (for \pdfprependkern/\pdfappendkern)");
}
DiagnosticNode::Kern { width, explicit } => {
self.command("kern");
if *explicit {