| 1 | use std::sync::Arc; |
| 2 | |
| 3 | use schemars::JsonSchema; |
| 4 | use serde::{Deserialize, Serialize}; |
| 5 | |
| 6 | |
| 7 | |
| 8 | #[derive(Default, Clone, Eq, PartialEq, Hash, Debug, Deserialize, Serialize, JsonSchema)] |
| 9 | pub struct FontFallbacks(pub Arc<Vec<String>>); |
| 10 | |
| 11 | impl FontFallbacks { |
| 12 | |
| 13 | pub fn fallback_list(&self) -> &[String] { |
| 14 | self.0.as_slice() |
| 15 | } |
| 16 | |
| 17 | |
| 18 | pub fn from_fonts(fonts: Vec<String>) -> Self { |
| 19 | FontFallbacks(Arc::new(fonts)) |
| 20 | } |
| 21 | } |