This package picks (close to) optimal points to break a paragraph into lines.
Based on the paper Bridging the Algorithm Gap: A Linear-time Functional Program for Paragraph Formatting
Format a string using the given options
The output is one string where the lines are broken with newline \n characters.
Format a string using the given options, returning the individual lines
Formatting options
String.lengthusually gives good results, but other options (based on a font, or something creative) can be used as well.