Package-level declarations

The conversion entry points: rtfToAnnotatedString / RtfToAnnotatedString and annotatedStringToRtf / AnnotatedString.toStyledDocument.

Types

Link copied to clipboard

Builds a Compose AnnotatedString from an RTF document. Tracks bold (Command.b), italic (Command.i), underline (Command.ul) and strikethrough (Command.strike) and applies the matching SpanStyle to each body-text run. Body-text filtering matches com.darkrockstudios.libs.rtfparserkmp.converter.RtfToMarkdown: only Command.rtf, Command.pntext and Command.fldrslt destinations contribute text.

Functions

Link copied to clipboard

Convert a Compose AnnotatedString to an RTF document string — the inverse of rtfToAnnotatedString. Newlines split paragraphs; within each paragraph, contiguous characters sharing the same effective formatting become one styled run.

Link copied to clipboard

Parse bytes as RTF and return a Compose AnnotatedString approximation.

Link copied to clipboard

Build a StyledDocument from this AnnotatedString. Each character's effective formatting is the union of every overlapping androidx.compose.ui.text.SpanStyle: a fontWeight of FontWeight.Bold or heavier maps to bold, FontStyle.Italic to italic, and TextDecoration.Underline / TextDecoration.LineThrough to underline / strikethrough. Newlines (\n) separate paragraphs and are not themselves emitted as text.