mirror of
https://github.com/servo/servo.git
synced 2025-06-21 23:59:00 +01:00
Merge pull request #1341 from deokjinkim/layout_font_optimize
Use last resort font when only there is no font in font group.
This commit is contained in:
commit
24e21bcc28
1 changed files with 15 additions and 13 deletions
|
@ -154,23 +154,25 @@ impl<'self> FontContext {
|
|||
}
|
||||
}
|
||||
|
||||
let last_resort = FontList::get_last_resort_font_families();
|
||||
if fonts.len() == 0 {
|
||||
let last_resort = FontList::get_last_resort_font_families();
|
||||
|
||||
for family in last_resort.iter() {
|
||||
let result = match self.font_list {
|
||||
Some(ref fl) => fl.find_font_in_family(*family, style),
|
||||
None => None,
|
||||
};
|
||||
for family in last_resort.iter() {
|
||||
let result = match self.font_list {
|
||||
Some(ref fl) => fl.find_font_in_family(*family, style),
|
||||
None => None,
|
||||
};
|
||||
|
||||
for font_entry in result.iter() {
|
||||
let font_id =
|
||||
SelectorPlatformIdentifier(font_entry.handle.face_identifier());
|
||||
let font_desc = FontDescriptor::new((*style).clone(), font_id);
|
||||
for font_entry in result.iter() {
|
||||
let font_id =
|
||||
SelectorPlatformIdentifier(font_entry.handle.face_identifier());
|
||||
let font_desc = FontDescriptor::new((*style).clone(), font_id);
|
||||
|
||||
let instance = self.get_font_by_descriptor(&font_desc);
|
||||
let instance = self.get_font_by_descriptor(&font_desc);
|
||||
|
||||
for font in instance.iter() {
|
||||
fonts.push(*font);
|
||||
for font in instance.iter() {
|
||||
fonts.push(*font);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue