No such thing as a small change | |
PerlMonks |
Newline in GD?by AssFace (Pilgrim) |
on Mar 13, 2008 at 22:00 UTC ( [id://674082]=perlquestion: print w/replies, xml ) | Need Help?? |
AssFace has asked for the wisdom of the Perl Monks concerning the following question:
I have some code in which I am taking a string and putting it over top of an image. This is running on a Linux server (DreamHost, if that matters).
I am doing this with GD, something like: My issue is that $long_string might be longer than the width of the image. I actually check this and then insert a newline in a spot I deem appropriate and then put that into the image - except that the newline (\n - and I even tried \n\r and \r\n and even \r\n\r) is not showing up in the image (they are in the string, but the image continues to plow them through the edge of the frame and it has no line breaks). Is there a special character that I need to use for GD to respond to the line breaks? Or perhaps I missed something in the string output where you could define more than just its left corner position, text, and color? (meaning, definite a smaller rectangle that it should be put into that would fit in the image?) (on a side note, when I try and load an external TT font, GD fails with an out of memory error - not sure why, hence why the above is just using the default gd system font) ------------------------------------------------------------------- There are some odd things afoot now, in the Villa Straylight.
Back to
Seekers of Perl Wisdom
|
|