TextStyle

Struct TextStyle 

Source
pub struct TextStyle;

Implementations§

Source§

impl TextStyle

Source

pub fn new() -> Self

Source

pub fn to_placeholder(&self) -> Self

👎Deprecated since 0.51.0: Use clone_for_placeholder
Source

pub fn clone_for_placeholder(&self) -> Self

Source

pub fn equals(&self, _other: &TextStyle) -> bool

Source

pub fn equals_by_fonts(&self, _that: &TextStyle) -> bool

Source

pub fn color(&self) -> Color

Source

pub fn set_color(&mut self, _color: impl Into<Color>) -> &mut Self

Source

pub fn foreground(&self) -> Paint

Source

pub fn set_foreground_color(&mut self, _paint: &Paint) -> &mut Self

Source

pub fn clear_foreground_color(&mut self) -> &mut Self

Source

pub fn background(&self) -> Paint

Source

pub fn set_background_color(&mut self, _paint: &Paint) -> &mut Self

Source

pub fn clear_background_color(&mut self) -> &mut Self

Source

pub fn decoration(&self) -> &Decoration

Source

pub fn set_decoration(&mut self, decoration: &Decoration)

Source

pub fn set_decoration_type(&mut self, decoration: TextDecoration)

Source

pub fn set_decoration_mode(&mut self, mode: TextDecorationMode)

Source

pub fn set_decoration_style(&mut self, style: TextDecorationStyle)

Source

pub fn set_decoration_color(&mut self, color: impl Into<Color>)

Source

pub fn font_style(&self) -> FontStyle

Source

pub fn set_font_style(&mut self, _font_style: FontStyle) -> &mut Self

Source

pub fn shadows(&self) -> &[TextShadow]

Source

pub fn add_shadow(&mut self, _shadow: TextShadow) -> &mut Self

Source

pub fn reset_shadows(&mut self) -> &mut Self

Source

pub fn font_features(&self) -> &[FontFeature]

Source

pub fn add_font_feature(&mut self, _font_feature: impl AsRef<str>, _value: i32)

Source

pub fn reset_font_features(&mut self)

Source

pub fn font_size(&self) -> f32

Source

pub fn set_font_size(&mut self, _size: f32) -> &mut Self

Source

pub fn font_families(&self) -> FontFamilies

Source

pub fn set_font_families(&mut self, _families: &[impl AsRef<str>]) -> &mut Self

Source

pub fn baseline_shift(&self) -> f32

Source

pub fn set_baseline_shift(&mut self, _baseline_shift: f32) -> &mut Self

Source

pub fn set_height(&mut self, _height: f32) -> &mut Self

Source

pub fn height(&self) -> f32

Source

pub fn set_height_override(&mut self, _height_override: bool) -> &mut Self

Source

pub fn height_override(&self) -> bool

Source

pub fn set_half_leading(&mut self, _half_leading: bool) -> &mut Self

Source

pub fn half_leading(&self) -> bool

Source

pub fn set_letter_spacing(&mut self, _letter_spacing: f32) -> &mut Self

Source

pub fn letter_spacing(&self) -> f32

Source

pub fn set_word_spacing(&mut self, _word_spacing: f32) -> &mut Self

Source

pub fn word_spacing(&self) -> f32

Source

pub fn typeface(&self) -> Option<Typeface>

Source

pub fn set_typeface( &mut self, _typeface: impl Into<Option<Typeface>>, ) -> &mut Self

Source

pub fn locale(&self) -> &str

Source

pub fn set_locale(&mut self, _locale: impl AsRef<str>) -> &mut Self

Source

pub fn text_baseline(&self) -> TextBaseline

Source

pub fn set_text_baseline(&mut self, _baseline: TextBaseline) -> &mut Self

Source

pub fn font_metrics(&self) -> FontMetrics

Source

pub fn is_placeholder(&self) -> bool

Source

pub fn set_placeholder(&mut self) -> &mut Self

Source

pub fn set_height_behavior(&mut self, behavior: TextHeightBehavior)

Trait Implementations§

Source§

impl Default for TextStyle

Source§

fn default() -> TextStyle

Returns the “default value” for a type. Read more

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.