Remove Mutex from FontSystem
This commit is contained in:
parent
46e9ef0246
commit
384c5c1fdc
16 changed files with 109 additions and 96 deletions
|
|
@ -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",
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue