mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Don't load all font faces sources
We stop at the first one we manage to load.
This commit is contained in:
parent
04b682195d
commit
b97c7a8c4d
4 changed files with 131 additions and 117 deletions
|
@ -358,21 +358,19 @@ fn add_font_face_rules(stylesheet: &Stylesheet,
|
|||
if opts::get().load_webfonts_synchronously {
|
||||
let (sender, receiver) = ipc::channel().unwrap();
|
||||
for font_face in stylesheet.effective_rules(&device).font_face() {
|
||||
for source in font_face.effective_sources() {
|
||||
font_cache_thread.add_web_font(font_face.family.clone(),
|
||||
(*source).clone(),
|
||||
sender.clone());
|
||||
receiver.recv().unwrap();
|
||||
}
|
||||
let effective_sources = font_face.effective_sources();
|
||||
font_cache_thread.add_web_font(font_face.family.clone(),
|
||||
effective_sources,
|
||||
sender.clone());
|
||||
receiver.recv().unwrap();
|
||||
}
|
||||
} else {
|
||||
for font_face in stylesheet.effective_rules(&device).font_face() {
|
||||
for source in font_face.effective_sources() {
|
||||
outstanding_web_fonts_counter.fetch_add(1, Ordering::SeqCst);
|
||||
font_cache_thread.add_web_font(font_face.family.clone(),
|
||||
(*source).clone(),
|
||||
(*font_cache_sender).clone());
|
||||
}
|
||||
let effective_sources = font_face.effective_sources();
|
||||
outstanding_web_fonts_counter.fetch_add(1, Ordering::SeqCst);
|
||||
font_cache_thread.add_web_font(font_face.family.clone(),
|
||||
effective_sources,
|
||||
(*font_cache_sender).clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue