Struct piet_common::FontWeight
source · pub struct FontWeight(_);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
sourceimpl FontWeight
impl FontWeight
sourcepub const THIN: FontWeight = FontWeight(100)
pub const THIN: FontWeight = FontWeight(100)
100
sourcepub const HAIRLINE: FontWeight = FontWeight::THIN
pub const HAIRLINE: FontWeight = FontWeight::THIN
100
sourcepub const EXTRA_LIGHT: FontWeight = FontWeight(200)
pub const EXTRA_LIGHT: FontWeight = FontWeight(200)
200
sourcepub const LIGHT: FontWeight = FontWeight(300)
pub const LIGHT: FontWeight = FontWeight(300)
300
sourcepub const REGULAR: FontWeight = FontWeight(400)
pub const REGULAR: FontWeight = FontWeight(400)
400
sourcepub const NORMAL: FontWeight = FontWeight::REGULAR
pub const NORMAL: FontWeight = FontWeight::REGULAR
400
sourcepub const MEDIUM: FontWeight = FontWeight(500)
pub const MEDIUM: FontWeight = FontWeight(500)
500
sourcepub const SEMI_BOLD: FontWeight = FontWeight(600)
pub const SEMI_BOLD: FontWeight = FontWeight(600)
600
sourcepub const BOLD: FontWeight = FontWeight(700)
pub const BOLD: FontWeight = FontWeight(700)
700
sourcepub const EXTRA_BOLD: FontWeight = FontWeight(800)
pub const EXTRA_BOLD: FontWeight = FontWeight(800)
800
sourcepub const BLACK: FontWeight = FontWeight(900)
pub const BLACK: FontWeight = FontWeight(900)
900
sourcepub const HEAVY: FontWeight = FontWeight::BLACK
pub const HEAVY: FontWeight = FontWeight::BLACK
900
sourcepub const EXTRA_BLACK: FontWeight = FontWeight(950)
pub const EXTRA_BLACK: FontWeight = FontWeight(950)
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
sourceimpl Clone for FontWeight
impl Clone for FontWeight
sourcefn clone(&self) -> FontWeight
fn clone(&self) -> FontWeight
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for FontWeight
impl Debug for FontWeight
sourceimpl Default for FontWeight
impl Default for FontWeight
sourcefn default() -> FontWeight
fn default() -> FontWeight
Returns the “default value” for a type. Read more
sourceimpl From<FontWeight> for TextAttribute
impl From<FontWeight> for TextAttribute
sourcefn from(src: FontWeight) -> TextAttribute
fn from(src: FontWeight) -> TextAttribute
Converts to this type from the input type.
sourceimpl Hash for FontWeight
impl Hash for FontWeight
sourceimpl PartialEq<FontWeight> for FontWeight
impl PartialEq<FontWeight> for FontWeight
sourcefn eq(&self, other: &FontWeight) -> bool
fn eq(&self, other: &FontWeight) -> bool
impl Copy for FontWeight
impl Eq for FontWeight
impl StructuralEq for FontWeight
impl StructuralPartialEq for FontWeight
Auto Trait Implementations
impl RefUnwindSafe for FontWeight
impl Send for FontWeight
impl Sync for FontWeight
impl Unpin for FontWeight
impl UnwindSafe for FontWeight
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
sourcefn round_from(x: T) -> T
fn round_from(x: T) -> T
Performs the conversion.
sourceimpl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
sourcefn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.