Skip to content

Commit

Permalink
Add db_mut method to FontSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
geieredgar committed Mar 5, 2023
1 parent 4cfd2d6 commit fa9fee1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/font/system/no_std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 4 additions & 0 deletions src/font/system/redox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,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(&mut self.db, id)
}
Expand Down
5 changes: 5 additions & 0 deletions src/font/system/std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,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)
}
Expand Down

0 comments on commit fa9fee1

Please sign in to comment.