Struct titanium::desktop::gui::libdruid::FontDescriptor
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§
§impl FontDescriptor
impl FontDescriptor
pub const fn new(family: FontFamily) -> FontDescriptor
pub const fn new(family: FontFamily) -> FontDescriptor
Create a new descriptor with the provided FontFamily
.
pub const fn with_size(self, size: f64) -> FontDescriptor
pub const fn with_size(self, size: f64) -> FontDescriptor
Buider-style method to set the descriptor’s font size.
pub const fn with_weight(self, weight: FontWeight) -> FontDescriptor
pub const fn with_weight(self, weight: FontWeight) -> FontDescriptor
Buider-style method to set the descriptor’s FontWeight
.
pub const fn with_style(self, style: FontStyle) -> FontDescriptor
pub const fn with_style(self, style: FontStyle) -> FontDescriptor
Buider-style method to set the descriptor’s FontStyle
.
Trait Implementations§
§impl Clone for FontDescriptor
impl Clone for FontDescriptor
§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 more§impl Data for FontDescriptor
impl Data for FontDescriptor
§fn same(&self, other: &FontDescriptor) -> bool
fn same(&self, other: &FontDescriptor) -> bool
Determine whether two values are the same. Read more
§impl Debug for FontDescriptor
impl Debug for FontDescriptor
§impl Default for FontDescriptor
impl Default for FontDescriptor
§fn default() -> FontDescriptor
fn default() -> FontDescriptor
Returns the “default value” for a type. Read more
§impl From<FontDescriptor> for Value
impl From<FontDescriptor> for Value
§fn from(val: FontDescriptor) -> Value
fn from(val: FontDescriptor) -> Value
Converts to this type from the input type.
§impl PartialEq<FontDescriptor> for FontDescriptor
impl PartialEq<FontDescriptor> for FontDescriptor
§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 ==
.§impl ValueType for FontDescriptor
impl ValueType for FontDescriptor
§fn try_from_value(value: &Value) -> Result<FontDescriptor, ValueTypeError>
fn try_from_value(value: &Value) -> Result<FontDescriptor, 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§
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§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.