I’m drawing text into a Canvas and want to assign a rectangle so that the text breaks and goes to the next line if it reaches the right hand boundary. There’s an “align” property I can set, so clearly the notion of a right side and middle exists but I can’t figure out how to designate what the width of the text box should be.
TIA
EDIT…
I’m getting the sense that I’m going to have to roll my own line break insertion method that utilizes the Paint.breakText method. I’m *really hoping that’s not the case! 🙂
edit2..
So on top of everything else, drawText ignores the \n and draws it as a [] missing char.
I’ve written a workaround that moves the origin point of the text down for each line, but BOY is this ugly!
Paint.getTextBounds returns your string width by
“Return in bounds (allocated by the caller) the smallest rectangle that encloses all of the characters, with an implied origin at (0,0).”
I think most likely you will need to draw the string manually by yourself