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

[228 byte] By [Sovann-a] at [2007-11-27 11:53:37]
# 1

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.

CeciNEstPasUnProgrammeura at 2007-7-29 18:51:18 > top of Java-index,Java Essentials,Java Programming...
# 2

There's a linux example here: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6357402 (state==in progress, bug)

pbrockway2a at 2007-7-29 18:51:18 > top of Java-index,Java Essentials,Java Programming...
# 3

> 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.

uncle_alicea at 2007-7-29 18:51:18 > top of Java-index,Java Essentials,Java Programming...
# 4

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

Sovann-a at 2007-7-29 18:51:18 > top of Java-index,Java Essentials,Java Programming...