Struct css_style::font::Font[][src]

pub struct Font {
    pub family: Option<Family>,
    pub size: Option<Size>,
    pub style: Option<Style>,
    pub variant: Option<Variant>,
    pub weight: Option<Weight>,
}
use css_style::{Style, Color, unit::em};
use palette::rgb::Rgb;

Style::default()
    .and_font(|conf| {
        // set the font size to xx-large
        conf.xx_large()
            // we can set the font size with unit functions too
            .size(em(1.5))
            // set font variant to smal-caps
            .small_caps()
            // set font to be bold
            .bold()
            // we can pick specific weight (e.g. 200)
            .weight_200()
    });

Fields

family: Option<Family>size: Option<Size>style: Option<Style>variant: Option<Variant>weight: Option<Weight>

Implementations

impl Font[src]

pub fn family(self, value: impl Into<Family>) -> Self[src]

pub fn try_family(self, value: Option<impl Into<Family>>) -> Self[src]

pub fn size(self, value: impl Into<Size>) -> Self[src]

pub fn try_size(self, value: Option<impl Into<Size>>) -> Self[src]

pub fn medium(self) -> Self[src]

pub fn xx_small(self) -> Self[src]

pub fn x_small(self) -> Self[src]

pub fn small(self) -> Self[src]

pub fn large(self) -> Self[src]

pub fn x_large(self) -> Self[src]

pub fn xx_large(self) -> Self[src]

pub fn smaller(self) -> Self[src]

pub fn larger(self) -> Self[src]

pub fn style(self, value: impl Into<Style>) -> Self[src]

pub fn try_style(self, value: Option<impl Into<Style>>) -> Self[src]

pub fn normal_style(self) -> Self[src]

pub fn italic(self) -> Self[src]

pub fn oblique(self) -> Self[src]

pub fn variant(self, value: impl Into<Variant>) -> Self[src]

pub fn try_variant(self, value: Option<impl Into<Variant>>) -> Self[src]

pub fn normal_variant(self) -> Self[src]

pub fn small_caps(self) -> Self[src]

pub fn weight(self, value: impl Into<Weight>) -> Self[src]

pub fn try_weight(self, value: Option<impl Into<Weight>>) -> Self[src]

pub fn normal_weight(self) -> Self[src]

pub fn bold(self) -> Self[src]

pub fn bolder(self) -> Self[src]

pub fn lighter(self) -> Self[src]

pub fn weight_100(self) -> Self[src]

pub fn weight_200(self) -> Self[src]

pub fn weight_300(self) -> Self[src]

pub fn weight_400(self) -> Self[src]

pub fn weight_500(self) -> Self[src]

pub fn weight_600(self) -> Self[src]

pub fn weight_700(self) -> Self[src]

pub fn weight_800(self) -> Self[src]

pub fn weight_900(self) -> Self[src]

Trait Implementations

impl Clone for Font[src]

impl Debug for Font[src]

impl Default for Font[src]

impl PartialEq<Font> for Font[src]

impl StructuralPartialEq for Font[src]

impl StyleUpdater for Font[src]

Auto Trait Implementations

impl RefUnwindSafe for Font

impl Send for Font

impl Sync for Font

impl Unpin for Font

impl UnwindSafe for Font

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    T: Component + Float,
    D: AdaptFrom<S, Swp, Dwp, T>,
    Swp: WhitePoint,
    Dwp: WhitePoint
[src]

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, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[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, 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.