gpui/text_system/
font_fallbacks.rs1use std::sync::Arc;
2
3#[cfg(feature = "schemars")]
4use schemars::JsonSchema;
5use serde::{Deserialize, Serialize};
6
7#[derive(Default, Clone, Eq, PartialEq, Hash, Debug, Deserialize, Serialize)]
10#[cfg_attr(feature = "schemars", derive(JsonSchema))]
11pub struct FontFallbacks(pub Arc<Vec<String>>);
12
13impl FontFallbacks {
14 pub fn fallback_list(&self) -> &[String] {
16 self.0.as_slice()
17 }
18
19 pub fn from_fonts(fonts: Vec<String>) -> Self {
21 FontFallbacks(Arc::new(fonts))
22 }
23}