Skip to main content

Module text

Module text 

Source

Structs§

AnnotatedString
Text with multiple styled spans.
AnnotatedStringBuilder
Builder for constructing an AnnotatedString.
BaselineShift
Baseline shift for subscript/superscript. Wraps a multiplier applied against font_size for glyph y-offset.
CodepointTransformation
Internal 1-to-1 codepoint transformation for password obfuscation. Corresponds to Compose’s CodepointTransformation.
DefaultKeyboardActionHandler
A simple KeyboardActionHandler that only executes the default behavior.
DefaultTextFieldDecorator
A TextFieldDecorator that passes through the inner text field unchanged.
FontWeight
Font weight as a numeric value 100-900, matching CSS font-weight.
IdentityOffsetMapping
Identity offset mapping: original and transformed offsets are the same.
IdentityVisualTransformation
A VisualTransformation that displays text as-is (identity). Equivalent to Compose’s VisualTransformation.None.
KeyboardActions
Callbacks for IME action button presses on the soft keyboard. Corresponds to Compose’s legacy KeyboardActions.
KeyboardOptions
Input transformation settings: keyboard type, capitalization, and IME action. Corresponds to Compose’s KeyboardOptions.
PasswordVisualTransformation
A VisualTransformation that masks all characters with a given character. Matches Compose’s PasswordVisualTransformation.
Shadow
Text shadow.
SpanStyle
TextDecoration
Text decoration state.
TextFieldValue
Snapshot of a text field’s editing state including text, selection, and IME composition range. Corresponds to Compose’s TextFieldValue.
TextIndent
First-line and rest-line indent in dp.
TextLayoutResult
Result of text layout computation, provided to the on_text_layout callback. Exposes key information about the rendered text layout.
TextLineInfo
Layout information for a single line of text.
TextRange
A range of text measured in byte offsets, matching Compose’s TextRange.
TextSpan
A span of text with an associated style.
TextStyle
Style configuration for text displayed in a text field. Corresponds to Compose’s TextStyle.
TransformedText
The result of applying a VisualTransformation.

Enums§

DrawStyle
Draw style for text (fill or stroke).
FontStyle
Font style: normal or italic.
FontSynthesis
Font synthesis controls whether the font renderer may synthesize bold, italic, or small-caps variants when the font lacks them.
Hyphens
Hyphenation behavior.
ImeAction
The action button on the IME (soft keyboard).
KeyboardCapitalization
Configures automatic capitalization behavior for the keyboard. Corresponds to Compose’s KeyboardCapitalization.
KeyboardType
Hints the platform about the type of keyboard to show.
LineBreak
Line break behavior.
PathEffect
Path effect applied to a stroked path. Mirrors Compose’s PathEffect.
TextAlign
Horizontal text alignment.
TextFieldLineLimits
Limits on the number of visible lines in a text field. Corresponds to Compose’s TextFieldLineLimits.
TextObfuscationMode
Determines how text is obfuscated in a secure text field. Corresponds to Compose’s TextObfuscationMode.

Traits§

InputTransformation
Transforms user input before it is applied to the text field. Corresponds to Compose’s InputTransformation.
KeyboardActionHandler
Handles IME action button presses. Single-callback interface used by the new BasicTextField(state, ...) API. Corresponds to Compose’s KeyboardActionHandler.
KeyboardActionScope
Scope provided to KeyboardActions callbacks, allowing fallback to the platform’s default IME action behavior. Corresponds to Compose’s KeyboardActionScope.
OffsetMapping
Bidirectional offset mapping between original and transformed text.
OutputTransformation
Transforms text output for display. Corresponds to Compose’s OutputTransformation.
TextFieldBuffer
Mutable text buffer used as the scope for InputTransformation and OutputTransformation. Corresponds to Compose’s TextFieldBuffer.
TextFieldDecorator
Wraps the inner text field with custom decorations. Corresponds to Compose’s TextFieldDecorator.
VisualTransformation
Transforms the visual representation of a text field’s text without changing the underlying value. For example, password masking.

Functions§

build_annotated_string
Convenience function to build an AnnotatedString.
original_offset_to_display
Convert a byte offset in the original text to the corresponding byte offset in the visually-transformed display text.
original_offset_to_display_with_mapping
Convert a byte offset in the original text to the corresponding byte offset in the visually-transformed display text, using the provided OffsetMapping if available.