Bug #17666 Updated: TTF-Fonts does not work
| From: | ulf at ecora dot de | Date: | Sat, 22 Jun 2002 15:55:23 +0000 |
| Subject: | Bug #17666 Updated: TTF-Fonts does not work | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-11798@lists.php.net to get a copy of this message | ||
ID: 17666
Updated by: ulf@ecora.de
Reported By: ulf@ecora.de
-Status: Feedback
+Status: Open
Bug Type: GD related
Operating System: WinXP/Suse Linux
PHP Version: 4.2.0
New Comment:
@mfischer:
I made a test with file_monitor on WinXP.
TestScript:
<?PHP
$im = imagecreate(420,315);
$grey = imagecolorallocate($im, 60, 60, 60);
imagettftext($im, 80, 0, 20, 50, $grey, 'font.ttf', 'test');
?>
Path of the Testscript: E:\try\test.php4
The php.exe tried to open the fontfile (E:\try\font.ttf) on the
following location:
17:44:45 php.exe FASTIO_QUERY_OPEN
E:\usr\share\fonts\truetype\E:\try\font.ttf.ttf
FAILURE
I have not so much experience, but everywhere in the GD- or in the
FreeType-code must be this fixed path:\usr\share\fonts\truetype\
Previous Comments:
------------------------------------------------------------------------
[2002-06-09 10:46:57] sniper@php.net
I just had same kind of problem on Linux. And the reason
was that the user my apache runs as did not have read
access to the fonts. So you might wanna check that too.
------------------------------------------------------------------------
[2002-06-09 09:13:17] rasmus@php.net
Try it without the .ttf extension.
------------------------------------------------------------------------
[2002-06-09 09:12:23] mfischer@php.net
To fix it for you, try to run the affecting php script through the cgi
from the command line and use strace to see which file it is really
trying to access, e.g.
strace -e trace=open php-cgi -f script.php
Try to avoid the imagejpeg() call so you don't clutter your terminal
with binary data.
------------------------------------------------------------------------
[2002-06-09 08:55:55] ulf@ecora.de
TTF-Fonts don't work on WinXP with PHP 4.2.1 and GD 2.0.1 and on Suse
Linux with PHP 4.2.0 and GD 2.0.1
On every use with imagettftext or imagettfbbox:
Could not find/open font in e:\try\bild.php4 on line x
$im = imagecreate(420,315);
$grey = imagecolorallocate($im, 60, 60, 60);
imagettftext($im, 80, 0, 20, 50, $grey, 'font.ttf', 'test');
imagejpeg($im);
font.ttf is in the same directory like the PHP-Script and an absolute
path will also not work.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17666&edit=1