note 41420 deleted from function.imagettftext by aidan

From: Date: Mon, 20 Sep 2004 09:56:39 +0000
Subject: note 41420 deleted from function.imagettftext by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-77013@lists.php.net to get a copy of this message
Note Submitter: arjini at mac dot com ---- I frequently found chopped text in my images when calculating the width with imagettfbbox (and it wasn't just because of j's and p's and other "out of bounds" characters), I also found the same thing happening on a number of sites demoing their GD capabilities. What you want to do is the following (assuming width and height are the values you have gleaned from the imagettfbbox function): $width = $width + floor($width / 80); $height = $height + floor($height / 15); I have no idea why 80 and 15 turned out to be the magic ratios, but it's worked like a charm since I've done that.

« previous php.notes (#77013) next »