I don't change the origin anywhere.
I followed your advice and drew a red rectangle around the text, and took some screenshots to demonstrate it.
Ignore the white background, it's because I took a screenshot and cut out the relevant part (teal rectangle + black text).
This is right after I've created the rect and text:
![](https://i.imgur.com/ly36unp.png)
The position hasn't been adjusted yet, but you can already see that the rect's right bounds are bigger than the actual font.
This is when I enter the first letter:
![](https://i.imgur.com/PZO0uQY.png)
You can see for some reason the rect stays at its original position even though I've updated it.
This is when I enter another letter:
![](https://i.imgur.com/GxOizD1.png)
The rect finally moves, but its and the text's positions do not match.
This is after entering some more stuff:
![](https://i.imgur.com/b88Epkn.png)
Just like in the picture above, the bounding box is out of place.
I tried using different fonts, but they all have the problem of having weird bounding boxes...
Edit:
When I just change the string but not the text's position, the bounding box is like this:
![](http://i.imgur.com/CRLQ79c.png)
It still has this gap on the right, but besides that it's perfect.