pub struct TextStyle {Show 14 fields
pub type_role: TypeRole,
pub font: FontRefs,
pub font_features: Vec<FontFeature>,
pub font_size: Option<f32>,
pub font_weight: Option<u16>,
pub italic: bool,
pub letter_spacing: Option<f32>,
pub line_height: Option<f32>,
pub max_lines: Option<u32>,
pub wrap: bool,
pub tab_size: u8,
pub word_break: Option<WordBreak>,
pub overflow_wrap: Option<OverflowWrap>,
pub absolute_size: bool,
}Expand description
How a run of text is set, as the Renderer reads it.
The same fields a Text carries, meaning the same things: the Renderer resolves both
with one function, so text measured with a style is the size the same text drawn with
the same properties turns out to be.
Fields§
§type_role: TypeRole§font: FontRefsThe fonts to try, for text with no role. Ignored where there is a role.
font_features: Vec<FontFeature>OpenType font features, such as tabular numbers.
font_size: Option<f32>None takes the role’s size, or 14 for text with no role.
font_weight: Option<u16>None takes the role’s weight, or 400 for text with no role.
italic: bool§letter_spacing: Option<f32>None takes the role’s spacing, or none for text with no role.
line_height: Option<f32>None is the font’s own line height.
max_lines: Option<u32>None is no limit.
wrap: boolWhether lines break at the width given. false is CSS nowrap and pre.
tab_size: u8How many spaces’ width apart the tab stops are.
word_break: Option<WordBreak>§overflow_wrap: Option<OverflowWrap>§absolute_size: boolSizes are CSS pixels: the system’s font scale does not enlarge them.