1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 23:21:08 +03:00

fixup title font selection on linux

Was mistakenly trying to use the windows font because of negative logic.
Tidy up, and prefer the gnome default theme font (Cantarell), but fall
back to DejaVu Sans.
This commit is contained in:
Wez Furlong 2021-10-09 08:12:26 -07:00
parent 23a0d67589
commit 7e59916c5c

View File

@ -277,10 +277,15 @@ fn default_title_font_size() -> f64 {
}
fn default_title_font() -> TextStyle {
TextStyle {
foreground: None,
font: vec![FontAttributes {
family: if cfg!(target_os = "macos") {
fn bold(family: &str) -> FontAttributes {
FontAttributes {
family: family.to_string(),
weight: FontWeight::BOLD,
..Default::default()
}
}
let mut fonts = vec![if cfg!(target_os = "macos") {
// "SF Pro" or one of the San Francisco font variants
// are the official fonts for the macOS UI, but those
// are not directly accessible to non-Apple applications,
@ -288,16 +293,20 @@ fn default_title_font() -> TextStyle {
// Wikipedia says that `Galvji` looks very similar,
// but has slightly different spacing.
// It's close enough for me!
"Galvji"
} else if !cfg!(windows) {
"Segoe UI"
bold("Galvji")
} else if cfg!(windows) {
bold("Segoe UI")
} else {
"DejaVu Sans"
bold("Cantarell")
}];
if !cfg!(windows) && !cfg!(target_os = "macos") {
fonts.push(bold("DejaVu Sans"));
}
.to_string(),
weight: FontWeight::BOLD,
..Default::default()
}],
TextStyle {
foreground: None,
font: fonts,
}
}