Skip to main content
Participant
January 1, 2011
Question

Preventing automatic line breaks to happen in specific locations, aka fragile text

  • January 1, 2011
  • 1 reply
  • 386 views

I was wondering is there is any specific way to make TFL insert/not insert line breaks when it is rendering a paragraph.

So far, I have tried this with no success:

1. Inserting spaces/  even so many of them, also while setting the whiteSpaceCollapse property to preserve.

2. putting the fragile text in a seperate span or div.

3. Inserting the fragile text in <nobr> HML tag.

Please note that I am importing text from a HTML, though I am not bound to it, I just found HTML easier to build and then convert as I am no expert in TFL.

BTW, the intendeded fragile text is like (123) and the breaks only take the leading or ending pranthesis off no break in the numbers and I need to keep them together as I am using a special font in which pranthesis make some nice round circle around the text, so one of them going off breaks the thing.

any thoughts?

PS. Can it have something to do with the font?

This topic has been closed for replies.

1 reply

KefayatiAuthor
Participant
January 1, 2011

OK, now this is kinda rediculious since this problem has been killing me for almost a week now, and I just found the answer myself so I'll just put it here for the record and hopefully give others a chance to google it...

It all lies in the breakOpportunity property of the span element, it should be set to BreakOpportunity.NONE and that is it. Of course the fragile text is to be put in a separate span element for best results .

On side thing, I converted my code from importing HTML to adding flow elements programatically and the responsiveness of my interface is improved increadably, so as a side comment, stay away from conversion from HTML if you can. Yes, it is painful to learn TextFlow, especially if you are a web-dev but to me, it seems it would pay back.