Welcome to WebmasterWorld Guest from 23.22.46.195

Forum Moderators: coopster & jatar k

imagettftext Multiple Lines Fixed image width

Stumbling with imagettftext

   
4:43 pm on Aug 11, 2007 (gmt 0)

10+ Year Member



Trying to use imagettftext to draw text on an image. The width and height is fixed. I'm having trouble calculating the basepoint of the first character (x and y). The text is supplied by the user so sometimes I can do one line and sometimes as many as three lines. Someone must have done this before and have a good algorithm. Or is this the wrong function to use?
12:28 am on Aug 23, 2007 (gmt 0)

WebmasterWorld Senior Member eelixduppy is a WebmasterWorld Top Contributor of All Time 5+ Year Member



Have you had any luck with this problem? If you know the width in pixels of the image that you are using, you should be able to figure out how many characters can fit across the image using something like imagefontwidth [us2.php.net](). Read the user-contributed notes to get some ideas, as well.

good luck

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month