aboutsummaryrefslogtreecommitdiff
path: root/font/src/rusttype
diff options
context:
space:
mode:
authorChristian Duerr <chrisduerr@users.noreply.github.com>2019-04-03 22:57:54 +0000
committerGitHub <noreply@github.com>2019-04-03 22:57:54 +0000
commite98ea64c748f1cce673c97adbc72e6a9a3c11e5f (patch)
treeaba9d97bc30eb7a78669a557b9d3ffd4a77df789 /font/src/rusttype
parent86ccd0566edf97849079889a80e67669332c37cb (diff)
downloadr-alacritty-e98ea64c748f1cce673c97adbc72e6a9a3c11e5f.tar.gz
r-alacritty-e98ea64c748f1cce673c97adbc72e6a9a3c11e5f.tar.bz2
r-alacritty-e98ea64c748f1cce673c97adbc72e6a9a3c11e5f.zip
Bump dependencies
Diffstat (limited to 'font/src/rusttype')
-rw-r--r--font/src/rusttype/mod.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/font/src/rusttype/mod.rs b/font/src/rusttype/mod.rs
index be39ecc9..fc69d6e9 100644
--- a/font/src/rusttype/mod.rs
+++ b/font/src/rusttype/mod.rs
@@ -27,7 +27,6 @@ impl crate::Rasterize for RustTypeRasterizer {
// 33 '!' is the first displaying character
Codepoint(33),
)
- .ok_or(Error::MissingGlyph)?
.scaled(scale)
.h_metrics();
@@ -78,8 +77,8 @@ impl crate::Rasterize for RustTypeRasterizer {
FontCollection::from_bytes(
system_fonts::get(&fp.build()).ok_or_else(|| Error::MissingFont(desc.clone()))?.0,
)
- .into_font()
- .ok_or(Error::UnsupportedFont)?,
+ .and_then(|fc| fc.into_font())
+ .map_err(|_| Error::UnsupportedFont)?,
);
Ok(FontKey { token: (self.fonts.len() - 1) as u16 })
}
@@ -116,7 +115,6 @@ impl crate::Rasterize for RustTypeRasterizer {
let scaled_glyph = self.fonts[glyph_key.font_key.token as usize]
.glyph(glyph_key.c)
- .ok_or(Error::MissingGlyph)?
.scaled(Scale::uniform(glyph_key.size.as_f32_pts() * self.dpi_ratio * 96. / 72.));
let glyph = scaled_glyph.positioned(point(0.0, 0.0));