summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-03-30 02:01:20 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-03-30 02:01:20 +0200
commit0b459c8e240abf83bb62902a504c018194acdbb6 (patch)
tree0b53bd1beae76465d6a5b5659a46b059d1dd14c3 /core
parent707de9d788dc3c49d4ac57a19afac1bb938b78d9 (diff)
downloadiced-0b459c8e240abf83bb62902a504c018194acdbb6.tar.gz
iced-0b459c8e240abf83bb62902a504c018194acdbb6.tar.bz2
iced-0b459c8e240abf83bb62902a504c018194acdbb6.zip
Introduce `font::Stretch`
Diffstat (limited to 'core')
-rw-r--r--core/src/font.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/core/src/font.rs b/core/src/font.rs
index 920b3dd5..bb425fd6 100644
--- a/core/src/font.rs
+++ b/core/src/font.rs
@@ -8,6 +8,8 @@ pub struct Font {
pub family: Family,
/// The [`Weight`] of the [`Font`].
pub weight: Weight,
+ /// The [`Stretch`] of the [`Font`].
+ pub stretch: Stretch,
/// Whether if the [`Font`] is monospaced or not.
pub monospaced: bool,
}
@@ -17,6 +19,7 @@ impl Font {
pub const DEFAULT: Font = Font {
family: Family::SansSerif,
weight: Weight::Normal,
+ stretch: Stretch::Normal,
monospaced: false,
};
@@ -81,3 +84,19 @@ pub enum Weight {
ExtraBold,
Black,
}
+
+/// The width of some text.
+#[allow(missing_docs)]
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
+pub enum Stretch {
+ UltraCondensed,
+ ExtraCondensed,
+ Condensed,
+ SemiCondensed,
+ #[default]
+ Normal,
+ SemiExpanded,
+ Expanded,
+ ExtraExpanded,
+ UltraExpanded,
+}