Cache rustybuzz shape plans.
This commit is contained in:
parent
94e6cdefda
commit
73acfb0962
7 changed files with 98 additions and 17 deletions
|
|
@ -6,7 +6,7 @@ use alloc::vec::Vec;
|
|||
use fontdb::Family;
|
||||
use unicode_script::Script;
|
||||
|
||||
use crate::{Font, FontSystem};
|
||||
use crate::{Font, FontSystem, ShapePlanCache};
|
||||
|
||||
use self::platform::*;
|
||||
|
||||
|
|
@ -103,6 +103,10 @@ impl<'a> FontFallbackIter<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn shape_plan_cache(&mut self) -> &mut ShapePlanCache {
|
||||
self.font_system.shape_plan_cache()
|
||||
}
|
||||
|
||||
fn face_contains_family(&self, id: fontdb::ID, family_name: &str) -> bool {
|
||||
if let Some(face) = self.font_system.db().face(id) {
|
||||
face.families.iter().any(|(name, _)| name == family_name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue