Text::eyebrow("EYEBROW", palette).render(),Text::new("Primary text", palette).render(),Text::new("Secondary text with muted()", palette).muted().render(),Text::new("Semantic ink with ink()", palette).ink(AlertColors::for_tone(AlertTone::Error, palette).accent).render(),Text::new("cargo test -p limn", palette).mono().render(),
Weights1 / 4
Scroll to explore the preview. Use arrow keys or swipe the strip below the preview.
Element::column( [0.0, 1.0, 2.0, 3.5] .into_iter() .enumerate() .map(|(index, radius)| Text::new("The line that has not been sung yet", palette).font_size(20.0).render().soft_focus(format!("typography-soft:{index}"), radius)) .collect(),).gap(8.0)
Unicode fallback
Scroll to explore the preview. Use arrow keys or swipe the strip below the preview.
font_size(px) is for a step the host’s design has between two roles. The role
still chooses the family. Prefer a role.
Ink and family
Text::new("Last run failed", palette).ink(error).render()Text::new("3 files changed", palette).muted().render()Text::new("cargo test -p limn", palette).mono().render()Text::eyebrow("RECENT", palette).render()
muted paints in the palette’s muted color, for secondary copy. ink takes
a color that carries meaning the host owns, such as an error or a warning.
mono uses the monospaced family whatever the role. Text::eyebrow is the
small monospaced muted label set above the group it names.
truncate keeps the text to one line and ends it in an ellipsis when the
width runs out. tooltip(id) shows the whole value in a tooltip, wrapped;
the ID must be unique in the window, and it is ignored without truncate.
fade(width) keeps to one line and fades out over the last width pixels
instead; it takes precedence over truncate. line_height sets the leading
of a wrapped paragraph.
Weights
Text has no weight. For the medium and bold faces, build the element and
choose the family:
Element::text("175.6K of 200K tokens") .font_family(FontFamily::SansBold) .font_size(15.0) .foreground(palette.text)
FontFamily::SansMedium and FontFamily::SansBold are faces the host
provides; a host without one paints Sans.