Add db_mut method to FontSystem

This commit is contained in:
Edgar Geier 2023-03-12 10:30:39 +01:00
parent 41468c17a2
commit af4378d753
No known key found for this signature in database
GPG key ID: DE2B55319457EB56
2 changed files with 9 additions and 0 deletions

View file

@ -43,6 +43,10 @@ impl FontSystem {
&self.db
}
pub fn db_mut(&mut self) -> &mut fontdb::Database {
&mut self.db
}
pub fn get_font(&self, id: fontdb::ID) -> Option<Arc<Font>> {
get_font(&self.db, id)
}

View file

@ -98,6 +98,11 @@ impl FontSystem {
&self.db
}
pub fn db_mut(&mut self) -> &mut fontdb::Database {
self.font_matches_cache.clear();
&mut self.db
}
pub fn into_locale_and_db(self) -> (String, fontdb::Database) {
(self.locale, self.db)
}