Continuing my reading on how Papyrix renders text...
There's a method for rendering truncated text which 1st sizes the text to see if it needs truncation, for Arabic/Thai (due to greater text-sizing nuances) iterates over all prefixes (longest 1st) to find the 1st one which fits with the appendeded ellipsis, or binary searches for that location, & returns the truncated text with the added ellipsis.
Then there's a suite of methods for breaking line of text into multiple.
1/?