pub struct TextStyle {Show 13 fields
pub families: Vec<String>,
pub weight: u16,
pub italic: bool,
pub stretch: f32,
pub kerning: bool,
pub variant_caps: VariantCaps,
pub size: f32,
pub color: Color,
pub letter_spacing: f32,
pub word_spacing: f32,
pub height: Option<f32>,
pub decoration: Option<Decoration>,
pub shadows: Vec<Shadow>,
}Expand description
TextStyle controls font selection and painting for a span of text.
Families are tried in order for each character before the collection’s fallback fonts.
Fields§
§families: Vec<String>families lists preferred font families in fallback order.
weight: u16weight selects a CSS font weight, conventionally from 100 to 900.
italic: boolitalic selects an italic face when available.
stretch: f32stretch selects CSS font width as a percentage, where 100 is normal.
Valo selects a registered width and does not synthesize one.
kerning: boolkerning enables the font’s kerning adjustments.
variant_caps: VariantCapsvariant_caps selects OpenType capital-letter forms.
size: f32size is the font size in logical pixels.
color: Colorcolor is the text fill color.
letter_spacing: f32letter_spacing adds logical pixels after each grapheme cluster.
word_spacing: f32word_spacing adds logical pixels after each space, in addition to letter spacing.
height: Option<f32>height overrides line height as a multiple of size.
None uses the font’s metrics.
decoration: Option<Decoration>decoration optionally adds an underline, overline, or strike-through.
shadows: Vec<Shadow>shadows are painted back-to-front beneath the text.