commit 7e02c7f745d6c5f3b16b6e09bf7bca50de99f0d6
parent 4fc6e225caacce70042b42fc926429ae96b45736
Author: William Casarin <jb55@jb55.com>
Date: Mon, 20 May 2024 10:49:09 -0700
fonts: always use base fonts for all families
We should always fallback if we can't find a glyph in a particular font
Fixes: https://github.com/damus-io/notedeck/issues/78
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/src/fonts.rs b/src/fonts.rs
@@ -100,24 +100,26 @@ pub fn setup_fonts(ctx: &egui::Context) {
),
);
- let proportional = vec![
- "Onest".to_owned(),
+ let base_fonts = vec![
"DejaVuSans".to_owned(),
"NotoEmoji".to_owned(),
"NotoSansCJK".to_owned(),
];
- families.insert(egui::FontFamily::Proportional, proportional);
+ let mut proportional = vec!["Onest".to_owned()];
+ proportional.extend(base_fonts.clone());
- families.insert(
- egui::FontFamily::Monospace,
- vec!["Inconsolata".to_owned(), "NotoEmoji".to_owned()],
- );
+ let mut medium = vec!["OnestMedium".to_owned()];
+ medium.extend(base_fonts.clone());
+
+ let mut mono = vec!["Inconsolata".to_owned()];
+ mono.extend(base_fonts);
+ families.insert(egui::FontFamily::Proportional, proportional);
+ families.insert(egui::FontFamily::Monospace, mono);
families.insert(
egui::FontFamily::Name(NamedFontFamily::Medium.as_str().into()),
- //egui::FontFamily::Name("bold".into()),
- vec!["OnestMedium".to_owned(), "NotoEmoji".to_owned()],
+ medium,
);
debug!("fonts: {:?}", families);