Is there a way to draw text on the android with a set width.

I'm trying to draw text inside a box that is 300px wide. I want to set the text box to 300px and right align it. That way it lines up with the right side of the box.

I would set a default value for it, but the text wont always be the same and as the characters grow it wont be aligned anymore.