note 3933 deleted from function.imagettfbbox by didou

From: Date: Fri, 15 Aug 2003 22:09:39 +0000
Subject: note 3933 deleted from function.imagettfbbox by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-54265@lists.php.net to get a copy of this message
Note Submitter: j.schmitz@web.de ---- Another solution: <pre> $size=ImageTTFBBox($fontsize,0,$font,$text); $tw=abs($size[4]-$size[0]); $upper=abs($size[5]); $under=$size[1]; $th=$upper+$under; </pre> $tw - text width, $th - text height, $upper - graphic above baseline, $under - graphic below baseline<br> This only works with an angle of 0 and one textline (no return/linefeed). To place a text with ImageTTFText() use $ty=$your_y+$upper-2: <pre> ImageTTFText($im,$fontsize,0,0,$your_y+$upper-2,$col_draw,$font,$text); </pre> -2 is required - seams it uses floats internal<br> I hope this is true - it works fine here after hundreds of tries and reloads ;-)

« previous php.notes (#54265) next »