List Info

Thread: note 62428 added to function.imagettfbbox




note 62428 added to function.imagettfbbox
user name
2006-02-28 15:41:18
Neither Greg's or Henrik N's code worked for me.

I figured out that imagettfbbox gives the size (coordinates)
of the whole letter (ie. with the hang on 'g' or 'j').
So it was only a matter of finding the correct index of
coordinates in the array.

Note: This doesn't work on Times New Roman Italic's 'f'
for some reason.

<?php

	$size = imagettfbbox($fontsize, 0, $font, $text);
	$dx = abs($size[2]-$size[0]);
	$dy = abs($size[5]-$size[3]);

	ImageTTFText($im, $fontsize, 0, abs($size[6]),
abs($size[5]), $txtcolor, $font, $text);

?>
----
Server IP: 193.27.201.10 (proxied: 193.27.201.10 1.0
www1.shellkonto.se:3128 (squid/2.5.STABLE4))
Probable Submitter: 212.112.164.219
----
X-Spam-Status: No, hits=3.1 required=5.0
tests=DATE_MISSING,FROM_NO_LOWER 
	autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.imagettfbbox.php
Edit        -- http://master.p
hp.net/note/edit/62428
Del: integrated  -- ht
tp://master.php.net/note/delete/62428/integrated
Del: useless     -- http:
//master.php.net/note/delete/62428/useless
Del: bad code    -- http
://master.php.net/note/delete/62428/bad+code
Del: spam        -- http://m
aster.php.net/note/delete/62428/spam
Del: non-english -- h
ttp://master.php.net/note/delete/62428/non-english
Del: in docs     -- http:
//master.php.net/note/delete/62428/in+docs
Del: other reasons-- http://master
.php.net/note/delete/62428
Reject      -- http://master
.php.net/note/reject/62428
Search      -- http://ma
ster.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )