Forum

Constraining text length

Hello VVVV users!

Does anybody know an easy way to define the maximum width of a text line
with Text(EX9)?

I saw the PAD node, but it only limits the maximum length of a string with the number of letters…

I want that if a string is longer than a certain width (in pixels or else) it should cut away the rest.

Thanks in advance!

Hi Cybear

The key node you should use is WordWrap.

I made a little example

-sunep

ConstrainText.v4p (5.1 kB)

Thank you sunep for your help! :)

But how can I do the same for more lines? How can I know
which line is to keep and which to skip if I have a spread of strings?

I would know how to do that, but another problem with wordwrap is, that it doesn’t cut letters, only words…

So, if I have a very long word which goes outside the pixellength in wordwrap, then it doesn’t cut away!

The dirty way could be, just add extra spaces, do the wordwrap, and remove those extra spaces. But to be honest, that does not result in readable words, vvvv is not a text processor with a dictionary that knows where to cut words.

But yes, I would like to have an extra pin for the wordwrap node to cut on the letter, or on the word.

ConstrainText2.v4p (14.8 kB)

line break by letters without dummy characters:

ConstrainText3.v4p (13.3 kB)

Thank you again for the Lesson Woei, integral, mod and differential… cool.
And I actualy understand what you did!! :)

thank you very much for your help!