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<FontSize>,
pub font: Option<FaceRef>,
pub color: Option<TextColor>,
}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<FontSize>How large this run is set — the author’s data-size as a step or a
point 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<FaceRef>The face this run is set in — the author’s data-font as a generic or
as an id into the map’s FaceTable, and None for the theme’s body
face. Read at the same two levels size is.
color: Option<TextColor>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, over 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. Only this one
opens to a triple, for the reason MarkColor’s note gives.