How to know the size of a text when using Canvas.drawText()
You can use public void getTextBounds(String text, int start, int end, Rect bounds)
method of Paint to get a rectangle that encloses all your text. Take a look at getTextBounds.
Hope this helps!