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 curve
Page Index Toggle Pages: 1
text on a curve (Read 1001 times)
text on a curve
Sep 1st, 2009, 3:26pm
 
Hi, everyone. I'm working on a method for rendering text along a curve by computing segment length, character width, and using the curvePoint and curveTangent functions. I've got it to work, but the kerning is odd in some cases, and I'm not quite sure what I'm doing wrong, or what I need to do to compensate.  Any advise would be great.

The applet demo/code is here:
lukeloeffler.com/wordpress/wp-content/uploads/2009/09/growing_text_tree.html

The code is is explained here:
lukeloeffler.com/2009/text-on-a-curve/

Thanks,
Luke

Other similar code, for reference:

Daniel Schiffman created a function to draw text along a circle:
learningprocessing.com/examples/chapter-17/example-17-8/

And there is a processing hack which renders text along a sinusoid
processing.org/hacks/hacks:textoncurves

PS Sorry for the 'dead' links—I apparently don't have permission to use 'http' yet.
Re: text on a curve
Reply #1 - Sep 2nd, 2009, 7:25am
 
I haven't tried with curvePoint but we found out that bezierPoint() doesn't provide regularly spaced points, so your problem might be similar.
Re: text on a curve
Reply #2 - Sep 2nd, 2009, 10:58am
 
Thanks—I will look more closely at how curvePoint is calculating things. I think it's the same problem you were having.  The density of the point spacing seems to depend on the concavity of the curve.
Page Index Toggle Pages: 1