2 line word wrapping text in paint

in paint, I want to write text that when it gets too long, it wraps to a second line without a carriage return, and when it gets too long on the second line, it ellipses out. i tried this with drawFittedText(), but it seems to be a little wonky.

here is an example, the string is

there are a few issues with this.
first issue is that i have maximumNumberOfLines set to 2, and it always seems to take the last character and move it to a 3rd line.
second issue is that it is ellipsing both lines, and i only want it to ellipse the 2nd line.

any suggestions about how i should fix this, or if there is a better solution?

If you use a TextLayout or GlyphArrangement directly, you have a lot more control over how things get laid-out