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

+4
View File
@@ -18,6 +18,7 @@ pub enum FontFace {
Italic,
BoldItalic,
Mono,
Sans,
}
#[derive(Clone, Debug, PartialEq, Eq)]
@@ -148,6 +149,8 @@ impl DisplayList {
let size = *size as f64 / 65_536.0;
let family = if matches!(font, FontFace::Mono) {
"monospace"
} else if matches!(font, FontFace::Sans) {
"sans-serif"
} else {
"serif"
};
@@ -368,6 +371,7 @@ impl Page {
ParagraphFont::Bold => FontFace::Bold,
ParagraphFont::Italic => FontFace::Italic,
ParagraphFont::Mono => FontFace::Mono,
ParagraphFont::Sans => FontFace::Sans,
};
let lines = paragraph.lines.len().max(1) as i64;
let line_height = (paragraph.height / lines).max(1);