applyFormat

fun <T : Any> RichTextState.applyFormat(key: <Error class: unknown class><T>, value: T)

Applies the given value for a SpanAttributeKey.

If text is selected, the format is applied to the selection. If no text is selected (cursor is collapsed), the format is applied to the next typed characters.


fun <T : Any> RichTextState.applyFormat(key: <Error class: unknown class><T>, value: T)

Applies the given value for a ParagraphAttributeKey.

The format is applied to the paragraph(s) overlapping the current cursor position or selection.