diff --git a/components/gfx/font_cache_thread.rs b/components/gfx/font_cache_thread.rs index 9a88cce953b..56db1a2fff0 100644 --- a/components/gfx/font_cache_thread.rs +++ b/components/gfx/font_cache_thread.rs @@ -268,10 +268,17 @@ impl FontCache { Source::Local(ref font) => { let font_face_name = LowercaseString::new(font.name()); let templates = &mut self.web_families.get_mut(&family_name).unwrap(); + let mut found = false; for_each_variation(&font_face_name, |path| { + found = true; templates.add_template(Atom::from(&*path), None); }); - sender.send(()).unwrap(); + if found { + sender.send(()).unwrap(); + } else { + let msg = Command::AddWebFont(family_name, sources, sender); + self.channel_to_self.send(msg).unwrap(); + } } } }