Skip to main content
October 5, 2009
Question

Word wrap splitting single word

  • October 5, 2009
  • 1 reply
  • 869 views

When I have a line that doesn't fit a single word, instead of trying again on the next parcel where it might fit, TLF (or maybe text.engine)  splits the single word between multiple lines.  Is there any way to change this behavior?

This topic has been closed for replies.

1 reply

Adobe Employee
October 6, 2009

No, this is automatic behavior in the Player, so there's no way to change it from the application. There's really no good answer for this scenario -- the word doesn't fit, so it has to either force break it, crunch it to fit, or let it exceed the bounds. Would you prefer that it overran the bounds? What is the behavior you're looking for?

- robin

October 6, 2009

I'm doing a major extension on parts of tlf so my use case needs to modify this behavoir a lot. (I also took a couple of scenerios and compacted them into one so this does seem like a small thing instead of many large issues).  But I got what I wanted working by failing layouts where TextLineCreationResult.EMERGENCY is created in the ComposeState.

Adobe Employee
October 14, 2009

One my colleagues who works on the Player reminded me that there *is* an option for controlling this behavior in the Player, so I was wrong about that, I'm sorry. The fitSomething parameter to TextBlock.createTextLine would get you what you want. I think it would get you the side effect that a long word might not fit anywhere, so you see the text in the container (and posssibly also other linked containers) stop short because of a long word you can't see (the one that didn't fit). If the long word is at the start of the container, you'd see the whole container empty. But this could be what you want.

So if you're overriding our code anyway, you could also try changing the way createTextLine is called.

- robin