php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29679 Errors when loading fonts from subdirectories
Submitted: 2004-08-14 16:49 UTC Modified: 2004-08-14 22:52 UTC
From: mgv at userhost dot ru Assigned:
Status: Not a bug Package: GD related
PHP Version: 4.3.9RC1 OS: WindowsXP Pro
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mgv at userhost dot ru
New email:
PHP Version: OS:

 

 [2004-08-14 16:49 UTC] mgv at userhost dot ru
Description:
------------
Software: Apache 1.3.31 & PHP 4.3.8 (GD 2.0.23) / PHP 4.3.9 RC1 (GD 2.0.28) / PHP 4.3.9 RC2-dev (latest snapshot from Aug 14, 2004 12:30 GMT; GD 2.0.28) / PHP 4.3.9 RC2-dev (with GD library from 4.3.8 - 2.0.23).

With this string:
imagettftext($image,11,0,20,20,$color,'E:\bkant.ttf','TEST');

everything is ok. 

But when I copying "bkant.ttf" (or any other font) to any subdirectory (for example, named "a") and replacing this line with:
imagettftext($image,11,0,20,20,$color,'E:\a\bkant.ttf','TEST');

I had "Problem loading glyph in.." error on PHP 4.3.9 (RC1/2-dev). On PHP 4.3.8 (or PHP 4.3.9 RC1/2-dev with replaced php_gd2.dll from 4.3.8) with GD 2.0.23 everything is ok.

Using non-absolute paths (like './fonts/bkant.ttf', when ttf-file placed under 'fonts' subdir) and/or other slashes combinations ('E:\\a\\bkant.ttf', 'E:/a/bkant.ttf'...) coming with same results.

Reproduce code:
---------------
<?php

$image = imagecreatefromjpeg('./blank.jpg'); // just blank image (500x250), white color filled
$color = imagecolorallocate($image,0,0,255);

imagettftext($image,11,0,20,20,$color,'E:\a\bkant.ttf','TEST');

header("Content-type: image/png");
imagepng($image);

?>

Actual result:
--------------
Warning: imagettftext() [function.imagettftext.html]: Problem loading glyph in e:\webserver\host\site\public_html\test.php on line 6
?PNG  IHDR??????IDATx???? ?0u???%?$??=3 ???;??? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ?????.{IEND?B`?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-14 22:52 UTC] mgv at userhost dot ru
With 'E:/a/bkant.ttf' everything is ok. My sorry :)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun May 11 10:01:27 2025 UTC