Struct swash::Attributes[][src]

pub struct Attributes(_);

Primary attributes for font classification: stretch, weight and style.

This struct is created by the attributes method on FontRef.

Implementations

impl Attributes[src]

pub fn new(stretch: Stretch, weight: Weight, style: Style) -> Self[src]

Creates new font attributes from the specified stretch, weight and style.

pub fn from_font<'a>(font: &FontRef<'a>) -> Self[src]

Extracts the attributes from the specified font.

pub fn stretch(&self) -> Stretch[src]

Returns the stretch attribute.

pub fn weight(&self) -> Weight[src]

Returns the weight attribute.

pub fn style(&self) -> Style[src]

Returns the style attribute.

pub fn parts(&self) -> (Stretch, Weight, Style)[src]

Returns a tuple containing all attributes.

pub fn has_variations(&self) -> bool[src]

Returns true if the font has variations corresponding to primary attributes.

pub fn has_stretch_variation(&self) -> bool[src]

Returns true if the font has a variation for the stretch attribute.

pub fn has_weight_variation(&self) -> bool[src]

Returns true if the font has a variation for the weight attribute.

pub fn has_oblique_variation(&self) -> bool[src]

Returns true if the font has a variation for the oblique style attribute.

pub fn has_italic_variation(&self) -> bool[src]

Returns true if the font has a variation for the italic style attribute.

pub fn synthesize(&self, requested: Attributes) -> Synthesis[src]

Returns a synthesis analysis based on the requested attributes with respect to this set of attributes.

Trait Implementations

impl Clone for Attributes[src]

impl Copy for Attributes[src]

impl Debug for Attributes[src]

impl Default for Attributes[src]

impl Display for Attributes[src]

impl Eq for Attributes[src]

impl From<()> for Attributes[src]

impl From<(Stretch, Weight, Style)> for Attributes[src]

impl From<Stretch> for Attributes[src]

impl From<Style> for Attributes[src]

impl From<Weight> for Attributes[src]

impl Hash for Attributes[src]

impl PartialEq<Attributes> for Attributes[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.