Package-level declarations

The styled-text document model — StyledDocument, Paragraph, TextRun, CharacterStyle, ParagraphStyle — shared by the reader and writer.

Types

Link copied to clipboard
data class CharacterStyle(val bold: Boolean = false, val italic: Boolean = false, val underline: Boolean = false, val strikethrough: Boolean = false, val superscript: Boolean = false, val subscript: Boolean = false)

The character-level formatting carried by a TextRun. This is the shared vocabulary the reader produces and the writer consumes.

Link copied to clipboard
data class Paragraph(val runs: List<TextRun> = emptyList(), val style: ParagraphStyle = ParagraphStyle())

A paragraph: a sequence of styled runs plus paragraph-level formatting.

Link copied to clipboard
data class ParagraphStyle(val styleRef: Int? = null)

Paragraph-level formatting. styleRef is the \sN stylesheet index, used for heading detection.

Link copied to clipboard
data class StyledDocument(val paragraphs: List<Paragraph> = emptyList())

A styled document: an ordered list of paragraphs.

Link copied to clipboard
data class TextRun(val text: String, val style: CharacterStyle = CharacterStyle.PLAIN)

A contiguous run of text sharing a single CharacterStyle.