Xojo Conferences
XDCMay2019MiamiUSA

Drawing text on an arc (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: Another HTTPSocket Question
Next thread: Out Of memory OSX


File handling ideas ???   -   Jan Erik Moström <
  Drawing text on an arc   -   Tom McGrath
   Re: Drawing text on an arc   -   Joseph J. Strout
    Re: Drawing text on an arc   -   Lazarus Plath
     Re: Drawing text on an arc   -   Tom McGrath
      Re: Drawing text on an arc   -   Matthew Lindfield Seager
       Re: Drawing text on an arc   -   Tom McGrath

Drawing text on an arc
Date: 13.08.03 04:00 (Tue, 12 Aug 2003 23:00:16 -0400)
From: Tom McGrath
How would I draw text on the outside of an arc, like around a CD label?

Re: Drawing text on an arc
Date: 13.08.03 04:36 (Tue, 12 Aug 2003 20:36:42 -0700)
From: Joseph J. Strout
At 11:00 PM -0400 8/12/03, Tom McGrath wrote:

>How would I draw text on the outside of an arc, like around a CD label?

You'd have to do it character by character, using a StringShape for each one.

HTH,
- Joe

Re: Drawing text on an arc
Date: 13.08.03 05:11 (Tue, 12 Aug 2003 21:11:19 -0700)
From: Lazarus Plath
Tom McGrath wrote:
> How would I draw text on the outside of an arc, like around a CD label?

I don't know of any premade solutions. To do it yourself you can break
the text up into it's individual characters and handle the math of the
arc and it's tangent.

For each character
put character into a StringShape
calculate XY of arc point to assign to StringShapes XY
calculate tangent of arc at this point
use tangent to figure Rotation of StringShape
draw StringShape or have it added to Group2D someplace
next

There is lots of variability in how you calc the XY arc point. You can
equally distribute the points along the curve or have a start point and
the rest of the points use character widths to place them the
appropriate distance along the curve. How difficult the math is depends
on what type of curve you're using, if by arc you mean a section of an
ellipse then that will be easier than a spline, but still a challenge
for someone like me.

Also, the above psuedo-code may place the text right on the curve and I
imagine you want the curve to act as the baseline. I don't know the
relation of the XY to the text drawn in a string shape so you'll need
to figure that out and possibly compensate for it with vector maths so
the XY and rotation puts the character exactly how you want.

I'll be doing this for the project I'm currently working on but
probably won't get to that part for a couple months. I'd be most
grateful if you figure a solution and share.
-laz

---
A searchable archive of this list is available at:
<http://support.realsoftware.com/listarchives/search.php>

Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Re: Drawing text on an arc
Date: 13.08.03 05:50 (Wed, 13 Aug 2003 00:50:38 -0400)
From: Tom McGrath
Well, I too will not be getting into it for a while, but I'm just
curious.

Luckily I'm am exceptional at this kind of math, so It'd be a fun
challenge, when I get to it. My to do list is already long enough.

On Wednesday, August 13, 2003, at 12:11 AM, Lazarus Plath wrote:

> There is lots of variability in how you calc the XY arc point. You can
> equally distribute the points along the curve or have a start point
> and the rest of the points use character widths to place them the
> appropriate distance along the curve. How difficult the math is
> depends on what type of curve you're using, if by arc you mean a
> section of an ellipse then that will be easier than a spline, but
> still a challenge for someone like me.
>
> Also, the above psuedo-code may place the text right on the curve and
> I imagine you want the curve to act as the baseline. I don't know the
> relation of the XY to the text drawn in a string shape so you'll need
> to figure that out and possibly compensate for it with vector maths so
> the XY and rotation puts the character exactly how you want.
>
> I'll be doing this for the project I'm currently working on but
> probably won't get to that part for a couple months. I'd be most
> grateful if you figure a solution and share.

Re: Drawing text on an arc
Date: 13.08.03 06:49 (Wed, 13 Aug 2003 15:49:51 +1000)
From: Matthew Lindfield Seager
>Luckily I'm am exceptional at this kind of math
Shame you're are not as good at english! ;-)

---
A searchable archive of this list is available at:
<http://support.realsoftware.com/listarchives/search.php>

Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Re: Drawing text on an arc
Date: 13.08.03 15:48 (Wed, 13 Aug 2003 10:48:42 -0400)
From: Tom McGrath
On Wednesday, August 13, 2003, at 01:49 AM, Matthew Lindfield Seager
wrote:

>> Luckily I'm am exceptional at this kind of math
> Shame you're are not as good at english! ;-)

Har har. You know the excuse - late, sentence splicing. I started to
word it one way, and changed it without looking too closely.