hmmm 🤔

macos-click-through
exoticus 5 years ago
parent 5342a196af
commit 6b26808148

@ -67,16 +67,16 @@ impl ExtendedFontFamily {
None None
} }
}
fn to_family(x: ExtendedFontFamily) -> FontFamily {
let mut y = FontFamily::new();
for font in x.fonts { pub fn to_family(self) -> FontFamily {
y.add_font(font); let mut new_family = FontFamily::new();
for font in self.fonts {
new_family.add_font(font);
}
new_family
} }
y
} }
pub struct FontLoader { pub struct FontLoader {
@ -172,19 +172,19 @@ pub fn build_collection_by_font_name(
} }
if let Some(family) = loader.get_or_load(SYSTEM_SYMBOL_FONT, false) { if let Some(family) = loader.get_or_load(SYSTEM_SYMBOL_FONT, false) {
collection.add_family(to_family(family)); collection.add_family(family.to_family());
} }
if let Some(family) = loader.get_or_load(SYSTEM_EMOJI_FONT, false) { if let Some(family) = loader.get_or_load(SYSTEM_EMOJI_FONT, false) {
collection.add_family(to_family(family)); collection.add_family(family.to_family());
} }
if let Some(family) = loader.get_or_load(EXTRA_SYMBOL_FONT, true) { if let Some(family) = loader.get_or_load(EXTRA_SYMBOL_FONT, true) {
collection.add_family(to_family(family)); collection.add_family(family.to_family());
} }
if let Some(family) = loader.get_or_load(MISSING_GLYPH_FONT, true) { if let Some(family) = loader.get_or_load(MISSING_GLYPH_FONT, true) {
collection.add_family(to_family(family)); collection.add_family(family.to_family());
} }
collection collection

Loading…
Cancel
Save