From 74a4d76bb1c62e3121ec6593c2621bc561d19a05 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Mon, 4 Jul 2016 09:52:36 +0200 Subject: [PATCH] Continue loading font-face sources on missing local font --- components/gfx/font_cache_thread.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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(); + } } } }