Struct css_style::text::Text [−][src]
pub struct Text {}Show fields
pub color: Option<Color>, pub direction: Option<Direction>, pub letter_spacing: Option<LetterSpacing>, pub word_spacing: Option<WordSpacing>, pub line_height: Option<LineHeight>, pub align: Option<TextAlign>, pub align_last: Option<TextAlignLast>, pub justify: Option<TextJustify>, pub shadow: Option<TextShadow>, pub indent: Option<TextIndent>, pub decoration: Option<TextDecoration>, pub white_space: Option<WhiteSpace>, pub unicode_bidi: Option<UnicodeBidi>, pub transform: Option<TextTransform>, pub overflow: Option<TextOverflow>, pub vertical_align: Option<VerticalAlign>, pub writing_mode: Option<WritingMode>, pub word_wrap: Option<WordWrap>, pub word_break: Option<WordBreak>,
use css_style::{Style, Color, unit::{em, px}, text::{TextAlign, TextTransform}}; use palette::rgb::Rgb; Style::default() .and_text(|conf| { conf.line_height(1.7) // we can pass Rgb, Rgba, Hsl, Hsla .color(Rgb::new(0.5, 0.1, 0.1)) // or we can use HTML colors .color(Color::BlueViolet) .align(TextAlign::Center) .transform(TextTransform::Capitalize) .indent(em(2.)) // for single text shadow .and_shadow(|conf| { conf.x(px(3)) .y(px(4)) .color(Color::Blue) .blur(px(2)) }) // for multiple text shadows .and_shadow(|conf| { conf.push(|conf| conf.x(px(2))).y(px(-4)) .push(|conf| conf.x(px(9))) }) });
Fields
color: Option<Color>
direction: Option<Direction>
letter_spacing: Option<LetterSpacing>
word_spacing: Option<WordSpacing>
line_height: Option<LineHeight>
align: Option<TextAlign>
align_last: Option<TextAlignLast>
justify: Option<TextJustify>
shadow: Option<TextShadow>
indent: Option<TextIndent>
decoration: Option<TextDecoration>
white_space: Option<WhiteSpace>
unicode_bidi: Option<UnicodeBidi>
transform: Option<TextTransform>
overflow: Option<TextOverflow>
vertical_align: Option<VerticalAlign>
writing_mode: Option<WritingMode>
word_wrap: Option<WordWrap>
word_break: Option<WordBreak>
Implementations
impl Text
[src]
pub fn color(self, value: impl Into<Color>) -> Self
[src]
pub fn try_color(self, value: Option<impl Into<Color>>) -> Self
[src]
pub fn direction(self, value: impl Into<Direction>) -> Self
[src]
pub fn try_direction(self, value: Option<impl Into<Direction>>) -> Self
[src]
pub fn letter_spacing(self, value: impl Into<LetterSpacing>) -> Self
[src]
pub fn try_letter_spacing(self, value: Option<impl Into<LetterSpacing>>) -> Self
[src]
pub fn word_spacing(self, value: impl Into<WordSpacing>) -> Self
[src]
pub fn try_word_spacing(self, value: Option<impl Into<WordSpacing>>) -> Self
[src]
pub fn line_height(self, value: impl Into<LineHeight>) -> Self
[src]
pub fn try_line_height(self, value: Option<impl Into<LineHeight>>) -> Self
[src]
pub fn align(self, value: impl Into<TextAlign>) -> Self
[src]
pub fn try_align(self, value: Option<impl Into<TextAlign>>) -> Self
[src]
pub fn align_last(self, value: impl Into<TextAlignLast>) -> Self
[src]
pub fn try_align_last(self, value: Option<impl Into<TextAlignLast>>) -> Self
[src]
pub fn justify(self, value: impl Into<TextJustify>) -> Self
[src]
pub fn try_justify(self, value: Option<impl Into<TextJustify>>) -> Self
[src]
pub fn shadow(self, value: impl Into<TextShadow>) -> Self
[src]
pub fn try_shadow(self, value: Option<impl Into<TextShadow>>) -> Self
[src]
pub fn and_shadow(
self,
set_value: impl FnOnce(TextShadow) -> TextShadow
) -> Self where
TextShadow: Default,
[src]
self,
set_value: impl FnOnce(TextShadow) -> TextShadow
) -> Self where
TextShadow: Default,
pub fn indent(self, value: impl Into<TextIndent>) -> Self
[src]
pub fn try_indent(self, value: Option<impl Into<TextIndent>>) -> Self
[src]
pub fn decoration(self, value: impl Into<TextDecoration>) -> Self
[src]
pub fn try_decoration(self, value: Option<impl Into<TextDecoration>>) -> Self
[src]
pub fn and_decoration(
self,
set_value: impl FnOnce(TextDecoration) -> TextDecoration
) -> Self where
TextDecoration: Default,
[src]
self,
set_value: impl FnOnce(TextDecoration) -> TextDecoration
) -> Self where
TextDecoration: Default,
pub fn white_space(self, value: impl Into<WhiteSpace>) -> Self
[src]
pub fn try_white_space(self, value: Option<impl Into<WhiteSpace>>) -> Self
[src]
pub fn unicode_bidi(self, value: impl Into<UnicodeBidi>) -> Self
[src]
pub fn try_unicode_bidi(self, value: Option<impl Into<UnicodeBidi>>) -> Self
[src]
pub fn transform(self, value: impl Into<TextTransform>) -> Self
[src]
pub fn try_transform(self, value: Option<impl Into<TextTransform>>) -> Self
[src]
pub fn overflow(self, value: impl Into<TextOverflow>) -> Self
[src]
pub fn try_overflow(self, value: Option<impl Into<TextOverflow>>) -> Self
[src]
pub fn vertical_align(self, value: impl Into<VerticalAlign>) -> Self
[src]
pub fn try_vertical_align(self, value: Option<impl Into<VerticalAlign>>) -> Self
[src]
pub fn writing_mode(self, value: impl Into<WritingMode>) -> Self
[src]
pub fn try_writing_mode(self, value: Option<impl Into<WritingMode>>) -> Self
[src]
pub fn word_wrap(self, value: impl Into<WordWrap>) -> Self
[src]
pub fn try_word_wrap(self, value: Option<impl Into<WordWrap>>) -> Self
[src]
pub fn word_break(self, value: impl Into<WordBreak>) -> Self
[src]
pub fn try_word_break(self, value: Option<impl Into<WordBreak>>) -> Self
[src]
Trait Implementations
impl Clone for Text
[src]
impl Debug for Text
[src]
impl Default for Text
[src]
impl<T: Into<Color>> From<T> for Text
[src]
impl PartialEq<Text> for Text
[src]
impl StructuralPartialEq for Text
[src]
impl StyleUpdater for Text
[src]
fn update_style(self, style: Style) -> Style
[src]
Auto Trait Implementations
impl RefUnwindSafe for Text
impl Send for Text
impl Sync for Text
impl Unpin for Text
impl UnwindSafe for Text
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>,