It will split the text with the following algorithm:
It will first split newlines, and process each line separately.
For each line, it will try the following splits, in order. If at any point the line is found to fit, it will stop searching.
Generated using TypeDoc
Takes a line of text, and splits it into multiple lines if it's too wide.
Returns an iterable of lines, each its text for that line, and the width it takes to render.
IMPORTANT: Set the font and other styles on the canvas context before calling this function, as the measurements are based on the current styles.