Draw mathcal letters from cmsy10

This commit is contained in:
gloamxun committed 2026-10-24 03:49:55 +08:00
1 parent 66ceabad0e
commit e229809581
7 files changed
+114 -8

No files matched your search

+23
View File
@@ -4189,6 +4189,29 @@ mod tests {
assert_eq!(faces, vec![FontFace::Bold]);
}
#[test]
fn mathcal_paints_with_the_cmsy_face() {
use crate::render::{DisplayItem, FontFace};
let document = Document::new(
1_000_000,
vec![Unit::math(
1,
crate::math::parse_math("\\mathcal{A}"),
&Cmr10Metrics::Math,
)],
);
let engine = Engine::layout(&document);
let list = engine.pages()[0].display_list();
assert!(list.items.iter().any(|item| matches!(
item,
DisplayItem::Text {
text,
font: FontFace::MathSymbol,
..
} if text == "A"
)));
}
#[test]
fn edit_on_second_page_only_rebuilds_second_page() {
let mut document = document();