loftar wrote:Cool, I'll probably apply it as a fix until I will myself to look up the real text measuring APIs. Thanks!
I have to ask, though -- why are you using an Indir<StringBuffer> instead of just a StringBuffer?
Short answer is because I didn't take something into account in the original design of my solution, and rather than going back to fix my hack to be the perfect hack it could be, I just kludged in the easiest container I could find.
Long answer is that I needed to re-start the StringBuffer for every new line and then still have access to it when the wrap method returned so I could make sure the last line was added to the list. I was under the impression I would be able to find some sort of clear method on StringBuffer to remove all the current text in it, but couldn't find one (I looked for clear, empty, remove, delete saw nothing) so I just wrapped it in a container.
I apologize for my incompetence. In my defence, I was drunk at the time!