Skip to main content

Module rows

Module rows 

Source
Expand description

Breaking a shaped paragraph into rows.

The rules are the desktop engine’s (epaint’s), so a run laid out here breaks where the same run breaks on screen: a row ends at the last whitespace that fits, failing that at a dash or a punctuation mark, and failing that anywhere at all β€” a word wider than the wrap is broken per character rather than overrun.

StructsΒ§

Candidates πŸ”’
Where a row could end, best first. The last whitespace is the break a reader expects; the rest are what a word too wide for the wrap falls back through.
Fit πŸ”’
What a paragraph is broken to fit: the width a row may fill, and the height every row stands whether or not a glyph is on it.

EnumsΒ§

Break πŸ”’
What ended a row: the paragraph it closes, or the wrap width it filled.

FunctionsΒ§

is_cjk πŸ”’
A logogram or kana β€” a character that is a word, and so a place a row may end without a space.
may_begin_a_row πŸ”’
https://en.wikipedia.org/wiki/Line_breaking_rules_in_East_Asian_languages
right_of πŸ”’
rows_of πŸ”’
Stack paragraphs β€” each one a shaped run placed on a single endless row β€” into the rows that fit wrap.
shifted πŸ”’
stack πŸ”’
The rows in order, each at its own height below the one before.
width_of πŸ”’