note 61784 added to function.imagecreate

From: Date: Sat, 11 Feb 2006 22:21:59 +0000
Subject: note 61784 added to function.imagecreate
Groups: php.notes 
Request: Send a blank email to php-notes+get-103532@lists.php.net to get a copy of this message
Have a problem with imagettfbbox cutting off the hang of letters such as 'g' or 'j'?? After days trying to figure this thing out, I finally cracked it: $size = imagettfbbox($s,0,$font,$text); $dx=abs($size[0])+abs($size[2]); $dy=abs($size[1])+abs($size[7]); ImageTTFText($im, $s, 0, $dx-abs($size[0]), $dy-abs($size[1]), $black, $font, $text); The key is the abs commands - you must account for the negative numbers in the original imagettfbbox, and if you have any, take them away from the location at the end when the text is displayed: you need to start the x and y at a (possibly) negative number, not 0,0 as I had thought. Hope that helps someone.. ---- Server IP: 84.18.202.180 Probable Submitter: 82.37.178.114 ---- Manual Page -- http://www.php.net/manual/en/function.imagecreate.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61784 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61784&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61784&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61784&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61784&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61784&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61784&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61784&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61784&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#103532) next »