Remove Mutex from FontSystem

This commit is contained in:
Edgar Geier 2023-03-12 10:30:20 +01:00
parent 46e9ef0246
commit 384c5c1fdc
No known key found for this signature in database
GPG key ID: DE2B55319457EB56
16 changed files with 109 additions and 96 deletions

View file

@ -139,7 +139,10 @@ impl Application for Window {
.family(cosmic_text::Family::Monospace);
let mut editor = SyntaxEditor::new(
Buffer::new(&FONT_SYSTEM.lock().unwrap(), FontSize::Body.to_metrics()),
Buffer::new(
&mut FONT_SYSTEM.lock().unwrap(),
FontSize::Body.to_metrics(),
),
&SYNTAX_SYSTEM,
"base16-eighties.dark",
)

View file

@ -53,7 +53,7 @@ impl Text {
let mut line = BufferLine::new(string, AttrsList::new(Attrs::new()));
//TODO: do we have to immediately shape?
line.shape(&FONT_SYSTEM.lock().unwrap());
line.shape(&mut FONT_SYSTEM.lock().unwrap());
let text = Self {
line,
@ -186,7 +186,7 @@ where
};
cache.with_pixels(
&FONT_SYSTEM.lock().unwrap(),
&mut FONT_SYSTEM.lock().unwrap(),
cache_key,
glyph_color,
|pixel_x, pixel_y, color| {