Struct piet::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§
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§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<FontWeight> for FontWeight
impl PartialEq<FontWeight> for FontWeight
source§fn eq(&self, other: &FontWeight) -> bool
fn eq(&self, other: &FontWeight) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.