We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Text on a Path
Page Index Toggle Pages: 1
Text on a Path? (Read 1198 times)
Text on a Path?
Jun 17th, 2005, 7:23pm
 
Is there a simple way to draw a text string along a path (i.e. a Bezier curve?)

thanks,

julian
Re: Text on a Path?
Reply #1 - Jun 17th, 2005, 9:13pm
 
I don't think there's any "easy" way to do this.

First you need bezierPoint() to get the position on a bezier. Thank Fry for this, without this... getting bezier points is a real nasty excercise...

http://processing.org/reference/bezierPoint_.html


Then you can probably use bezierTanget() to give you the normals for how to rotate your text.

http://processing.org/reference/bezierTangent_.html

I swear.. this makes it so easy. LOL!

Then you need to chop up your string or whatever you're writing into chars, then draw the chars onto the points and rotate them accordingly. Should be a snap!
Re: Text on a Path?
Reply #2 - Jun 17th, 2005, 11:20pm
 
You can check : http://v3ga.net/show.php?id=7&type=0

The code is provided, there's a function called DrawLetterAt(s,c) which takes as input a curved absciss on a bezier path and a char. As Mflux said, it's all about getting a kind of basis at that point by calculating the tangent (now integrated in Processing). Hope this little code snippet will help.
Re: Text on a Path?
Reply #3 - Jun 18th, 2005, 11:27pm
 
Thanks! That looks like a very good place to start.

jt
Page Index Toggle Pages: 1