Skip to main content

ResolvedTextStyle

Struct ResolvedTextStyle 

Source
pub struct ResolvedTextStyle {
Show 17 fields pub color: Color, pub font_size: Points, pub font_weight: u16, pub line_height: Points, pub font_family: Option<FontFamily>, pub italic: bool, pub letter_spacing: Points, pub line_height_multiple: f32, pub decoration: TextDecoration, pub decoration_color: Option<Color>, pub decoration_style: DecorationStyle, pub decoration_thickness: Option<Points>, pub underline_offset: Option<Points>, pub transform: TextTransform, pub font_variant: FontVariant, pub background: Option<TextBackground>, pub hidden: bool,
}
Expand description

Fully resolved character style of a text run.

Fields§

§color: Color

Foreground color.

§font_size: Points

Font size.

§font_weight: u16

Font weight, 100..=900.

§line_height: Points

Line height; zero means the font’s natural line height.

§font_family: Option<FontFamily>

Font family; None is the system font.

§italic: bool

Italic.

§letter_spacing: Points

Extra space between characters.

§line_height_multiple: f32

A line height set as a multiple of the font size (0: none), kept so nested text with another size gets its own line height.

§decoration: TextDecoration

Underline / strikethrough.

§decoration_color: Option<Color>

Color of the decoration lines; None uses color.

§decoration_style: DecorationStyle

How the decoration lines are drawn.

§decoration_thickness: Option<Points>

Thickness of the decoration lines; None is the font’s.

§underline_offset: Option<Points>

Distance of the underline below the baseline; None is the font’s.

§transform: TextTransform

Case transform (applied by the core when building the text).

§font_variant: FontVariant

OpenType features (fontVariant).

§background: Option<TextBackground>

The background of the nested text this run is in (drawing only).

§hidden: bool

Hidden but laid out (visibility: "hidden" on the nested text this run is in, or on one around it): its characters keep their place in the lines, are not drawn (the core makes the run transparent, with no background) and are left out of copies and of what screen readers read (AttributedText::copied_text, AttributedText::visible_text).

Trait Implementations§

Source§

impl Clone for ResolvedTextStyle

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ResolvedTextStyle

Source§

impl Debug for ResolvedTextStyle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ResolvedTextStyle

Source§

fn default() -> Self

React Native defaults.

Source§

impl PartialEq for ResolvedTextStyle

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ResolvedTextStyle

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.