From:             cory dot mawhorter at ephective dot com
Operating system: Windows Vista
PHP version:      5.2.6
PHP Bug Type:     GD related
Bug description:  imagepsloadfont not working

Description:
------------
I can't get the the example given at http://php.net/imagepstext to work at
all under Windows.  I have GD with t1lib enabled but it is producing an
error and will not load the font.  The same code runs fine under linux.

Originally, I was getting a "Font file not found" error even though the
font file was definitely there.  I downloaded and installed the T1Lib from
sourceforge [ http://gnuwin32.sourceforge.net/packages/t1lib.htm ] for
giggles and the error changed to the one below.  This may just be a
coincidence, though.

Reproduce code:
---------------
Code from http://php.net/imagepstext example.  Comments removed.

<?php
$im = imagecreatetruecolor(200, 200);
$black = imagecolorallocate($im, 0, 0, 0);
$white = imagecolorallocate($im, 255, 255, 255);

$font = imagepsloadfont('C:\\path-to\\postscript-font\\albertus.pfb');

imagepstext($im, 'Sample text is simple', $font, 12, $black, $white, 50,
50);

header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>

Expected result:
----------------
Image rendered without errors.

Actual result:
--------------
Trying to run the above code gives the following error:

Warning: imagepstext() [function.imagepstext]: T1Lib Error: Syntactical
Error Scanning Font File in [path]\pstest.php on line 13

I've tried with a couple different fonts and always get the same result. 
I run the same code on my linux server with the same fonts without issue.

-- 
Edit bug report at http://bugs.php.net/?id=46038&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=46038&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=46038&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=46038&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=46038&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=46038&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=46038&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=46038&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=46038&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=46038&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=46038&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=46038&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=46038&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=46038&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=46038&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=46038&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=46038&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=46038&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=46038&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=46038&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=46038&r=mysqlcfg

Reply via email to