[][src]Struct druid::text::FontDescriptor

pub struct FontDescriptor {
    pub family: FontFamily,
    pub size: f64,
    pub weight: FontWeight,
    pub style: FontStyle,
}

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[src]

pub const fn new(family: FontFamily) -> Self[src]

Create a new descriptor with the provided FontFamily.

pub const fn with_size(self, size: f64) -> Self[src]

Buider-style method to set the descriptor's font size.

pub const fn with_weight(self, weight: FontWeight) -> Self[src]

Buider-style method to set the descriptor's FontWeight.

pub const fn with_style(self, style: FontStyle) -> Self[src]

Buider-style method to set the descriptor's FontStyle.

Trait Implementations

impl Clone for FontDescriptor[src]

impl Data for FontDescriptor[src]

impl Debug for FontDescriptor[src]

impl Default for FontDescriptor[src]

impl Into<Value> for FontDescriptor[src]

impl PartialEq<FontDescriptor> for FontDescriptor[src]

impl StructuralPartialEq for FontDescriptor[src]

impl ValueType for FontDescriptor[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AnyEq for T where
    T: PartialEq<T> + Any
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> RoundFrom<T> for T

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.