This is a re-write of most of the wrapping code — all because the previous code could not easily be adapted to respect a no-break-at-end-of-run flag. This flag is a little important for bidi and will be much more important once formatting is implemented (e.g. to prevent wrapping after a bold letter in the middle of a word).
The new code is shorter and much cleaner than the old code, and avoids another bug I found in the old code (to do with justified bidi text). I care not to compare performance, but it's likely similar.
Several TODO notes remain here; these are for consideration later (if they aren't acted on, that's also fine).
This is a re-write of most of the wrapping code — all because the previous code could not easily be adapted to respect a no-break-at-end-of-run flag. This flag is a little important for bidi and will be much more important once formatting is implemented (e.g. to prevent wrapping after a bold letter in the middle of a word).
The new code is shorter and much cleaner than the old code, and avoids another bug I found in the old code (to do with justified bidi text). I care not to compare performance, but it's likely similar.
Several TODO notes remain here; these are for consideration later (if they aren't acted on, that's also fine).