mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Simplify FontContext::create_layout_font.
This commit is contained in:
parent
fe4061e0ec
commit
a732c3ff76
1 changed files with 4 additions and 5 deletions
|
@ -118,12 +118,11 @@ impl FontContext {
|
|||
font_variant::T::normal => pt_size,
|
||||
};
|
||||
|
||||
let handle: Result<FontHandle, _> =
|
||||
FontHandleMethods::new_from_template(&self.platform_handle, template,
|
||||
Some(actual_pt_size));
|
||||
let handle = try!(FontHandle::new_from_template(&self.platform_handle,
|
||||
template,
|
||||
Some(actual_pt_size)));
|
||||
|
||||
handle.map(|handle|
|
||||
Font::new(handle, variant, descriptor, pt_size, actual_pt_size, font_key))
|
||||
Ok(Font::new(handle, variant, descriptor, pt_size, actual_pt_size, font_key))
|
||||
}
|
||||
|
||||
fn expire_font_caches_if_necessary(&mut self) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue