How to fit text in a window

Jun 21, 2012 at 2:19pm

How to fit text in a window

Hi,

Im implementing twitter posts into a video using an external and the technique in Jitter Tutorial 29. My problem is that most twitter posts won't fit in the video because the text is only one line.

How do I divide the text into different lines so that all 140 characters in a Twitter post will fit?

/Max

[attachment=197175,4074]

Attachments:
  1. tweet.png
#46070
Jun 21, 2012 at 5:02pm

I just searched the forum for text wrapping.

#165933
Jun 21, 2012 at 5:05pm

And here’s a method without JavaScript.

– Pasted Max Patch, click to expand. –
#165934
Jun 22, 2012 at 4:50pm

Nice patch, Chris. In a moment of nastiness, I fed it “antidisestablishmentarianism”, which leads to strange behavior. I don’t know if anyone wants to try to find a fix for this.

And, yes, I know that is *not* the longest word in the English language. But it’s long enough.

#165935
Jun 22, 2012 at 9:00pm

Good ‘screw case’, Peter! The bug is that, since the [i] box is initialized at 0, your string causes [zl slice 0], which sends the entire string out the right outlet, and voilà, an infinite loop. Here’s a quick fix.

– Pasted Max Patch, click to expand. –
#165936

You must be logged in to reply to this topic.