feat: shape and antialias Tessera text with system fonts
Verify Tessera GUI / verify (push) Successful in 13m28s

This commit is contained in:
2026-10-20 14:25:28 +08:00
parent 1f64de48b9
commit f0fae1792f
19 changed files with 661 additions and 95 deletions
+6 -12
View File
@@ -378,7 +378,7 @@ mod tests {
matches!(&document.frame.commands[0], RenderCommand::Text { value, size: 2, x: 24.0, y: 24.0, .. } if value == "Hello Endor")
);
assert!(
matches!(&document.frame.commands[1], RenderCommand::RoundedRect { x: 24.0, y: 52.0, width: 240.0, height: 80.0, radius: 12.0, color } if color == "#DCE8FF")
matches!(&document.frame.commands[1], RenderCommand::RoundedRect { x: 24.0, y: 76.0, width: 240.0, height: 80.0, radius: 12.0, color } if color == "#DCE8FF")
);
assert_eq!(document.display_list(2.0).unwrap().commands().len(), 3);
let wrapped = compile(include_str!("../examples/main.endor"), "app.main", 10).unwrap();
@@ -553,19 +553,16 @@ paint(ui.text("last"))"#;
&document.frame.commands[1],
RenderCommand::RoundedRect {
x: 24.0,
y: 52.0,
y: 76.0,
width: 240.0,
height: 80.0,
..
}
));
let first_width = crate::text::measure("Aster VM", crate::text::TextStyle::ui(1)).width;
assert!(matches!(
&document.frame.commands[3],
RenderCommand::Text {
x: 120.0,
y: 144.0,
..
}
RenderCommand::Text { x, y: 168.0, .. } if (*x - (24.0 + first_width + 12.0 + 8.0 + 12.0)).abs() < 0.01
));
// Candidate::close already proved zero remaining VM objects. Both
// redraws must still work from native data at different display scales.
@@ -583,13 +580,10 @@ function main(): View { let child = ui.text("shared") return wrap(child) }"#;
&document.frame.commands[0],
RenderCommand::Text { x: 4.0, y: 4.0, .. }
));
let width = crate::text::measure("shared", crate::text::TextStyle::ui(1)).width;
assert!(matches!(
&document.frame.commands[1],
RenderCommand::Text {
x: 60.0,
y: 4.0,
..
}
RenderCommand::Text { x, y: 4.0, .. } if (*x - (4.0 + width + 8.0)).abs() < 0.01
));
}