LineBreakMeasurer doesn't know "\n" ?
Hello!
I tried the sample code found in LineBreakMeasurer API.
It did work well, except one thing : the "\n" is not recognized.
Is there a way to make it break a line at "\n" ?
Thanks,
Sovann
Hello!
I tried the sample code found in LineBreakMeasurer API.
It did work well, except one thing : the "\n" is not recognized.
Is there a way to make it break a line at "\n" ?
Thanks,
Sovann
Well, I suppose a newline isn't necessarily a line break. Some systems like Windows define aline break to be"\r\n"...
Use the line.separator system property.
There's a linux example here: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6357402 (state==in progress, bug)
> Is there a way to make it break a line at "\n" ?
You're supposed to do that yourself. The purpose of LineBreakMeasurer is to help you wrap the text between newlines (i.e., paragraphs) when it's too long to fit in one line.
Thank you for your replies,
Now that I understand the concept. I have solved this problem.
It is just that the name LineBreakMeasurer is missleading to me.
I thought it would do the line break ! Shame on me :)
Thanks,
Sovann