I found that using pixelSize avoided this problem...

the text sometimes jumps in size and can, under specific circumstances, still exceed the rectangle length