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>,
}
Expand description
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
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Font
impl UnwindSafe for Font
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
Mutably borrows from an owned value. Read more
Convert into T with values clamped to the color defined bounds Read more
Convert into T. The resulting color might be invalid in its color space Read more
Convert into T, returning ok if the color is inside of its defined
range, otherwise an OutOfBounds
error is returned which contains
the unclamped color. Read more