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. --- src/config/mod.rs | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/config/mod.rs b/src/config/mod.rs index 836fe483..63c72d34 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -2060,9 +2060,9 @@ impl Default for Font { #[cfg(target_os = "macos")] use_thin_strokes: true, size: default_font_size(), - normal: FontDescription::new_with_style("Regular"), - bold: SecondaryFontDescription::new_with_style("Bold"), - italic: SecondaryFontDescription::new_with_style("Italic"), + normal: Default::default(), + bold: Default::default(), + italic: Default::default(), scale_with_dpi: Default::default(), glyph_offset: Default::default(), offset: Default::default(), @@ -2152,15 +2152,6 @@ impl Default for FontDescription { } } -impl FontDescription { - fn new_with_style(style: &str) -> Self { - Self { - style: Some(style.into()), - ..Default::default() - } - } -} - /// Description of the italic and bold font #[serde(default)] #[derive(Debug, Default, Deserialize, Clone, PartialEq, Eq)] @@ -2180,15 +2171,6 @@ impl SecondaryFontDescription { } } -impl SecondaryFontDescription { - fn new_with_style(style: &str) -> Self { - Self { - style: Some(style.into()), - ..Default::default() - } - } -} - pub struct Monitor { _thread: ::std::thread::JoinHandle<()>, rx: mpsc::Receiver, -- cgit