mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-26 23:22:41 +03:00
Fix fallback font
As this is used if you mis-spell "buffer_font_family", it should be monospace. Also treat "Zed Mono" and "Zed Sans" as valid fonts
This commit is contained in:
parent
9a70a89477
commit
f0ed80cd8e
@ -59,14 +59,22 @@ impl TextSystem {
|
||||
fallback_font_stack: smallvec![
|
||||
// TODO: This is currently Zed-specific.
|
||||
// We should allow GPUI users to provide their own fallback font stack.
|
||||
font("Zed Sans"),
|
||||
font("Zed Mono"),
|
||||
font("Helvetica")
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
pub fn all_font_families(&self) -> Vec<String> {
|
||||
self.platform_text_system.all_font_families()
|
||||
let mut families = self.platform_text_system.all_font_families();
|
||||
families.append(
|
||||
&mut self
|
||||
.fallback_font_stack
|
||||
.iter()
|
||||
.map(|font| font.family.to_string())
|
||||
.collect(),
|
||||
);
|
||||
families
|
||||
}
|
||||
pub fn add_fonts(&self, fonts: &[Arc<Vec<u8>>]) -> Result<()> {
|
||||
self.platform_text_system.add_fonts(fonts)
|
||||
|
Loading…
Reference in New Issue
Block a user