loom & weft
Made for Swift.

Unreleased APIs from PR #2. Not in 0.2.1. Stable 0.2.1 reference.

LOOM Unreleased (PR #2) / TEXT, MARKDOWN, AND EDITING

TextWrapping

Grapheme or word wrapping. TextWrapOptions separately controls leading whitespace, long-word breaking, and tab expansion; explicit source newlines remain significant.

Standard inherited Swift protocol operations such as synthesized equality and OptionSet set operations are not repeated. The public declarations below are extracted from the exact source revision listed in the coverage manifest.

Example

let wrapping: TextWrapping = .word
_ = TextLayout("A longer sentence", width: 12, wrapping: wrapping)
Members on this page

Feature guides and release status

TextWrapping

Enumeration
enum TextWrapping

Conforms to: Swift.Equatable, Swift.Hashable, Swift.Sendable, Swift.SendableMetatype.

How text moves to a new terminal row when it reaches the available cells.

Source · TextLayout.swift:4

grapheme

Case
case grapheme

The grapheme case. Associated values, if any, are shown in the declaration.

Source · TextLayout.swift:5

word

Case
case word

The word case. Associated values, if any, are shown in the declaration.

Source · TextLayout.swift:6

none

Case
case none

Only explicit newlines start rows; paint a viewport over the full lines.

Source · TextLayout.swift:8