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?
-- 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>