use fission::prelude::*;
let run = RichTextRun {
text: "Important".into(),
style: TextRunStyle {
font_size: Some(16.0),
color: Some(view.env.theme.tokens.colors.primary),
underline: false,
font_family: None,
locale: None,
font_weight: Some(700),
font_style: TextFontStyle::Normal,
line_height: None,
letter_spacing: None,
text_scale: None,
background_color: None,
},
semantics_label: None,
semantics_identifier: None,
spell_out: None,
};
Field | Type | Meaning | Notes / default behavior |
|---|---|---|---|
font_size | Option<f32> | Font size in layout points. | Falls back to theme body size when absent. |
color | Option<IrColor> | Text color override. | Falls back to the theme's primary text color when absent. |
underline | bool | Whether the run is underlined. | Defaults to false. |
font_family | Option<String> | Font family override. | Defaults to None. |
locale | Option<String> | Locale override used during shaping. | Defaults to None. |
font_weight | Option<u16> | Font weight override. | Falls back to 400 when absent. |
font_style | TextFontStyle | Normal or italic posture. | Defaults to Normal. |
line_height | Option<f32> | Explicit line height. | Defaults to None. |
letter_spacing | Option<f32> | Additional letter spacing. | Defaults to None. |
text_scale | Option<f32> | Scale multiplier for the run. | Defaults to None, which behaves like 1.0. |
background_color | Option<IrColor> | Background color behind the run. | Defaults to None. |