Embed and paint a sans paragraph face

This commit is contained in:
gloamxun committed 2026-10-20 21:37:37 +08:00
1 parent 1633e441de
commit 8468c36daa
5 files changed
+33 -6

No files matched your search

+15
View File
@@ -1939,6 +1939,21 @@ mod tests {
assert!(text.trim_end().ends_with("%%EOF"));
}
#[test]
fn sans_paragraph_paints_with_the_sans_face() {
let unit = Unit::paragraph_with_face(1, "sans face", ParagraphFont::Sans);
let page = Page {
items: unit.items,
insertions: Vec::new(),
marks: Vec::new(),
floats: Vec::new(),
sources: Vec::new(),
hash: 0,
};
let svg = page.display_list().to_svg();
assert!(svg.contains("font-family=\"sans-serif\""));
}
#[test]
fn mono_paragraph_paints_with_a_mono_face() {
let unit = Unit::paragraph_with_face(1, "code 123", ParagraphFont::Mono);