Early exit if no monospace fonts were found

This also provides a helpful log error message and avoids triggering a
 later panic as reported in #323.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
This commit is contained in:
Mohammad AlSaleh 2024-09-03 01:11:17 +03:00 committed by Jeremy Soller
parent 3eec597ab1
commit 3f10b729dd

View file

@ -1415,6 +1415,13 @@ impl Application for App {
});
font_name_faces_map
};
if font_name_faces_map.is_empty() {
log::error!("at least one monospace font with normal/bold weights and default stretch is required");
log::error!("no monospace fonts to select from, exiting");
process::exit(1);
}
let font_names = font_name_faces_map.keys().cloned().collect();
let mut font_size_names = Vec::new();