Skip to content

Commit

Permalink
Remove unnecessary monospaced flag in Font
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Sep 18, 2023
1 parent 161a971 commit 8eec003
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
4 changes: 0 additions & 4 deletions core/src/font.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ pub struct Font {
pub stretch: Stretch,
/// The [`Style`] of the [`Font`].
pub style: Style,
/// Whether if the [`Font`] is monospaced or not.
pub monospaced: bool,
}

impl Font {
Expand All @@ -23,13 +21,11 @@ impl Font {
weight: Weight::Normal,
stretch: Stretch::Normal,
style: Style::Normal,
monospaced: false,
};

/// A monospaced font with normal [`Weight`].
pub const MONOSPACE: Font = Font {
family: Family::Monospace,
monospaced: true,
..Self::DEFAULT
};

Expand Down
5 changes: 1 addition & 4 deletions examples/editor/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ use std::sync::Arc;
pub fn main() -> iced::Result {
Editor::run(Settings {
fonts: vec![include_bytes!("../fonts/icons.ttf").as_slice().into()],
default_font: Font {
monospaced: true,
..Font::with_name("Hasklug Nerd Font Mono")
},
default_font: Font::with_name("Hasklug Nerd Font Mono"),
..Settings::default()
})
}
Expand Down

0 comments on commit 8eec003

Please sign in to comment.