Support non-static list of fallbacks

This commit is contained in:
tigregalis 2025-03-14 14:27:27 +08:00 committed by Jeremy Soller
parent 9a4d80d116
commit ae0fb9b561
2 changed files with 49 additions and 3 deletions

View file

@ -116,6 +116,9 @@ pub struct FontSystem {
/// List of fallbacks
pub(crate) fallbacks: Box<dyn Fallback>,
/// Scratch buffer for fallback list
pub(crate) scratch_fallbacks: Vec<&'static str>,
}
impl fmt::Debug for FontSystem {
@ -213,6 +216,7 @@ impl FontSystem {
shape_run_cache: crate::ShapeRunCache::default(),
shape_buffer: ShapeBuffer::default(),
fallbacks: Box::new(fallbacks),
scratch_fallbacks: Vec::new(),
}
}