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
How one span of text looks (skparagraph’s TextStyle, the subset valo implements).
Families are tried in order per character (then the collection’s fallback
chain); weight/italic pick within a family’s variants.
Fields§
§families: Vec<String>§weight: u16CSS weight, 100–900.
italic: bool§stretch: f32CSS font-width (legacy font-stretch) percentage; 100 is normal.
Selects among a family’s registered widths — valo never synthesizes
one, and neither do browsers.
kerning: boolLet the font kern (kern). Canvas2D’s fontKerning: "none" clears it.
variant_caps: VariantCapsOpenType capital-letter forms — Canvas2D’s fontVariantCaps.
size: f32§color: Color§letter_spacing: f32Added after every grapheme cluster (px).
word_spacing: f32Added after every U+0020 cluster (px), on top of letter_spacing.
height: Option<f32>Line-height multiplier: Some(1.5) = 1.5 × size, metrics scaled
proportionally (skparagraph’s setHeight + heightOverride). None =
the font’s own metrics.
decoration: Option<Decoration>§shadows: Vec<Shadow>Painted back-to-front UNDER the text, each a blurred offset copy — Flutter’s TextStyle.shadows lowering.