Skip to content

Commit

Permalink
Clear text caches after a font is loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Jun 21, 2023
1 parent 5bc7cbf commit ef87ff1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tiny_skia/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ impl Pipeline {
self.font_system.get_mut().db_mut().load_font_source(
cosmic_text::fontdb::Source::Binary(Arc::new(bytes.into_owned())),
);

self.cache = RefCell::new(Cache::new());
}

pub fn draw(
Expand Down
2 changes: 2 additions & 0 deletions wgpu/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ impl Pipeline {
let _ = self.font_system.get_mut().db_mut().load_font_source(
glyphon::fontdb::Source::Binary(Arc::new(bytes.into_owned())),
);

self.cache = RefCell::new(Cache::new());
}

pub fn prepare(
Expand Down

0 comments on commit ef87ff1

Please sign in to comment.