mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-28 21:04:47 +00:00
femtovg: increase font cache size
Otherwise, the cache is trashed with already moderate text size causing TextEdit to become quickly very slow (unusable) when the text becomes a bit big. Big text are horribly still slow but at least now it can be used without freezing the app for minutes
This commit is contained in:
parent
ff89a38062
commit
d5a4ec87e0
1 changed files with 6 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
// cspell:ignore Noto fontconfig
|
||||
|
||||
use core::num::NonZeroUsize;
|
||||
use femtovg::TextContext;
|
||||
use i_slint_core::graphics::euclid;
|
||||
use i_slint_core::graphics::FontRequest;
|
||||
|
@ -249,10 +250,14 @@ impl Default for FontCache {
|
|||
})
|
||||
.collect();
|
||||
|
||||
let text_context = TextContext::default();
|
||||
text_context.resize_shaped_words_cache(NonZeroUsize::new(10_000_000).unwrap());
|
||||
text_context.resize_shaping_run_cache(NonZeroUsize::new(1_000_000).unwrap());
|
||||
|
||||
Self {
|
||||
loaded_fonts: HashMap::new(),
|
||||
loaded_font_coverage: HashMap::new(),
|
||||
text_context: Default::default(),
|
||||
text_context,
|
||||
available_fonts: font_db,
|
||||
available_families,
|
||||
#[cfg(all(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue