Bug #18062 Updated: Generating true type font images not working
| From: | sniper@php.net | Date: | Wed, 03 Jul 2002 01:43:18 +0000 |
| Subject: | Bug #18062 Updated: Generating true type font images not working | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-12906@lists.php.net to get a copy of this message | ||
ID: 18062
Updated by: sniper@php.net
Reported By: usenet@watson-wilson.ca
-Status: Open
+Status: Feedback
Bug Type: GD related
Operating System: Linux 2.4.18
PHP Version: 4.2.1
New Comment:
Provide a complete, self-contained script. The one here now can't be
copy'pasted and run..
Previous Comments:
------------------------------------------------------------------------
[2002-06-30 11:07:36] usenet@watson-wilson.ca
1. I have not updated or changed GD in anyway.
2. I've tried --with-ttf=/usr/local but there was no improvement.
Here is the script:
<?
Header("Content-type: image/png");
// note - must use the absolute font path
// be careful about blank lines in your code which will output a blank
and confuse browser
$font = "/usr/X11R6/lib/X11/fonts/drakfont/WORLDOFW.ttf";
$box = imagettfbbox($size, 0, $font, $text);
$xsize = $box[2]-$box[0]+10;
$ysize = $box[1]-$box[7]+10;
$xstart = ($xsize - ($box[2] - $box[0])) / 2;
$ystart = ($ysize - ($box[1] - $box[7])) / 2 - $box[7];
$im = imagecreate($xsize,$ysize);
$white = ImageColorAllocate($im, 255,255,255);
$black = ImageColorAllocate($im, 0,0,0);
$trans=ImageColorTransparent($im,$white);
ImageTTFText($im, $size, 0, $xstart, $ystart, $black, $font, $text);
Imagepng($im);
ImageDestroy($im);
?>
------------------------------------------------------------------------
[2002-06-29 12:22:40] sniper@php.net
And this is wrong:
--with-ttf=/usr/local/lib
It should be:
--with-ttf=/usr/local
------------------------------------------------------------------------
[2002-06-29 12:18:46] sniper@php.net
Did you happen to update GD library?
And we really need a short example script too..
------------------------------------------------------------------------
[2002-06-29 12:03:47] usenet@watson-wilson.ca
Compiled php 4.2.1 for Apache 1.3.26 using these options:
CPPFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib
./configure --prefix=/usr/local \
--with-apache=/usr/src/Apachetoolbox-1.5.54/apache_1.3.26 \
--enable-exif \
--enable-track-vars \
--with-calendar=shared \
--enable-safe-mode \
--enable-magic-quotes \
--enable-trans-sid \
--enable-wddx \
--enable-ftp \
--with-xpm-dir=/usr/X11R6 \
--with-gd=/usr/local \
--enable-gd-native-ttf \
--enable-gd-imgstrttf \
--with-freetype-dir=/usr/local/include/freetype2/freetype/ \
--with-ttf=/usr/local/lib \
--with-zlib \
--with-t1lib=/usr/local \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-zlib-dir=/usr \
--with-openssl=/usr \
--with-mysql=/usr/local/mysql \
There are no errrors reported during the configure, compile or
install.
This script:
http://watson-wilson.ca/starfrontiers/images/title.php?size=35&text=Test
It is no longer working. There are no entries in the apache error
logs. It was working prior to php 4.2.1. I was using 4.0.? but can't
remember the exact version (sorry). I have searched the web, usenet,
php.net, and phpbuilder.com. I have asked to help on usenet and
phpbuilder.com. The only reply I had suggested that this might be a
bug. If it is not I apologize for wasting your time but I am out of
options.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18062&edit=1