Bug #18062 Updated: Generating true type font images not working
| From: | sniper@php.net | Date: | Tue, 09 Jul 2002 21:34:44 +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-13640@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:
Does the suggestion from Dmitry fix this 'bug'?
Or setting 'register_globals=on' in php.ini?
Previous Comments:
------------------------------------------------------------------------
[2002-07-03 09:39:17] usenet@watson-wilson.ca
Here is the URL for the font:
http://www.scifi2k.com/fonts85231647/download/worldofwater.zip
------------------------------------------------------------------------
[2002-07-03 08:29:45] derick@php.net
Can you provide the font then?
Derick
------------------------------------------------------------------------
[2002-07-03 08:25:55] usenet@watson-wilson.ca
The very nature of this problem is generating an image using an
externally referenced true type font. There is no way that I know of
to include the font in the php script.
------------------------------------------------------------------------
[2002-07-02 21:43:18] sniper@php.net
Provide a complete, self-contained script. The one here now can't be
copy'pasted and run..
------------------------------------------------------------------------
[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);
?>
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/18062
--
Edit this bug report at http://bugs.php.net/?id=18062&edit=1