pub struct TextStyle {Show 21 fields
pub font_size: f32,
pub color: Option<Color>,
pub font_weight: Option<u16>,
pub font_family: Option<&'static str>,
pub font_style: Option<u8>,
pub text_align: TextAlign,
pub letter_spacing: f32,
pub line_height: f32,
pub background: Option<Color>,
pub text_decoration: Option<TextDecoration>,
pub shadow: Option<Shadow>,
pub text_direction: Option<TextDirection>,
pub font_synthesis: FontSynthesis,
pub baseline_shift: BaselineShift,
pub hyphens: Hyphens,
pub line_break: LineBreak,
pub text_indent: Option<TextIndent>,
pub draw_style: DrawStyle,
pub alpha: f32,
pub locale_list: Option<String>,
pub font_feature_settings: Option<String>,
}Expand description
Style configuration for text displayed in a text field.
Corresponds to Compose’s TextStyle.
Fields§
§font_size: f32Font size in dp. 0 = use default (16dp for TextField).
color: Option<Color>Text color. None = use theme default.
font_weight: Option<u16>Font weight. None = NORMAL.
font_family: Option<&'static str>Font family. None = use default.
font_style: Option<u8>Font style. None = Normal.
text_align: TextAlignText alignment. Unspecified = inherit.
letter_spacing: f32Letter spacing in dp. 0 = no extra spacing.
line_height: f32Line height in dp. 0 = default (font_size * 1.2).
background: Option<Color>Text background color. None = transparent.
text_decoration: Option<TextDecoration>Text decoration (underline, strikethrough). None = no decoration.
shadow: Option<Shadow>Text shadow. None = no shadow.
text_direction: Option<TextDirection>Text direction. None = inherit from thread-local default (usually LTR).
font_synthesis: FontSynthesisFont synthesis policy (synthesize missing bold/italic/small-caps).
baseline_shift: BaselineShiftBaseline shift (superscript/subscript).
hyphens: HyphensHyphenation behavior.
line_break: LineBreakLine break behavior.
text_indent: Option<TextIndent>First-line and rest-line indent in dp.
draw_style: DrawStyleDraw style (fill or stroke).
alpha: f32Text opacity (0.0-1.0). 0.0 = use default (fully opaque).
locale_list: Option<String>Locale hint for text shaping. Empty = use default.
font_feature_settings: Option<String>OpenType font feature settings (e.g. “liga”, “kern”).