diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/display.rs | 5 | ||||
-rw-r--r-- | src/renderer/mod.rs | 12 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/display.rs b/src/display.rs index 8cf19f47..8e2134ab 100644 --- a/src/display.rs +++ b/src/display.rs @@ -22,7 +22,7 @@ use Rgb; use ansi::Color; use cli; use config::Config; -use font; +use font::{self, Rasterize}; use meter::Meter; use renderer::{GlyphCache, QuadRenderer}; use selection::Selection; @@ -92,7 +92,8 @@ impl Display { println!("device_pixel_ratio: {}", dpr); - let rasterizer = font::Rasterizer::new(dpi.x(), dpi.y(), dpr); + // TODO ERROR HANDLING + let rasterizer = font::Rasterizer::new(dpi.x(), dpi.y(), dpr).unwrap(); // Create renderer let mut renderer = QuadRenderer::new(config, size); diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs index 54db4851..838555b8 100644 --- a/src/renderer/mod.rs +++ b/src/renderer/mod.rs @@ -20,7 +20,7 @@ use std::ptr; use std::sync::mpsc; use cgmath; -use font::{self, Rasterizer, RasterizedGlyph, FontDesc, GlyphKey, FontKey}; +use font::{self, Rasterizer, Rasterize, RasterizedGlyph, FontDesc, GlyphKey, FontKey}; use gl::types::*; use gl; use notify::{Watcher as WatcherApi, RecommendedWatcher as Watcher, op}; @@ -138,7 +138,7 @@ impl GlyphCache { let bold = if bold_desc == regular_desc { regular } else { - rasterizer.load_font(&bold_desc, size).unwrap_or_else(|| regular) + rasterizer.load_font(&bold_desc, size).unwrap_or_else(|_| regular) }; // Load italic font @@ -149,7 +149,7 @@ impl GlyphCache { regular } else { rasterizer.load_font(&italic_desc, size) - .unwrap_or_else(|| regular) + .unwrap_or_else(|_| regular) }; let mut cache = GlyphCache { @@ -181,13 +181,15 @@ impl GlyphCache { } pub fn font_metrics(&self) -> font::Metrics { - self.rasterizer.metrics(self.font_key, self.font_size) + // TODO ERROR HANDLING + self.rasterizer.metrics(self.font_key, self.font_size).unwrap() } fn load_and_cache_glyph<L>(&mut self, glyph_key: GlyphKey, loader: &mut L) where L: LoadGlyph { - let rasterized = self.rasterizer.get_glyph(&glyph_key); + // TODO ERROR HANDLING + let rasterized = self.rasterizer.get_glyph(&glyph_key).unwrap(); let glyph = loader.load_glyph(&rasterized); self.cache.insert(glyph_key, glyph); } |