skia_safe::textlayout

Type Alias TextStyle

Source
pub type TextStyle = Handle<skia_textlayout_TextStyle>;

Aliased Type§

struct TextStyle(/* private fields */);

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 match_one_attribute( &self, style_type: StyleType, other: &TextStyle, ) -> bool

Source

pub fn color(&self) -> Color

Source

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

Source

pub fn has_foreground(&self) -> bool

Source

pub fn foreground(&self) -> Paint

Source

pub fn set_foreground_paint(&mut self, paint: &Paint) -> &mut Self

Source

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

👎Deprecated since 0.64.0: use set_foreground_paint()
Source

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

Source

pub fn has_background(&self) -> bool

Source

pub fn background(&self) -> Paint

Source

pub fn set_background_paint(&mut self, paint: &Paint) -> &mut Self

Source

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

👎Deprecated since 0.64.0: use set_background_paint()
Source

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

Source

pub fn decoration(&self) -> &Decoration

Source

pub fn decoration_type(&self) -> TextDecoration

Source

pub fn decoration_mode(&self) -> TextDecorationMode

Source

pub fn decoration_color(&self) -> Color

Source

pub fn decoration_style(&self) -> TextDecorationStyle

Source

pub fn decoration_thickness_multiplier(&self) -> scalar

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 set_decoration_thickness_multiplier(&mut self, multiplier: scalar)

Source

pub fn decoration_mut(&mut self) -> &mut Decoration

👎Deprecated since 0.63.1: use set_decoration()
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_arguments(&self) -> Option<&FontArguments>

Source

pub fn set_font_arguments<'fa>( &mut self, arguments: impl Into<Option<&'fa FontArguments<'fa, 'fa>>>, )

The contents of the crate::FontArguments will be copied into the TextStyle.

Source

pub fn font_size(&self) -> scalar

Source

pub fn set_font_size(&mut self, size: scalar) -> &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) -> scalar

Source

pub fn set_baseline_shift(&mut self, baseline_shift: scalar) -> &mut Self

Source

pub fn set_height(&mut self, height: scalar) -> &mut Self

Source

pub fn height(&self) -> scalar

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: scalar) -> &mut Self

Source

pub fn letter_spacing(&self) -> scalar

Source

pub fn set_word_spacing(&mut self, word_spacing: scalar) -> &mut Self

Source

pub fn word_spacing(&self) -> scalar

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

Trait Implementations§

Source§

impl Debug for TextStyle

Source§

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

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

impl Default for TextStyle

Source§

fn default() -> Self

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

impl Send for TextStyle

Source§

impl Sync for TextStyle