gfx: Instantiate the CTFont corresponding to a Mac font on demand.

This avoids panics in multiprocess mode.
This commit is contained in:
Patrick Walton 2015-07-27 14:18:50 -07:00
parent 1ff7a51f0a
commit e9ec9289d6
3 changed files with 18 additions and 8 deletions

View file

@ -42,7 +42,7 @@ fn create_scaled_font(template: &Arc<FontTemplateData>, pt_size: Au) -> ScaledFo
#[cfg(target_os="macos")]
fn create_scaled_font(template: &Arc<FontTemplateData>, pt_size: Au) -> ScaledFont {
let cgfont = template.ctfont.as_ref().unwrap().copy_to_CGFont();
let cgfont = template.ctfont().as_ref().unwrap().copy_to_CGFont();
ScaledFont::new(BackendType::Skia, &cgfont, pt_size.to_f32_px())
}