Skip to main content

Module attributed

Module attributed 

Source
Expand description

Attributed text: a node’s text plus range-scoped style runs and links.

This is the payload carried by PARAMETER::SET_ATTRIBUTED_TEXT (see spec/OPCODE.md). The text is UTF-8; run/link ranges are UTF-8 byte offsets (half-open, [start, end)). The payload is arena-backed: the opcode references one length-prefixed entry whose bytes are produced by AttributedString::encode.

V1 style attributes are scalar text-format properties only: FONT_SIZE, FONT_WEIGHT, COLOR, FONT_STYLE, FONT_DESIGN, UNDERLINE, STRIKETHROUGH. Unknown properties/types are ignored on decode so a newer producer never breaks an older renderer.

Structs§

AttributedSegment
A non-overlapping slice of an AttributedString with its effective attributes and link. Produced by AttributedString::segments.
AttributedString
Text with optional style runs and links.
LinkRun
A range of the text that is a hyperlink.
StyleRun
A range of the text with a set of scalar attributes.
TextAttribute
A single scalar text-format attribute on a range.

Enums§

AttributedError
An error raised while building, encoding, or decoding attributed text.

Functions§

is_supported
Whether an attribute is in the v1 run vocabulary.