diff options
author | Christian Duerr <chrisduerr@users.noreply.github.com> | 2019-01-20 17:39:15 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-20 17:39:15 +0000 |
commit | 31271c726e31f90729b5d23dac597edf68cc437a (patch) | |
tree | b66e97fa10532597e2b60ebe4d44682b6b1a9a1a /font | |
parent | 5096426f9e15a21bf78b23160f7c95a9ea2bd7f5 (diff) | |
download | alacritty-31271c726e31f90729b5d23dac597edf68cc437a.tar.gz alacritty-31271c726e31f90729b5d23dac597edf68cc437a.zip |
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.
Diffstat (limited to 'font')
-rw-r--r-- | font/src/rusttype/mod.rs | 8 |
1 files changed, 7 insertions, 1 deletions
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, |