Skip to main content

TextStyle

Trait TextStyle 

Source
pub trait TextStyle {
Show 18 methods // Required methods fn color(self, c: Color) -> View; fn size(self, size: Sp) -> View; fn max_lines(self, n: usize) -> View; fn single_line(self) -> View; fn overflow_ellipsize(self) -> View; fn overflow_clip(self) -> View; fn overflow_visible(self) -> View; fn font_family(self, family: &'static str) -> View; fn text_align(self, align: TextAlign) -> View; fn font_weight(self, weight: FontWeight) -> View; fn font_style(self, style: FontStyle) -> View; fn text_decoration(self, decoration: TextDecoration) -> View; fn letter_spacing(self, spacing: Sp) -> View; fn line_height(self, height: Sp) -> View; fn url(self, url: impl Into<Arc<str>>) -> View; fn font_variation_settings(self, settings: &str) -> View; fn draw_style(self, style: DrawStyle) -> View; fn fill_and_stroke(self, width: f32) -> View;
}
Expand description

Method styling (text sizes are Sp).

Required Methods§

Source

fn color(self, c: Color) -> View

Source

fn size(self, size: Sp) -> View

Source

fn max_lines(self, n: usize) -> View

Source

fn single_line(self) -> View

Source

fn overflow_ellipsize(self) -> View

Source

fn overflow_clip(self) -> View

Source

fn overflow_visible(self) -> View

Source

fn font_family(self, family: &'static str) -> View

Source

fn text_align(self, align: TextAlign) -> View

Source

fn font_weight(self, weight: FontWeight) -> View

Source

fn font_style(self, style: FontStyle) -> View

Source

fn text_decoration(self, decoration: TextDecoration) -> View

Source

fn letter_spacing(self, spacing: Sp) -> View

Source

fn line_height(self, height: Sp) -> View

Source

fn url(self, url: impl Into<Arc<str>>) -> View

Source

fn font_variation_settings(self, settings: &str) -> View

Source

fn draw_style(self, style: DrawStyle) -> View

Source

fn fill_and_stroke(self, width: f32) -> View

Faux-bold: fill plus a same-color outline (width in em-units, 0.04 is a good start). For fonts without a bold face.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl TextStyle for View

Source§

fn color(self, c: Color) -> View

Source§

fn size(self, size: Sp) -> View

Source§

fn max_lines(self, n: usize) -> View

Source§

fn single_line(self) -> View

Source§

fn overflow_ellipsize(self) -> View

Source§

fn overflow_clip(self) -> View

Source§

fn overflow_visible(self) -> View

Source§

fn font_family(self, family: &'static str) -> View

Source§

fn text_align(self, align: TextAlign) -> View

Source§

fn font_weight(self, weight: FontWeight) -> View

Source§

fn font_style(self, style: FontStyle) -> View

Source§

fn text_decoration(self, decoration: TextDecoration) -> View

Source§

fn letter_spacing(self, spacing: Sp) -> View

Source§

fn line_height(self, height: Sp) -> View

Source§

fn url(self, url: impl Into<Arc<str>>) -> View

Source§

fn font_variation_settings(self, settings: &str) -> View

Source§

fn draw_style(self, style: DrawStyle) -> View

Source§

fn fill_and_stroke(self, width: f32) -> View

Implementors§