Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: GD::Text::Arc

by da (Friar)
on Jan 24, 2004 at 10:22 UTC ( [id://323813]=note: print w/replies, xml ) Need Help??


in reply to Re: GD::Text::Arc
in thread GD::Text::Arc

Hey, spirals. That would be neat. But no, it doesn't currently. If somebody can suggest an algorythm that works with my code, I could make it do spirals. I was getting a headache even trying to figure out how to make it do ovals (*)...

Other items on my wish-list:

  • ovals;
  • left-aligned and right-aligned to a specific point, instead of centered;
  • specifying the (center/left/right) anchor point at some angle other than 12 o'clock and 6 o'clock;
  • maybe even some arbitrary spline-curve, given some points? (bearing in mind that I have no idea how splines work).

(*) The complication giving me trouble is that I need to recalculate the position (or drawing-angle) for each letter, to account for the fact that GD draws TrueType characters from the lower-left corner, not the center.

I could easily set a separate scaling factor for X and Y coordinates (to make ovals), just like I could vary the radius on-the-fly (to make a spiral) but the problem is that the letters will be angled oddly (as if they were supposed to be in a circle). Too much for this bear of little brain! But, if you have suggestions, I'm all ears.

___ -DA $_='daniel@coder.com 519-575-3733 /Prescient Code Solutions/ coder.c +om ';s/-/ /g;s/([.@])/ $1/g;@y=(42*1476312054+7*3,14120504e4,-42*330261-3 +3, 42*5436+3,42*2886+10,42*434987+5);s/(.)/ord(uc($1))/ge;for(@x=split/32 +/; @y; map{print chr} split /(..)/, shift(@x) + shift(@y)) {perlmonk.da.r +u}

Replies are listed 'Best First'.
Re: Re: Re: GD::Text::Arc
by hsmyers (Canon) on Jan 25, 2004 at 16:41 UTC
    I suppose the thing to research is the notion of 'path'---i.e. a continuous curve where on each character could be drawn perpendicular to a point of tangency. This is the idea supported in postscript and elsewhere...

    --hsm

    "Never try to teach a pig to sing...it wastes your time and it annoys the pig."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://323813]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-25 13:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found