From 3450987355be7fe029db112474d06613929b54c7 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 9 Sep 2023 11:21:32 +0200 Subject: Invalidate existing paragraphs when new fonts are loaded --- tiny_skia/src/text.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'tiny_skia/src/text.rs') diff --git a/tiny_skia/src/text.rs b/tiny_skia/src/text.rs index 2bf35e76..820e7bd8 100644 --- a/tiny_skia/src/text.rs +++ b/tiny_skia/src/text.rs @@ -9,7 +9,6 @@ use rustc_hash::{FxHashMap, FxHashSet}; use std::borrow::Cow; use std::cell::RefCell; use std::collections::hash_map; -use std::sync::Arc; #[allow(missing_debug_implementations)] pub struct Pipeline { @@ -32,9 +31,7 @@ impl Pipeline { } pub fn load_font(&mut self, bytes: Cow<'static, [u8]>) { - self.font_system.get_mut().db_mut().load_font_source( - cosmic_text::fontdb::Source::Binary(Arc::new(bytes.into_owned())), - ); + self.font_system.load_font(bytes); self.cache = RefCell::new(Cache::new()); } -- cgit