From 31271c726e31f90729b5d23dac597edf68cc437a Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sun, 20 Jan 2019 17:39:15 +0000 Subject: Fix crash on Windows (#2021) The rusttype backend did not properly support manually specifying font styles, but instead chose to panic when they are specified. The rusttype implementation now provides a proper implementation for handling `bold`, `italic` and `regular` font styles. This fixes #2020. --- font/src/rusttype/mod.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'font') diff --git a/font/src/rusttype/mod.rs b/font/src/rusttype/mod.rs index add23605..e8e0bd2c 100644 --- a/font/src/rusttype/mod.rs +++ b/font/src/rusttype/mod.rs @@ -61,7 +61,13 @@ impl crate::Rasterize for RustTypeRasterizer { .monospace(); let fp = match desc.style { - Style::Specific(_) => unimplemented!(""), + Style::Specific(ref style) => { + match style.to_lowercase().as_str() { + "italic" => fp.italic(), + "bold" => fp.bold(), + _ => fp, + } + }, Style::Description { slant, weight } => { let fp = match slant { Slant::Normal => fp, -- cgit v1.2.3