homepage Welcome to WebmasterWorld Guest from 54.204.94.228
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
imagettftext Multiple Lines Fixed image width
Stumbling with imagettftext
HeadBut




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

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?

 

eelixduppy




msg:3429488
 12:28 am on Aug 23, 2007 (gmt 0)

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved