Struct druid::FontDescriptor
source · pub struct FontDescriptor {
pub family: FontFamily,
pub size: f64,
pub weight: FontWeight,
pub style: FontStyle,
}
Expand description
A collection of attributes that describe a font.
This is provided as a convenience; library consumers may wish to have a single type that represents a specific font face at a specific size.
Fields§
§family: FontFamily
The font’s FontFamily
.
size: f64
The font’s size.
weight: FontWeight
The font’s FontWeight
.
style: FontStyle
The font’s FontStyle
.
Implementations§
source§impl FontDescriptor
impl FontDescriptor
sourcepub const fn new(family: FontFamily) -> Self
pub const fn new(family: FontFamily) -> Self
Create a new descriptor with the provided FontFamily
.
sourcepub const fn with_size(self, size: f64) -> Self
pub const fn with_size(self, size: f64) -> Self
Buider-style method to set the descriptor’s font size.
sourcepub const fn with_weight(self, weight: FontWeight) -> Self
pub const fn with_weight(self, weight: FontWeight) -> Self
Buider-style method to set the descriptor’s FontWeight
.
sourcepub const fn with_style(self, style: FontStyle) -> Self
pub const fn with_style(self, style: FontStyle) -> Self
Buider-style method to set the descriptor’s FontStyle
.
Trait Implementations§
source§impl Clone for FontDescriptor
impl Clone for FontDescriptor
source§fn clone(&self) -> FontDescriptor
fn clone(&self) -> FontDescriptor
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 FontDescriptor
impl Data for FontDescriptor
source§impl Debug for FontDescriptor
impl Debug for FontDescriptor
source§impl Default for FontDescriptor
impl Default for FontDescriptor
source§impl From<FontDescriptor> for Value
impl From<FontDescriptor> for Value
source§fn from(val: FontDescriptor) -> Value
fn from(val: FontDescriptor) -> Value
Converts to this type from the input type.
source§impl PartialEq<FontDescriptor> for FontDescriptor
impl PartialEq<FontDescriptor> for FontDescriptor
source§fn eq(&self, other: &FontDescriptor) -> bool
fn eq(&self, other: &FontDescriptor) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl ValueType for FontDescriptor
impl ValueType for FontDescriptor
source§fn try_from_value(value: &Value) -> Result<Self, ValueTypeError>
fn try_from_value(value: &Value) -> Result<Self, ValueTypeError>
Attempt to convert the generic
Value
into this type.impl StructuralPartialEq for FontDescriptor
Auto Trait Implementations§
impl RefUnwindSafe for FontDescriptor
impl Send for FontDescriptor
impl Sync for FontDescriptor
impl Unpin for FontDescriptor
impl UnwindSafe for FontDescriptor
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>
§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.