TextStyle

Trait TextStyle 

Source
pub trait TextStyle {
Show 20 methods // Required methods fn font(&self) -> String; fn set_font(&self, val: String); fn size(&self) -> f32; fn set_size(&self, val: f32); fn color(&self) -> i32; fn set_color(&self, val: i32); fn align(&self) -> TextAlign; fn set_align(&self, val: TextAlign); fn spacing_horizontal(&self) -> f32; fn set_spacing_horizontal(&self, val: f32); fn spacing_vertical(&self) -> f32; fn set_spacing_vertical(&self, val: f32); fn is_bold(&self) -> bool; fn set_bold(&self, val: bool); fn is_italic(&self) -> bool; fn set_italic(&self, val: bool); fn thickness(&self) -> f32; fn set_thickness(&self, val: f32); fn to_string(&self) -> String; fn clone(&self) -> Box<dyn TextStyle>;
}
Expand description

The TextStyle should be implemented by objects created by the createTextStyle method of Factory.

Required Methods§

Source

fn font(&self) -> String

The name of the font, as a string.

Source

fn set_font(&self, val: String)

Set the name of the font, as a string.

Source

fn size(&self) -> f32

The point size of text.

Source

fn set_size(&self, val: f32)

Set the point size of text.

Source

fn color(&self) -> i32

The color of the text.

Source

fn set_color(&self, val: i32)

Set the color of the text.

Source

fn align(&self) -> TextAlign

Font horizontal alignment.

Source

fn set_align(&self, val: TextAlign)

Set the font horizontal alignment.

Source

fn spacing_horizontal(&self) -> f32

Space in pixels added between each character.

Source

fn set_spacing_horizontal(&self, val: f32)

Set the space in pixels added between each character.

Source

fn spacing_vertical(&self) -> f32

Space in pixels added between each new line (often called leading).

Source

fn set_spacing_vertical(&self, val: f32)

Set the space in pixels added between each new line (often called leading).

Source

fn is_bold(&self) -> bool

Font weight.

Source

fn set_bold(&self, val: bool)

Set the font weight.

Source

fn is_italic(&self) -> bool

Font emphasis.

Source

fn set_italic(&self, val: bool)

Set the font emphasis.

Source

fn thickness(&self) -> f32

Thickness of the glyph edges of this font. Range: -1…1. Default is 0.

Source

fn set_thickness(&self, val: f32)

Set the thickness of the glyph edges of this font. Range: -1…1. Default is 0.

Source

fn to_string(&self) -> String

String representation of this object.

Return: Representation of this object.

Source

fn clone(&self) -> Box<dyn TextStyle>

Duplicates this TextStyle.

Return: A duplicate.

Implementors§