Fix to ensure provided gui font is valid (#842)

Providing a wrong font was causing neovide to retry every time to load an
inexistent font, instead just trying to load once at it's setup should
be enough
macos-click-through
Lucas Miranda 3 years ago committed by GitHub
parent 1f112d1f3e
commit 0c1a7029e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -66,8 +66,16 @@ impl CachingShaper {
pub fn update_font(&mut self, guifont_setting: &str) {
trace!("Updating font: {}", guifont_setting);
self.options = FontOptions::parse(guifont_setting);
self.reset_font_loader();
let options = FontOptions::parse(guifont_setting);
let font_key = FontKey::from(&options);
if let Some(_) = self.font_loader.get_or_load(&font_key) {
trace!("Font updated to: {}", guifont_setting);
self.options = options;
self.reset_font_loader();
} else {
trace!("Font can't be updated to: {}", guifont_setting);
}
}
fn reset_font_loader(&mut self) {

Loading…
Cancel
Save