diff options
author | 2023-02-05 18:26:09 +0100 | |
---|---|---|
committer | 2023-02-24 13:36:02 +0100 | |
commit | 32309f0140efb4ea92e3e35e3adc5c740909f196 (patch) | |
tree | 64a388d896c4ae1959b492fb742d3c6eaec10cc6 | |
parent | eb3cd3a321db48a4a4555575f022e9a0ed85063b (diff) | |
download | iced-32309f0140efb4ea92e3e35e3adc5c740909f196.tar.gz iced-32309f0140efb4ea92e3e35e3adc5c740909f196.tar.bz2 iced-32309f0140efb4ea92e3e35e3adc5c740909f196.zip |
Introduce `Weight` enum to `font`
-rw-r--r-- | core/src/font.rs | 16 | ||||
-rw-r--r-- | core/src/lib.rs | 2 | ||||
-rw-r--r-- | native/src/font.rs | 2 |
3 files changed, 18 insertions, 2 deletions
diff --git a/core/src/font.rs b/core/src/font.rs index 1f774a70..b67c08af 100644 --- a/core/src/font.rs +++ b/core/src/font.rs @@ -1,3 +1,4 @@ +//! Load and use fonts. use std::hash::Hash; /// A font. @@ -27,3 +28,18 @@ pub enum Font { /// fixed width. Monospace, } + +/// The weight of some text. +#[allow(missing_docs)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub enum Weight { + Thin, + ExtraLight, + Light, + Normal, + Medium, + Semibold, + Bold, + ExtraBold, + Black, +} diff --git a/core/src/lib.rs b/core/src/lib.rs index d3596b4d..d7314851 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -25,6 +25,7 @@ #![forbid(unsafe_code, rust_2018_idioms)] #![allow(clippy::inherent_to_string, clippy::type_complexity)] pub mod alignment; +pub mod font; pub mod keyboard; pub mod mouse; pub mod time; @@ -32,7 +33,6 @@ pub mod time; mod background; mod color; mod content_fit; -mod font; mod length; mod padding; mod pixels; diff --git a/native/src/font.rs b/native/src/font.rs index 6840a25f..15359694 100644 --- a/native/src/font.rs +++ b/native/src/font.rs @@ -1,5 +1,5 @@ //! Load and use fonts. -pub use iced_core::Font; +pub use iced_core::font::*; use crate::command::{self, Command}; use std::borrow::Cow; |