gpui: Fix TextStyle default font_family crash on Windows, use Segoe UI
for Windows (#14040)
Release Notes: - Fixed default font_family crash on Windows, use `Segoe UI`. ## Crash error message ``` thread 'main' panicked at crates\gpui\src\text_system.rs:150:9: failed to resolve font 'Helvetica' or any of the fallbacks: Zed Plex Mono, Helvetica, Cantarell, Ubuntu, Noto Sans, DejaVu Sans ```
This commit is contained in:
parent
1887a6db53
commit
15662f105e
2 changed files with 3 additions and 0 deletions
|
@ -212,6 +212,8 @@ impl Default for TextStyle {
|
||||||
// todo(linux) make this configurable or choose better default
|
// todo(linux) make this configurable or choose better default
|
||||||
font_family: if cfg!(target_os = "linux") {
|
font_family: if cfg!(target_os = "linux") {
|
||||||
"FreeMono".into()
|
"FreeMono".into()
|
||||||
|
} else if cfg!(target_os = "windows") {
|
||||||
|
"Segoe UI".into()
|
||||||
} else {
|
} else {
|
||||||
"Helvetica".into()
|
"Helvetica".into()
|
||||||
},
|
},
|
||||||
|
|
|
@ -66,6 +66,7 @@ impl TextSystem {
|
||||||
// We should allow GPUI users to provide their own fallback font stack.
|
// We should allow GPUI users to provide their own fallback font stack.
|
||||||
font("Zed Plex Mono"),
|
font("Zed Plex Mono"),
|
||||||
font("Helvetica"),
|
font("Helvetica"),
|
||||||
|
font("Segoe UI"), // Windows
|
||||||
font("Cantarell"), // Gnome
|
font("Cantarell"), // Gnome
|
||||||
font("Ubuntu"), // Gnome (Ubuntu)
|
font("Ubuntu"), // Gnome (Ubuntu)
|
||||||
font("Noto Sans"), // KDE
|
font("Noto Sans"), // KDE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue