not disgusting any more, should also patch variants

macos-click-through
exoticus 4 years ago
parent 187ead2e1f
commit 261a27091b

@ -165,7 +165,6 @@ pub fn build_collection_by_font_name(
let mut collection = FontCollection::new();
if let Some(font_name) = font_name {
if let Some(family) = loader.get_or_load(font_name, false) {
let weight = if bold { Weight::BOLD } else { Weight::NORMAL };
let style = if italic { Style::Italic } else { Style::Normal };
let properties = Properties {
@ -174,8 +173,14 @@ pub fn build_collection_by_font_name(
stretch: Stretch::NORMAL,
};
let gui_fonts = &[font_name, SYSTEM_DEFAULT_FONT];
for font_name in gui_fonts {
if let Some(family) = loader.get_or_load(font_name, false) {
if let Some(font) = family.get(properties) {
collection.add_family(FontFamily::new_from_font(font.clone()));
break;
}
}
}
}

Loading…
Cancel
Save