Expand description
Rich text labels (#413, ggtext’s element_markdown()): a small
Markdown / HTML subset in titles, axis titles, strip and legend text when
Theme::rich_text is on.
Supported: **bold**, *italic* / _italic_, ^super^ / ~sub~,
<b>, <i>, <sup>, <sub>, <span style='color:#rrggbb'> (or a basic CSS
colour name: red, steelblue, …) and \* escapes.
Anything else is literal text.
Structs§
- RichRun
- One run of uniformly styled text.
Functions§
- draw
- Draw
text— as rich runs whenrichis on and it carries markup, else exactly asDrawBackend::draw_text(byte-identical). - has_
markup - Does
textcontain any markupparsewould interpret? - layout_
runs - Lay
runsout left to right (along the text’s angle): each run’s text, start point and style, measuring a run withwidth(text, size, face)— what a backend without native rich text draws withDrawBackend::draw_text. - parse
- Split
textinto styled runs. - plain
- The text with all markup removed (for width estimates and fallbacks).
- run_
size - The font size of a shifted (super / subscript) run.
Type Aliases§
- RunWidth
- Measures a run:
(text, size, face) -> widthin px.