Skip to main content

Module text

Module text 

Source
Expand description

Word wrap for text boxes, the one the checks and the boxes share.

Latin text breaks at spaces. Text without spaces (Japanese) breaks between any two of its characters, except where the usual kinsoku rules forbid it: never before closing punctuation or a small kana, never after an opening bracket. A run of Latin letters or digits inside it is kept whole, and so is text joined by a no-break space (NO_BREAK_SPACE). Chinese keeps the same rules with its own punctuation (, 》 《), and where its quotes, ellipsis and dash are wide (WIDE_PUNCTUATION) a line never ends with “ or starts with ”, and …… and —— are never split.

Constants§

NO_BREAK_SPACE
A space word_wrap never breaks at (U+00A0), drawn as a space: what joins the words of a key’s name filled into a text, so the name is never split across lines.

Functions§

word_wrap
Splits text into lines of at most width cells (a character widths has wide takes two, text_width).