pub struct FontWeight(/* private fields */);
Expand description
A font weight, represented as a value in the range 1..=1000.
This is based on the CSS font-weight
property. In general, you should
prefer the constants defined on this type, such as FontWeight::REGULAR
or
FontWeight::BOLD
.
Implementations§
Source§impl FontWeight
impl FontWeight
Sourcepub const THIN: FontWeight
pub const THIN: FontWeight
100
Sourcepub const HAIRLINE: FontWeight = FontWeight::THIN
pub const HAIRLINE: FontWeight = FontWeight::THIN
100
Sourcepub const EXTRA_LIGHT: FontWeight
pub const EXTRA_LIGHT: FontWeight
200
Sourcepub const LIGHT: FontWeight
pub const LIGHT: FontWeight
300
Sourcepub const REGULAR: FontWeight
pub const REGULAR: FontWeight
400
Sourcepub const NORMAL: FontWeight = FontWeight::REGULAR
pub const NORMAL: FontWeight = FontWeight::REGULAR
400
Sourcepub const MEDIUM: FontWeight
pub const MEDIUM: FontWeight
500
Sourcepub const SEMI_BOLD: FontWeight
pub const SEMI_BOLD: FontWeight
600
Sourcepub const BOLD: FontWeight
pub const BOLD: FontWeight
700
Sourcepub const EXTRA_BOLD: FontWeight
pub const EXTRA_BOLD: FontWeight
800
Sourcepub const BLACK: FontWeight
pub const BLACK: FontWeight
900
Sourcepub const HEAVY: FontWeight = FontWeight::BLACK
pub const HEAVY: FontWeight = FontWeight::BLACK
900
Sourcepub const EXTRA_BLACK: FontWeight
pub const EXTRA_BLACK: FontWeight
950
Sourcepub fn new(raw: u16) -> FontWeight
pub fn new(raw: u16) -> FontWeight
Create a new FontWeight
with a custom value.
Values will be clamped to the range 1..=1000.
Trait Implementations§
Source§impl Clone for FontWeight
impl Clone for FontWeight
Source§fn clone(&self) -> FontWeight
fn clone(&self) -> FontWeight
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for FontWeight
impl Debug for FontWeight
Source§impl Default for FontWeight
impl Default for FontWeight
Source§fn default() -> FontWeight
fn default() -> FontWeight
Returns the “default value” for a type. Read more
Source§impl From<FontWeight> for TextAttribute
impl From<FontWeight> for TextAttribute
Source§fn from(src: FontWeight) -> TextAttribute
fn from(src: FontWeight) -> TextAttribute
Converts to this type from the input type.
Source§impl Hash for FontWeight
impl Hash for FontWeight
Source§impl PartialEq for FontWeight
impl PartialEq for FontWeight
impl Copy for FontWeight
impl Eq for FontWeight
impl StructuralPartialEq for FontWeight
Auto Trait Implementations§
impl Freeze for FontWeight
impl RefUnwindSafe for FontWeight
impl Send for FontWeight
impl Sync for FontWeight
impl Unpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
Source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.