TextScope

class TextScope

Mutable receiver passed to the text("...") { ... } configuration block.

Every property starts at the value of the inherited TextStyle from the enclosing scope; assigning to a property overrides it for this text only. The block returns a resolved TextStyle via build.

Two convenience flags — bold and italic — are provided for the common case; underneath they delegate to fontWeight and fontStyle.

Properties

Link copied to clipboard

Horizontal alignment of wrapped lines within the paragraph box.

Link copied to clipboard

Convenience flag that toggles between FontWeight.Bold and FontWeight.Normal. Reading this returns true when fontWeight is exactly FontWeight.Bold.

Link copied to clipboard

Glyph color. Default: inherited.

Link copied to clipboard

Base paragraph direction; Auto detects RTL scripts from content.

Link copied to clipboard

Resolvable font; defaults to the platform sans-serif unless overridden in a parent scope.

Link copied to clipboard

Font size in scale-independent pixels. Default: inherited from the parent scope.

Link copied to clipboard

Italic vs normal. Default: inherited.

Link copied to clipboard

Weight on the 100..900 axis. Default: inherited.

Link copied to clipboard

Automatic hyphenation dictionary; null disables it (the default). See com.conamobile.pdfkmp.layout.Hyphenators for bundled languages.

Link copied to clipboard

Convenience flag that toggles between FontStyle.Italic and FontStyle.Normal.

Link copied to clipboard

Kashida (tatweel) justification for cursive RTL text. Only effective when the line is justified and resolves to right-to-left. false by default.

Link copied to clipboard

Extra horizontal space inserted between glyphs. Default: inherited.

Link copied to clipboard

Distance between baselines of consecutive lines. 0.sp means use the font's natural value.

Link copied to clipboard

Maximum number of wrapped lines; null keeps them all. Lines beyond the limit are dropped according to overflow.

Link copied to clipboard

Widow control under the Slice strategy: minimum lines continuing on the next page after a break. 1 allows any split.

Link copied to clipboard

Orphan control under the Slice strategy: minimum lines kept together at the bottom of a page before a break. 1 allows any split.

Link copied to clipboard

What to do with lines dropped by maxLines.

Link copied to clipboard

Superscript / subscript positioning. Only meaningful on spans inside richText { } — plain paragraphs ignore it.

Link copied to clipboard

Whether the text is struck through. Defaults to inherited.

Link copied to clipboard

Whether the text is underlined. Defaults to inherited.