Skip to main content

Module text_break

Module text_break 

Expand description

Unicode line-break opportunities shared by shaping-adjacent layout code.

RichTextLayout receives UAX #14 behavior from cosmic-text. Components that must build matching row metadata or return individually clamped lines use this module instead of guessing at ASCII spaces.

Enums§

LineBreakKind
Whether a UAX #14 opportunity permits or requires a break.

Functions§

bidi_info
The Unicode Bidirectional Algorithm (UAX #9) run over text with its paragraph direction taken from its first strong character: the embedding level of every byte and the paragraphs, for code that orders a line’s runs itself.
builtin_hyphenation
TeX/Liang hyphenation by the patterns hypher embeds.
discretionary_hyphen_breaks
UTF-8 byte offsets at which TeX/Liang patterns permit a discretionary hyphen for language. The source text is never modified; callers decide whether a chosen line break should paint the hyphen glyph.
grapheme_indices
Extended grapheme clusters (UAX #29) paired with their starting byte offset, so combining marks, emoji modifiers, flags and ZWJ sequences stay whole. Offsets address the original UTF-8 string and each slice is a complete UAX #29 cluster, using the same ICU rules as toolkit selection.
hyphenation_generation
How many times the patterns arrived: never, as they were always there.
line_break_opportunities
Iterate byte offsets where a line may or must end according to Unicode Standard Annex #14. Every offset is a UTF-8 boundary and the final text boundary is always returned as mandatory.
unicode_word_ranges
Return Unicode word-like spans in original UTF-8 byte coordinates. Uses the same ICU segmentation as toolkit word selection and movement.

Type Aliases§

Hyphenate
Calls out with the byte offset in word after each of its syllables but the last, by lang’s patterns.
MakeHyphenation
Hands over the patterns’ Hyphenate, for install_hyphenation.