views:

54

answers:

2

I am rendering html in a Flex 3.x UITextField. The problem I am facing now is that when punctuation is at the end of a word, it can sometimes be wrapped to the next line.

For example:

That which doesn't kill me makes me stronger
,so I became a developer.

This seems like a bug in the algorithm to me. Is there a workaround?

A: 

I've been trying to reproduce your problem, but in my case, the text in the field just gets cut off when I resize my window, it doesn't wrap.

In any case, have you tried a \n new line character with the text to force the line break to occur where you want it to, or does your text need to flow with the window size?

Wade
A: 

@Wade This component isn't really designed to be resized, though it does wrap on resize. Did you set the wordwrap to true?

@Armagosh I can't know where the line breaks will occur ahead of time. It depends on screen resolution and the Flex algorithm for wordwrapping. I am also not clear if this will help. If I put two spaces after the comma, would that prevent the comma from being after the line break?

It renders any one of a number of different xhtml items, some of which will wind up having the ',' be at exactly the end of the line in some resolutions. The same problem happens with hyphens.

Addendum: So essentially, yes, I need the wrapping to flow with window size.

Harry