Andrew Gaffney wrote:
Charles K. Clarkson wrote:

Andrew Gaffney <[EMAIL PROTECTED]> wrote:

: Can anyone recommend a way to make the generated text
: (testbutton.png) look like the text in the hand-made
: one (contactusbutton.gif)? Also, since this will be a
: script to auto-generate these images with user-defined
: text, how can I center the text in the image (or even
: in the blue rectangle)? Should I use a different
: module for generating the text, or even for generating
: the whole image?

     Take a look at the stringTTF() method. It allows
you to choose a TrueType font and returns the bounds of
the string. Using the string boundaries, you might then
be able to center the string in a box.


I've got this working to some extend, but I'm having a weird problem. About 1 of every 6 times I run the script, it doesn't generate the text and it sets $@ to "libgd was not build with FreeType font support" which obviously isn't true since it works the other 5 out of 6 times. Anyone know what's going on?

I think I've fixed this, too. It looks like it was some weird caching issue with Apache and mod_perl. I renamed the script and it works correctly every time now. Thank you for the suggestion to use stringTTF() or stringFT() to generate the text. I was able to use the array returned by it to center the text in the middle of the generated image. Thanks.


--
Andrew Gaffney


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to