pub struct TextSpan {Show 13 fields
pub text: String,
pub fill: Option<PropertyValue>,
pub font_weight: Option<PropertyValue>,
pub italic: Option<bool>,
pub underline: Option<bool>,
pub strikethrough: Option<bool>,
pub vertical_align: Option<String>,
pub footnote_ref: Option<String>,
pub data_ref: Option<String>,
pub data_format: Option<DataFormat>,
pub highlight: Option<PropertyValue>,
pub code: Option<bool>,
pub link: Option<String>,
}Expand description
A text content span — a run of text with optional inline style overrides.
This is deliberately named TextSpan to avoid colliding with the source-
location type Span.
Fields§
§text: StringThe literal text content.
fill: Option<PropertyValue>Per-span fill override (usually a token ref).
font_weight: Option<PropertyValue>Per-span font-weight override.
italic: Option<bool>Italic override.
underline: Option<bool>Underline decoration.
strikethrough: Option<bool>Strikethrough decoration.
vertical_align: Option<String>Vertical alignment of the span relative to the run baseline. Some("super")
raises the span (superscript); Some("sub") lowers it (subscript). Both
typeset the span at a reduced font size. None (or any other value) keeps
the span on the baseline at full size. See the scene compile_text
super/subscript handling for the exact scale + baseline-shift factors.
footnote_ref: Option<String>Footnote reference — the id of a page-level FootnoteNode. When
Some(id), the renderer emits the referenced footnote’s auto-number as a
SUPERSCRIPT marker run immediately AFTER this span’s text (reusing the
TextSpan::vertical_align "super" rendering: reduced size + raised
baseline). An id that names no footnote on the same page yields an
advisory footnote.unresolved_ref and no marker. KDL: footnote-ref="fn.1".
data_ref: Option<String>Runtime data-field reference for the span’s TEXT CONTENT. When Some(path),
the scene compiler’s data pre-pass looks path up in the active
DataContext and REPLACES TextSpan::text
with the resolved value (styled by TextSpan::data_format when set). A
missing field emits data.missing_field and leaves the authored text
(the fallback). None keeps the literal text unchanged (byte-identical
to a span without the attribute). KDL: data-ref="revenue.total".
data_format: Option<DataFormat>Optional display format applied to the resolved TextSpan::data_ref
value (currency / percent / number, with optional precision + locale). Only
meaningful when data_ref is Some. None substitutes the raw field
value verbatim. KDL: format="currency" precision=2.
highlight: Option<PropertyValue>Per-span highlight (text background) color; usually a token ref. None =
no highlight (byte-identical to a span without it). When Some, the
renderer emits a filled rect behind the span’s glyphs covering the full
ascent-to-descent band so the text reads like a marker-pen highlight.
KDL: span highlight=(token)"color.mark" "text".
code: Option<bool>Inline code mark: when Some(true), the span is rendered in the bundled
monospace family (“Noto Sans Mono”) with a subtle background rect behind
it (the internal CODE_BG default color). None or Some(false) keeps
the node’s own font family (byte-identical to a span without it).
KDL: span "text" code=#true.
link: Option<String>Hyperlink URL carried on the span. None = no link (byte-identical to a
span without it). When Some(url), the span is rendered with an underline
and the internal LINK_COLOR default color when the span has no explicit
fill; a span that already has a fill keeps its author color. In PDF
output the URL becomes a clickable /Link annotation over the span (when
the text is selectable). KDL: span "text" link="https://example.com".