From:             mgv at userhost dot ru
Operating system: WindowsXP Pro
PHP version:      4.3.9RC1
PHP Bug Type:     GD related
Bug description:  Errors when loading fonts from subdirectories

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  IHDRIDATx 0u%$=3 ;  
         
         
         
         
         
         
         
         
         
         
         
         
  .{IENDB`

-- 
Edit bug report at http://bugs.php.net/?id=29679&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29679&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29679&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29679&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29679&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29679&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29679&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29679&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29679&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29679&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29679&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29679&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29679&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29679&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29679&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29679&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29679&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29679&r=float

Reply via email to