Expand description
Types for styled strings.
A StyledString is a String with a Style annotation. Accordingly, a
StyledStr is a &str with a Style annotation, and a StyledCow is either
a Cow<'_, str> with a Style annotation.
A Style is a combination of a FontFamily, a font size, a line spacing factor, a
Color and a combination of Effects (bold or italic).
§Example
use genpdf::style;
let style = style::Style::new().bold();
let ss1 = style::StyledStr::new("bold", style);
let ss2 = style::StyledStr::new("red", style::Color::Rgb(255, 0, 0));Structs§
- Style
- A style annotation for a string.
- Styled
Cow - A
Cow<'s, str>with aStyleannotation. - Styled
Str - A
&strwith aStyleannotation. - Styled
String - A
Stringwith aStyleannotation.