note 2856 deleted from function.imagettfbbox by didou

From: Date: Fri, 15 Aug 2003 22:09:23 +0000
Subject: note 2856 deleted from function.imagettfbbox by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-54264@lists.php.net to get a copy of this message
Note Submitter: barton@applitec.com ---- The numbers seem to be baseline relitive. An 'A' for example is all above the base line while a 'j' goes below the baseline. The numbers above the baseline seem to be negitive while the number below seem to be positive. To position text you need to account for the 'drop' below the line. For example: $ht = $tdy+($ypad)-$drop; ImageTTFText($im, $s, 0, $ws, $ht, $color, $fontfile, $text); To get $tdy I did: $size = imagettfbbox($s,0, $fontfile, $text); $dx = abs($size[2]-$size[0]); if($size[1] >= 0) $drop = $size[1] + 2; I don't know why I have to add two or why it's >=0 instead of >?

« previous php.notes (#54264) next »