I have a sample paragraph and I am adding chunk values to it like this:
p.add(firstname); p.add(lastname); p.add(phone); p.add(login);
lastname aren't split by a newline. When a phone number contains space characters, I don't want any newline to occur within the phone number.
Replace all the spaces where you don't want a line break with
\u00a0. This way, you don't have to check positions etc. (That would only be possible if you calculate the width of every
For instance, if you do this:
p.add("Valeriane\u0060Valerius 012\u0060345\u006067\u006089 valerianelogin");
String can only be split on two places (unless you use so many non-breaking spaces that you take so much space that the part you don't want to break doesn't even fit a line).