drawTextInRect & getTextSizeForMaxWidth both word break by default so this is probably not a bug.
Also, I do not think the getTextSizeForMaxWidth makes any sense to limit in the Y direction, since this function is useful for shrinking text in the X direction, while growing the Y direction. If you wish the string to truncate on a single line, then just use font:getHeight and set that as the height in your drawTextInRect. Having control over word break behavior would be nice though.
I haven't observed this word break in practice. the word is clipped, but the clipped letters do not wrap to the next line, and even at super narrow sizes like above, it does not continue to wrap to more than the height of 2 lines.
Weird, I think I managed to cause it to wrap earlier.. But now I am not sure how I did it. Pretty sure it was just this:
import 'CoreLibs/graphics'
local gfx <const> = playdate.graphics
local w, h = gfx.getTextSizeForMaxWidth("xxxxxxx", 10)
function playdate.update()
gfx.drawTextInRect("xxxxxxx", 0, 0, w, h)
end
If that is the behavior, I would agree it is a bug.. I just wish I knew how I managed to get this to wrap earlier. it was clear as day down the side of my simulator!