note 82518 added to function.imagettfbbox

From: Date: Mon, 14 Apr 2008 22:57:35 +0000
Subject: note 82518 added to function.imagettfbbox
Groups: php.notes 
Request: Send a blank email to php-notes+get-138311@lists.php.net to get a copy of this message
To get the height for a line of text, I've found it useful to do: <?php $bbox = imagettfbbox($size, 0, $ttf, " \n "); // space, newline, space $height = $bbox[3] - $bbox[5]; ?> I hope this helps. Before, I used the string "Tj", but that sometimes fell short, especially for crazy fonts. ---- Server IP: 69.147.83.197 Probable Submitter: 91.192.140.44 ---- Manual Page -- http://www.php.net/manual/en/function.imagettfbbox.php Edit -- https://master.php.net/note/edit/82518 Del: integrated -- https://master.php.net/note/delete/82518/integrated Del: useless -- https://master.php.net/note/delete/82518/useless Del: bad code -- https://master.php.net/note/delete/82518/bad+code Del: spam -- https://master.php.net/note/delete/82518/spam Del: non-english -- https://master.php.net/note/delete/82518/non-english Del: in docs -- https://master.php.net/note/delete/82518/in+docs Del: other reasons-- https://master.php.net/note/delete/82518 Reject -- https://master.php.net/note/reject/82518 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#138311) next »