I wrote a bezier text demo below, that will give you something to start with. It will be easy to convert this demo to work from the browser, just print appropriate content header, binmode the STDOUT, and dump the image to the STDOUT.
use strict;
use warnings;
use Math::Bezier;
use GD;
use IO::File;
my @control = ( 0, 0, 100, 200, 300, -200, 400, 0 );
my $bezier = Math::Bezier->new(@control);
my $text = "Hello World, this is Perl";
my $len = length($text);
my @curve = $bezier->curve($len);
my @pos = map { my $idx = $_ * 2;
[ $curve[$idx], $curve[$idx + 1] ]
} 0 .. $len - 1;
my $im = new GD::Image(1024, 768);
my $white = $im->colorAllocate(0,0,0);
my $black = $im->colorAllocate(255,255,255);
my @chars = split //, $text;
$im->string(gdGiantFont,
$pos[$_][0] + 200,
$pos[$_][1] + 500,
$chars[$_], $black) for 0..$#chars;
my $f = new IO::File "test.jpg", "w" or die;
binmode $f;
print $f $im->jpeg;
You can also use the Windows version of ImageMagick which has built-in support for bezier text (I think), and it is an excellent graphics package.
| [reply] [d/l] |