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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 17:01:29 2024 UTC