TextFontStyle

TextFontStyle is the simple font-posture enum used by Text, RichTextRun, and related text styling APIs.

Example

use fission::prelude::*;
let widget: Widget = Text {
    content: "Draft".into(),
    font_style: TextFontStyle::Italic,
    ..Default::default()
}
.into();

Choice table

Choice
Type
Meaning
Notes / default behavior
Normal
TextFontStyle
Regular upright text.
Default.
Italic
TextFontStyle
Italic text.
Use for emphasis or special notation, not for large amounts of body copy.

Specific advice

Prefer semantic emphasis through content and layout first. Italic text is useful, but easy to overuse in user interface where clarity matters more than stylistic flourish.

Production checklist

For TextFontStyle, review the fields that change behavior before treating the widget as finished: Normal, Italic. The goal is to make the product rule visible in state and actions, not hidden inside ad-hoc construction code.
If this widget appears inside an interactive flow, keep the surrounding action binding in the parent component and test that the flow still has one clear reducer path.
Check the semantics tree for the user-facing label or role that makes this widget understandable without relying only on pixels.
Add at least one component or harness test that confirms the visible text, semantic role, action dispatch, and layout constraint that matter for this widget in context.
If a screen starts repeating the same TextFontStyle setup, extract a named component around this widget. That keeps the reference API small while making product code easier to read and safer for generated code to copy.
Text, RichTextRun, TextRunStyle, and RichText.
Fission
A cross-platform, GPU-accelerated user interface framework for Rust. MIT licensed.
Copyright (c) 2026 Fission
Ready to use today. Widget APIs are expected to remain stable; some runtime and shell APIs may change before 1.0.0.
Fission 0.7.0