Struct druid::piet::FontWeight
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§
§impl FontWeight
impl FontWeight
pub const THIN: FontWeight = FontWeight(100)
pub const THIN: FontWeight = FontWeight(100)
100
pub const HAIRLINE: FontWeight = FontWeight::THIN
pub const HAIRLINE: FontWeight = FontWeight::THIN
100
pub const EXTRA_LIGHT: FontWeight = FontWeight(200)
pub const EXTRA_LIGHT: FontWeight = FontWeight(200)
200
pub const LIGHT: FontWeight = FontWeight(300)
pub const LIGHT: FontWeight = FontWeight(300)
300
pub const REGULAR: FontWeight = FontWeight(400)
pub const REGULAR: FontWeight = FontWeight(400)
400
pub const NORMAL: FontWeight = FontWeight::REGULAR
pub const NORMAL: FontWeight = FontWeight::REGULAR
400
pub const MEDIUM: FontWeight = FontWeight(500)
pub const MEDIUM: FontWeight = FontWeight(500)
500
pub const SEMI_BOLD: FontWeight = FontWeight(600)
pub const SEMI_BOLD: FontWeight = FontWeight(600)
600
pub const BOLD: FontWeight = FontWeight(700)
pub const BOLD: FontWeight = FontWeight(700)
700
pub const EXTRA_BOLD: FontWeight = FontWeight(800)
pub const EXTRA_BOLD: FontWeight = FontWeight(800)
800
pub const BLACK: FontWeight = FontWeight(900)
pub const BLACK: FontWeight = FontWeight(900)
900
pub const HEAVY: FontWeight = FontWeight::BLACK
pub const HEAVY: FontWeight = FontWeight::BLACK
900
pub const EXTRA_BLACK: FontWeight = FontWeight(950)
pub const EXTRA_BLACK: FontWeight = FontWeight(950)
950
pub 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§
§impl Clone for FontWeight
impl Clone for FontWeight
§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 Data for FontWeight
impl Data for FontWeight
§impl Debug for FontWeight
impl Debug for FontWeight
§impl Default for FontWeight
impl Default for FontWeight
§fn default() -> FontWeight
fn default() -> FontWeight
Returns the “default value” for a type. Read more
§impl From<FontWeight> for TextAttribute
impl From<FontWeight> for TextAttribute
§fn from(src: FontWeight) -> TextAttribute
fn from(src: FontWeight) -> TextAttribute
Converts to this type from the input type.
§impl Hash for FontWeight
impl Hash for FontWeight
§impl PartialEq<FontWeight> for FontWeight
impl PartialEq<FontWeight> for FontWeight
§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 ==
.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§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IsDefault for Twhere
T: Default + PartialEq<T> + Copy,
impl<T> IsDefault for Twhere T: Default + PartialEq<T> + Copy,
source§fn is_default(&self) -> bool
fn is_default(&self) -> bool
Checks that type has a default value.
§impl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
§fn round_from(x: T) -> T
fn round_from(x: T) -> T
Performs the conversion.
§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,
§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.