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 THIN: FontWeight
pub const THIN: FontWeight
Weight 100.
Sourcepub const EXTRA_LIGHT: FontWeight
pub const EXTRA_LIGHT: FontWeight
Weight 200.
Sourcepub const LIGHT: FontWeight
pub const LIGHT: FontWeight
Weight 300.
Sourcepub const NORMAL: FontWeight
pub const NORMAL: FontWeight
Weight 400.
Sourcepub const MEDIUM: FontWeight
pub const MEDIUM: FontWeight
Weight 500.
Sourcepub const SEMI_BOLD: FontWeight
pub const SEMI_BOLD: FontWeight
Weight 600.
Sourcepub const BOLD: FontWeight
pub const BOLD: FontWeight
Weight 700.
Sourcepub const EXTRA_BOLD: FontWeight
pub const EXTRA_BOLD: FontWeight
Weight 800.
Sourcepub const BLACK: FontWeight
pub const BLACK: FontWeight
Weight 900.
Sourcepub const W100: FontWeight
pub const W100: FontWeight
Weight 100, the same as FontWeight::THIN.
Sourcepub const W200: FontWeight
pub const W200: FontWeight
Weight 200, the same as FontWeight::EXTRA_LIGHT.
Sourcepub const W300: FontWeight
pub const W300: FontWeight
Weight 300, the same as FontWeight::LIGHT.
Sourcepub const W400: FontWeight
pub const W400: FontWeight
Weight 400, the same as FontWeight::NORMAL.
Sourcepub const W500: FontWeight
pub const W500: FontWeight
Weight 500, the same as FontWeight::MEDIUM.
Sourcepub const W600: FontWeight
pub const W600: FontWeight
Weight 600, the same as FontWeight::SEMI_BOLD.
Sourcepub const W700: FontWeight
pub const W700: FontWeight
Weight 700, the same as FontWeight::BOLD.
Sourcepub const W800: FontWeight
pub const W800: FontWeight
Weight 800, the same as FontWeight::EXTRA_BOLD.
Sourcepub const W900: FontWeight
pub const W900: FontWeight
Weight 900, the same as FontWeight::BLACK.
Sourcepub const fn new(weight: u16) -> FontWeight
pub const fn new(weight: u16) -> FontWeight
Creates a weight, clamping weight into the range 1 to 1000.
Sourcepub const fn try_new(weight: u16) -> Option<FontWeight>
pub const fn try_new(weight: u16) -> Option<FontWeight>
Creates a weight, or returns None when weight is outside the range 1 to 1000.
Sourcepub const fn clamped(weight: u16) -> FontWeight
pub const fn clamped(weight: u16) -> FontWeight
Creates a weight, clamping weight into the range 1 to 1000.
Trait Implementations§
Source§impl Clone for FontWeight
impl Clone for FontWeight
Source§fn clone(&self) -> FontWeight
fn clone(&self) -> FontWeight
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for FontWeight
Source§impl Debug for FontWeight
impl Debug for FontWeight
Source§impl Default for FontWeight
impl Default for FontWeight
Source§fn default() -> FontWeight
fn default() -> FontWeight
impl Eq for FontWeight
Source§impl Hash for FontWeight
impl Hash for FontWeight
Source§impl Ord for FontWeight
impl Ord for FontWeight
Source§fn cmp(&self, other: &FontWeight) -> Ordering
fn cmp(&self, other: &FontWeight) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more