Here is a solution using the Presentations package. A fuller solution with more detailed explanation should appear in a few days on Peter Linday's site:
There are both Mathematica notebooks and PDF files there for solutions to various MathGroup questions.
To put text around a curve it is probably best to use a unit speed parametrization for the curve, to use a mono-space character font, and to confine the text to portions of the curve where it will read right side up and left to right. For those who have Presentations, here is a solution:
Module[ {string = "We were asked to wrap some text around a curve.", characters, numchar, point, tangent, normal, txt}, characters = Characters[string]; numchar = Length[characters]; (* Define the position, tangent and normal for character i *) point[i_] := unitspeed[Rescale[i, {1, numchar}, {5.0, 0.5}]]; tangent[i_] := unitspeed'[Rescale[i, {1, numchar}, {5.0, 0.5}]]; normal[i_] := Normalize[Reverse[tangent[i]] {-1, 1}];
Draw2D[ {{Blue, Thick, ParametricDraw[unitspeed[s], {s, 0, curvelength}]}, Table[ (* Character at its position along the curve *) txt = Text[Style[characters[[i]], 14, Bold, FontFamily -> "Courier"], point[i]]; (* Rotate so the character baseline is along the tangent *) txt = txt // RotationTransformOp[{{1, 0}, -tangent[i]}, point[i]]; (* Translate a fixed distance along the normal away from the \ curve *) txt // TranslateOp[-.1 normal[i]], {i, 1, numchar}]}, Frame -> True, PlotRangePadding -> .2, ImageSize -> 300] ]
For those who, like myself, might have searched for the "Text on a curve" solution at the links below...
It is already posted at the first link, at the bottom of the page. Posts go from oldest to newest, it appears. I expected the opposite (oddly enough), so I initially thought the solution hadn't been posted yet.
The examples are individually amazing, and as a group they cover many of the hardest graphics issues we're likely to encounter. Even if you don't have Presentations, they illustrate a lot of useful mathematics on curves and surfaces.
(On a less helpful note... I found no clue where David's solutions might be found at the second link.)
On Mon, 09 Nov 2009 04:44:59 -0600, David Park <djmp...@comcast.net> wrote: > Here is a solution using the Presentations package. A fuller solution > with > more detailed explanation should appear in a few days on Peter Linday's > site:
> There are both Mathematica notebooks and PDF files there for solutions to > various MathGroup questions.
> To put text around a curve it is probably best to use a unit speed > parametrization for the curve, to use a mono-space character font, and to > confine the text to portions of the curve where it will read right side > up > and left to right. For those who have Presentations, here is a solution: