pub struct TextStyle {Show 13 fields
pub font: FontId,
pub size: Px,
pub weight: FontWeight,
pub slant: TextSlant,
pub line_height: Option<Px>,
pub line_height_em: Option<f32>,
pub line_height_policy: TextLineHeightPolicy,
pub letter_spacing_em: Option<f32>,
pub features: Vec<TextFontFeatureSetting>,
pub axes: Vec<TextFontAxisSetting>,
pub vertical_placement: TextVerticalPlacement,
pub leading_distribution: TextLeadingDistribution,
pub strut_style: Option<TextStrutStyle>,
}Fields§
§font: FontId§size: Px§weight: FontWeight§slant: TextSlant§line_height: Option<Px>Optional line height override, in logical px.
line_height_em: Option<f32>Optional line height override, expressed as a multiple of size (CSS-like).
line_height_policy: TextLineHeightPolicyControls whether the line box can expand beyond the style-provided line height.
letter_spacing_em: Option<f32>Optional tracking (letter spacing) override, in EM.
features: Vec<TextFontFeatureSetting>Optional OpenType feature overrides applied to the whole text run.
This is intended for UI authoring ergonomics (e.g. tabular-nums) and editor-grade
surfaces that want a stable default without requiring attributed spans.
axes: Vec<TextFontAxisSetting>Optional variable font axis overrides applied to the whole text run.
Note: wght overlaps with weight. Shaping backends should interpret wght as an
override (mapping it to FontWeight) and exclude it from variation lists.
vertical_placement: TextVerticalPlacementControls how the prepared text is vertically placed inside an allocated bounds height.
This is a mechanism-level knob intended for fixed-height controls. See
TextVerticalPlacement for details.
leading_distribution: TextLeadingDistributionControls how extra leading is distributed above/below the text box when a line height is larger than font extents.
strut_style: Option<TextStrutStyle>Optional paragraph-level strut style used to stabilize line box metrics across fallback runs (especially useful for multiline UI-like surfaces).