This commit is contained in:
Simon Sapin 2017-06-18 13:21:04 +02:00
parent 7af5a7fd54
commit 316cd35767
34 changed files with 261 additions and 264 deletions

View file

@ -47,7 +47,7 @@ fn make_tag(tag_bytes: &[u8]) -> FontTableTag {
unsafe { *(tag_bytes.as_ptr() as *const FontTableTag) }
}
macro_rules! try_lossy(($result:expr) => (try!($result.map_err(|_| (())))));
macro_rules! try_lossy(($result:expr) => ($result.map_err(|_| (()))?));
// Given a set of records, figure out the string indices for the family and face
// names. We want name_id 1 and 2, and we need to use platform_id == 1 and
@ -262,12 +262,12 @@ impl FontHandleMethods for FontHandle {
}
let face = font_file.unwrap().create_face(0, dwrote::DWRITE_FONT_SIMULATIONS_NONE);
let info = try!(FontInfo::new_from_face(&face));
let info = FontInfo::new_from_face(&face)?;
(info, face)
} else {
let font = font_from_atom(&template.identifier);
let face = font.create_font_face();
let info = try!(FontInfo::new_from_font(&font));
let info = FontInfo::new_from_font(&font)?;
(info, face)
};