Invalidate existing paragraphs when new fonts are loaded
This commit is contained in:
parent
837529bc99
commit
3450987355
6 changed files with 127 additions and 33 deletions
|
|
@ -7,7 +7,6 @@ use crate::layer::Text;
|
|||
|
||||
use std::borrow::Cow;
|
||||
use std::cell::RefCell;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[allow(missing_debug_implementations)]
|
||||
pub struct Pipeline {
|
||||
|
|
@ -47,9 +46,7 @@ impl Pipeline {
|
|||
}
|
||||
|
||||
pub fn load_font(&mut self, bytes: Cow<'static, [u8]>) {
|
||||
let _ = self.font_system.get_mut().db_mut().load_font_source(
|
||||
glyphon::fontdb::Source::Binary(Arc::new(bytes.into_owned())),
|
||||
);
|
||||
self.font_system.load_font(bytes);
|
||||
|
||||
self.cache = RefCell::new(Cache::new());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue