pub struct FontWeight(pub u16);Expand description
Weight of a font, from 1 (thinnest) to 1000 (heaviest), as in Compose’s FontWeight.
400 is normal and 700 is bold.
Tuple Fields§
§0: u16Implementations§
Source§impl FontWeight
impl FontWeight
Sourcepub const EXTRA_LIGHT: Self
pub const EXTRA_LIGHT: Self
Weight 200.
Sourcepub const EXTRA_BOLD: Self
pub const EXTRA_BOLD: Self
Weight 800.
Sourcepub const W100: Self
pub const W100: Self
Weight 100, the same as FontWeight::THIN.
Sourcepub const W200: Self
pub const W200: Self
Weight 200, the same as FontWeight::EXTRA_LIGHT.
Sourcepub const W300: Self
pub const W300: Self
Weight 300, the same as FontWeight::LIGHT.
Sourcepub const W400: Self
pub const W400: Self
Weight 400, the same as FontWeight::NORMAL.
Sourcepub const W500: Self
pub const W500: Self
Weight 500, the same as FontWeight::MEDIUM.
Sourcepub const W600: Self
pub const W600: Self
Weight 600, the same as FontWeight::SEMI_BOLD.
Sourcepub const W700: Self
pub const W700: Self
Weight 700, the same as FontWeight::BOLD.
Sourcepub const W800: Self
pub const W800: Self
Weight 800, the same as FontWeight::EXTRA_BOLD.
Sourcepub const W900: Self
pub const W900: Self
Weight 900, the same as FontWeight::BLACK.
Sourcepub const fn new(weight: u16) -> Self
pub const fn new(weight: u16) -> Self
Creates a weight, clamping weight into the range 1 to 1000.
Sourcepub const fn try_new(weight: u16) -> Option<Self>
pub const fn try_new(weight: u16) -> Option<Self>
Creates a weight, or returns None when weight is outside the range 1 to 1000.
Trait Implementations§
Source§impl Clone for FontWeight
impl Clone for FontWeight
impl Copy for FontWeight
Source§impl Debug for FontWeight
impl Debug for FontWeight
Source§impl Default for FontWeight
impl Default for FontWeight
impl Eq for FontWeight
Source§impl Hash for FontWeight
impl Hash for FontWeight
Source§impl Ord for FontWeight
impl Ord for FontWeight
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for FontWeight
impl PartialEq for FontWeight
Source§impl PartialOrd for FontWeight
impl PartialOrd for FontWeight
impl StructuralPartialEq for FontWeight
Auto Trait Implementations§
impl Forget for FontWeight
impl Freeze for FontWeight
impl Move for FontWeight
impl RefUnwindSafe for FontWeight
impl Send for FontWeight
impl Sync for FontWeight
impl Unpin for FontWeight
impl UnsafeUnpin for FontWeight
impl UnwindSafe for FontWeight
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more