pub struct Style {
pub bold: bool,
pub italic: bool,
pub underline: bool,
pub strikethrough: bool,
pub role: Role,
pub baseline: Baseline,
pub token: Option<Token>,
pub size: Option<SizeStep>,
pub font: Option<FontFamily>,
pub color: Option<MarkColor>,
}Expand description
Fields§
§bold: bool§italic: bool§underline: bool§strikethrough: bool§role: RoleThe typographic role — Role::Body for ordinary text.
baseline: BaselineWhich line the glyph sits on — Baseline::Normal for ordinary text.
token: Option<Token>What a code glyph is to its language — None for every glyph outside a
highlighted fenced block, which is every glyph there was before syntax
highlighting. Only meaningful beside Role::Code; a frontend that
ignores it draws code in one colour, as every frontend once did.
size: Option<SizeStep>How large this run is set relative to the text around it — the author’s
data-size, and None for the theme’s own size, which is every glyph
there was before the presentation vocabulary.
Read at both levels, the nearer winning: a span’s data-size inside a
block carrying its own applies to the span. A frontend that ignores it
draws one size, as leaf-ratatui does — a cell has one size.
font: Option<FontFamily>The face this run is set in — the author’s data-font, and None for
the theme’s body face. Read at the same two levels size
is.
color: Option<MarkColor>The run’s foreground colour — the author’s data-color on an
attributed span, and None for the theme’s text colour.
The same seven names Role::Mark carries, and deliberately the same
enum: a frontend that has a red for a highlight has a red for text, and
both should be that red. The two never collide, because a mark is a
mark and a span is a span — a data-color on a mark node is the
highlight’s background and reaches a glyph through its role, while this
is what a <span data-color="red"> paints the letters.