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]
fn update_style(self, style: Style) -> Style
[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]
T: Component + Float,
D: AdaptFrom<S, Swp, Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
pub fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
pub fn adapt_into(self) -> D
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> ConvertInto<U> for T where
U: ConvertFrom<T>,
[src]
U: ConvertFrom<T>,
pub fn convert_into(self) -> U
[src]
pub fn convert_unclamped_into(self) -> U
[src]
pub fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,