Paint monospace paragraphs with the embedded mono face

This commit is contained in:
gloamxun committed 2026-10-20 21:35:37 +08:00
1 parent 6dd4f6bf83
commit 1633e441de
4 files changed
+19 -2

No files matched your search

+15
View File
@@ -1939,6 +1939,21 @@ mod tests {
assert!(text.trim_end().ends_with("%%EOF"));
}
#[test]
fn mono_paragraph_paints_with_a_mono_face() {
let unit = Unit::paragraph_with_face(1, "code 123", ParagraphFont::Mono);
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=\"monospace\""));
}
#[test]
fn bold_paragraph_paints_with_a_bold_face() {
let document = Document::new(