Introduce font::Stretch

This commit is contained in:
Héctor Ramón Jiménez 2023-03-30 02:01:20 +02:00
parent 707de9d788
commit 0b459c8e24
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
3 changed files with 49 additions and 0 deletions

View file

@ -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,
}