Bug 1740258 - Check if we can open the font when we fail to load it. r=gfx-reviewers,bradwerth

This should help us understand what's going in bug 1737810.

Differential Revision: https://phabricator.services.mozilla.com/D130744
This commit is contained in:
Jeff Muizelaar 2021-11-09 17:57:02 +00:00
parent 3c79233da8
commit b58b48555a

View File

@ -367,7 +367,11 @@ impl FontContext {
if let Some(face) = new_ft_face(font_key, self.lib, &file, index) {
self.faces.insert(*font_key, FontFace { file, index, face, mm_var: ptr::null_mut() });
} else {
panic!("adding native font failed: file={}", str);
let file = File::open(str);
match file {
Err(e) => panic!("adding native font failed: file={}, err={:?}", str, e),
Ok(_) => panic!("adding native font failed but opened file={}", str)
}
}
}
}