use fission::prelude::*;
let title = Text::new(TextContent::Key("settings.profile_title".into()))
.size(20.0)
.weight(700)
.into();
Field | Type | Meaning | Notes / default behavior |
|---|---|---|---|
id | Option<WidgetId> | Stable widget identity. | Defaults to None. |
content | TextContent | The text source to render. | Use Literal(...) for direct strings or Key(...) for translated lookup. |
semantics | Option<Semantics> | Optional wrapper semantics for the text block. | Defaults to None. Builder helpers can also attach labels and actions. |
Field | Type | Meaning | Notes / default behavior |
|---|---|---|---|
font_size | Option<f32> | Font size override. | Falls back to the theme's body size. |
color | Option<IrColor> | Text color override. | Falls back to the theme's primary text color. |
underline | bool | Whether the text is underlined. | Defaults to false. |
font_family | Option<String> | Font family override. | Defaults to None. |
font_weight | Option<u16> | Font weight override. | Defaults 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> | Extra letter spacing. | Defaults to None. |
locale | Option<String> | Locale override used during shaping. | Defaults to None. |
text_scale | Option<f32> | Text scale multiplier. | Defaults to None, which behaves like 1.0. |
Field | Type | Meaning | Notes / default behavior |
|---|---|---|---|
width / height | Option<f32> | Fixed layout size. | Defaults to None. |
min_width / max_width | Option<f32> | Width bounds. | Defaults to None. |
min_height / max_height | Option<f32> | Height bounds. | Defaults to None. |
wrap | bool | Whether text may wrap to multiple lines. | Text::new(...) sets this to true. Raw Default construction does not. |
text_align | IrTextAlign | Paragraph alignment. | Defaults to the intermediate representation (IR) default. |
text_direction | IrTextDirection | Paragraph direction. | Defaults to the IR default. |
text_width_basis | IrTextWidthBasis | Width calculation policy. | Defaults to the IR default. |
max_lines | Option<usize> | Maximum visible line count. | Defaults to None. |
overflow | IrTextOverflow | Overflow handling. | Defaults to visible overflow. |
strut_line_height | Option<f32> | Paragraph strut line height. | Defaults to None. |
text_height_behavior | IrTextHeightBehavior | Height trimming behavior. | Defaults to the IR default. |
selection_range | Option<(usize, usize)> | Highlighted selection range. | Defaults to None. |
selection_color | Option<IrColor> | Selection highlight override. | Defaults to None. |
selection_text_color | Option<IrColor> | Selected text color override. | Defaults to None. |
flex_grow / flex_shrink | f32 | Flex behavior inside parent layout. | Defaults to 0.0. |