Bug #12064 Updated: Truetype functions can't locate fonts
| From: | rasmus@php.net | Date: | Thu, 12 Jul 2001 18:36:33 +0000 |
| Subject: | Bug #12064 Updated: Truetype functions can't locate fonts | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-59858@lists.php.net to get a copy of this message | ||
ID: 12064
Updated by: rasmus
Reported By: ben@kescom.net
Old Summary: Truetype functions can't locate fonts
Old Status: Open
Status: Analyzed
Bug Type: GD related
Operating System: Windows 2000 SP1
PHP Version: 4.0.6
New Comment:
No idea about the Windows version, but on UNIX the new GD2 library is hardcoded to look for TTF
fonts in /usr/share/fonts/truetype. Also, it automatically adds the .ttf extension itself so in
your code you should not put the .ttf extension on your font.
Previous Comments:
------------------------------------------------------------------------
[2001-07-11 15:03:28] ben@kescom.net
The GD TrueType functions can't find fonts; relative paths and absolute paths both do not work.
Example (font is in the local directory, and . is part of my php.ini include_path)
<?
$image = ImageCreateTrueColor(200,200);
ImageTTFText($image, 20, 0, 2, 15, $red, "d:/path/to/font.ttf", "Some text.");
header("Content-type: image/jpeg");
// alternatively, ImageTTFText($image, 20, 0, 2, 15, $red, "font.ttf", "Some
text.");
header("Content-type: image/jpeg");
ImageJPEG($image, '', 100);
ImageDestroy($image);
?>
(written off the top of my head, it's in a larger script, but test scripts I wrote and
unfortunately deleted don't work either)
PHP reports: Warning: Could not find/open font in d:\path\to\fonttest.php on line 3
This is from the binary Win32 distribution of PHP 4.0.6 on php.net.
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=12064&edit=1