Introduce font::Stretch
This commit is contained in:
parent
707de9d788
commit
0b459c8e24
3 changed files with 49 additions and 0 deletions
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue