note 43919 added to function.imageftbbox
| From: | dweingart at pobox dot com | Date: | Thu, 08 Jul 2004 17:09:55 +0000 |
| Subject: | note 43919 added to function.imageftbbox | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-72884@lists.php.net to get a copy of this message | ||
You should use this function if you are planning on writing text to the image using imagefttext()
and you need to know if the text will fit.
imageFTtext and imageFTbbox use the FreeType2 font rendering library. imageTTFtext and imageTTFbbox
use the original FreeType library. The major differences are as follows:
1. FreeType2 has a high-quality, patent-free antialiasing alogorithm.
2. FreeType2 can also render Postscript fonts, in addition to TrueType fonts.
3. The extrainfo parameter allows you to adjust linespacing.
<?php
$box = imageftbbox($fontsize, $angle, $fontfile, $text,
array('linespacing'=>$linespace));
?>
In my testing, PHP 4.3.4 on Windows (not tested on *nix) had a bug that caused imageFTbbox() to fail
if you used the extrainfo parameter. PHP 4.3.7 seems to have cured the problem. I did not test
4.3.5 or 4.3.6.
The Windows download comes with both FreeType and FreeType2 functions compiled in. If you're on
a *nix host, your mileage may vary :)
----
Manual Page -- http://www.php.net/manual/en/function.imageftbbox.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+43919
Delete -- http://master.php.net/manage/user-notes.php?action=delete+43919&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+43919&report=yes
Search -- http://master.php.net/manage/user-notes.php