[][src]Struct polyhorn_ui::styles::TextStyle

pub struct TextStyle<S = &'static str> {
    pub color: Inherited<Color>,
    pub font_family: Inherited<FontFamily<S>>,
    pub font_weight: Inherited<FontWeight>,
    pub font_style: Inherited<FontStyle>,
    pub font_size: Inherited<FontSize>,
    pub text_align: Inherited<TextAlign>,
}

Controls the appearance of a Text.

Fields

color: Inherited<Color>

This is the color that will be used to fill the text outlines. If not present, the Text component will inherit the text color of its parent. If the parent does not have a color, the default Color::canvastext() system color will be used. Note that the concrete value of this color is system-dependent and can vary depending on the user's appearance mode (i.e. light vs. dark mode).

font_family: Inherited<FontFamily<S>>

This is the font family that will be used to render the text outlines. If not present, the Text component will inherit its font family from its parent. If the parent does not have a font family, the default FontFamily::Generic(GenericFontFamily::SansSerif) will be used. Note that the concrete value of this font family is system-dependent and can vary depending on the user's preferred fonts.

font_weight: Inherited<FontWeight>

This is the font weight that will be used to render the text outlines. If not present, the Text component will inherit its font weight from its parent. If the parent does not have a font weight, the default FontWeight::Normal (400) will be used.

font_style: Inherited<FontStyle>

This is the font style that will be used to render the text outlines. If not present, the Text component will inherit its font style from its parent. If the parent does not have a font style, the default FontStyle::Normal will be used.

font_size: Inherited<FontSize>

This is the font size that will be used to render the text. If not present, the Text component will inherit its font size from its parent. If the parent does not have a font size, the default FontSize:Medium will be used. Note that the concrete value of this font size is system-dependent and can vary depending on a user's preferred font size.

text_align: Inherited<TextAlign>

Controls the alignment of text when it is rendered to a container that is larger than the rendered text.

Trait Implementations

impl<S: Clone> Clone for TextStyle<S>[src]

impl<S: Copy> Copy for TextStyle<S>[src]

impl<S: Debug> Debug for TextStyle<S>[src]

impl<S: Default> Default for TextStyle<S>[src]

impl<S: PartialEq> PartialEq<TextStyle<S>> for TextStyle<S>[src]

impl<S> StructuralPartialEq for TextStyle<S>[src]

Auto Trait Implementations

impl<S> RefUnwindSafe for TextStyle<S> where
    S: RefUnwindSafe

impl<S> Send for TextStyle<S> where
    S: Send

impl<S> Sync for TextStyle<S> where
    S: Sync

impl<S> Unpin for TextStyle<S> where
    S: Unpin

impl<S> UnwindSafe for TextStyle<S> where
    S: UnwindSafe

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[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.