From a99a5dd0fb65dedd3190a54f757939f425eedfe2 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 26 Oct 2022 10:59:00 -0600 Subject: [PATCH] Default libcosmic editor to monospace --- examples/editor-libcosmic/src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/editor-libcosmic/src/main.rs b/examples/editor-libcosmic/src/main.rs index 10de702..9455daa 100644 --- a/examples/editor-libcosmic/src/main.rs +++ b/examples/editor-libcosmic/src/main.rs @@ -108,9 +108,12 @@ impl Application for Window { fn new(_flags: ()) -> (Self, Command) { let font_size_i = 1; // Body + let attrs = cosmic_text::Attrs::new() + .monospaced(true) + .family(cosmic_text::Family::Monospace); let buffer = TextBuffer::new( &FONT_SYSTEM, - cosmic_text::Attrs::new(), + attrs, FONT_SIZES[font_size_i], ); @@ -121,7 +124,7 @@ impl Application for Window { cache: Mutex::new(SwashCache::new()), bold: false, italic: false, - monospaced: false, + monospaced: true, }; if let Some(arg) = env::args().nth(1) { window.open(PathBuf::from(arg));