Incular logoIncular
API ReferenceText & Media

TextDecoration

Underline, overline, and strikethrough flags with styles.

Bitflags over u8 — combine with BitOr, intersect with BitAnd, test with contains. The runnable program below combines two flags.

BitOr / BitAnd combine and intersect.

FlagBitEffect
NONE0No decoration
UNDERLINE1Line below text
OVERLINE2Line above text
LINE_THROUGH4Strikethrough
use incular::prelude::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let app = Application::new(|_cx| {
        Container::builder()
            .padding(EdgeInsets::all(24.0))
            .alignment(Alignment::CENTER)
            .child(
                Text::new("Underlined and struck").style(
                    TextStyle::new()
                        .decoration(TextDecoration::combine(&[
                            TextDecoration::UNDERLINE,
                            TextDecoration::LINE_THROUGH,
                        ]))
                        .decoration_style(TextDecorationStyle::Wavy)
                        .decoration_thickness(1.0),
                ),
            )
            .build()
            .into()
    })?;
    incular::run(app)?;
    Ok(())
}

IconData font icons (IconData::new(code_point) with family, font_package, match_text_direction, variations) render through the text pipeline — see Icon.

Related: TextStyle, Fonts.