Shape and render explicit OpenType fonts in native Unicode jobs

This commit is contained in:
gloamxun committed 2026-11-21 10:35:03 +08:00
1 parent 3caf1eced2
commit 70822cbd94
33 files changed
+1255 -80

No files matched your search

@@ -332,6 +332,7 @@ impl NativeBox {
TextNode::Glyph { glyph, .. }
| TextNode::Box(glyph)
| TextNode::MathChar(glyph) => HorizontalItem::Box(glyph.clone()),
TextNode::OpenType(run) => HorizontalItem::Box(crate::opentype::horizontal_box(run)),
TextNode::Rule(r) => {
HorizontalItem::Box(r.horizontal_item(self.width, self.height, self.depth))
}
@@ -605,6 +606,11 @@ pub(super) fn hpack(
height = height.max(glyph.height - shift);
depth = depth.max(glyph.depth + shift);
}
TextNode::OpenType(run) => {
width += run.width;
height = height.max(run.font.ascent);
depth = depth.max(run.font.descent);
}
TextNode::Rule(r) => {
let (w, h, d) = r.dimensions();
width += w;