Bonsai_tui_typographyval text_wrap :
?attrs:Bonsai_term.Attr.t list ->
max_width:int ->
string ->
Bonsai_term.View.ttext_wrap ~max_width string will "word wrap" https://en.wikipedia.org/wiki/Typesetting the text. It will break up your text attempting to do "word wrapping" so that each line fits in max_width so that the output lines fit within max_width.
max_width is treated as Int.max 5 max_width so that the weird unicode characters don't get weirder. e.g. some unicode characters can take up 2 chars though this behavior is not stable across terminal emulators, as some terminal emulators will make some emojis look as wide as 4 chars.
module Text : sig ... endtypeset will "typeset" https://en.wikipedia.org/wiki/Typesetting the text. It will break up your text attempting to do "word wrapping" so that each line fits in max_width so that the output lines fit within max_width.
It is important to note that only the "visual" part of the line will be <= max_width. If a line has trailing whitespace, that whitespace can exceed max_width as long as the "visual" width is <= max_width.
max_width is treated as Int.max 5 max_width so that the weird unicode characters don't get weirder. e.g. some unicode characters can take up 2 chars though this behavior is not stable across terminal emulators, as some terminal emulators will make some emojis look as wide as 4 chars.
typeset_line is line typeset, but will only do a single line.
module For_testing : sig ... end