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>,
}Expand description
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: Copy> Copy for TextStyle<S>
impl<S> StructuralPartialEq for TextStyle<S>
Auto Trait Implementations§
impl<S> Freeze for TextStyle<S>where
S: Freeze,
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§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
Source§fn convert_into(self) -> U
fn convert_into(self) -> U
Source§fn convert_unclamped_into(self) -> U
fn convert_unclamped_into(self) -> U
Source§fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
OutOfBounds error is returned which contains the unclamped color. Read more