|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46038 imagepsloadfont not working
Submitted: 2008-09-10 06:03 UTC Modified: 2015-04-05 05:14 UTC
Avg. Score:3.4 ± 0.7
Reproduced:5 of 5 (100.0%)
Same Version:1 (20.0%)
Same OS:2 (40.0%)
From: cory dot mawhorter at ephective dot com Assigned: pajoye (profile)
Status: Wont fix Package: GD related
PHP Version: 5.2.6 OS: win32 only
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.
Block user comment
Status: Assign to:
Bug Type:
From: cory dot mawhorter at ephective dot com
New email:
PHP Version: OS:


 [2008-09-10 06:03 UTC] cory dot mawhorter at ephective dot com
I can't get the the example given at 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 [ ] for giggles and the error changed to the one below.  This may just be a coincidence, though.

Reproduce code:
Code from example.  Comments removed.

$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');

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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-15 00:38 UTC]
Pierre, any idea?
 [2008-09-15 06:01 UTC]
you do not need (and should not) download the T1Lib dll. It is already in the extension.

Do you have the font files please?
 [2008-09-15 08:24 UTC] cory dot mawhorter at ephective dot com
I didn?t want to make them available online because of copyright.  I?ve emailed you the two fonts I most recently tried.  

The first is Adobe?s Albertus MT and the second is Porcelain.

Let me know if for some reason you can't receive the attachment or don't receive the email and I'll upload them someplace.
 [2008-09-22 09:36 UTC] cory dot mawhorter at ephective dot com
If you didn't receive the email with the font files I can make them available for you to download elsewhere.
 [2015-04-05 05:14 UTC]
-Status: Assigned +Status: Wont fix
 [2015-04-05 05:14 UTC]
freetype supports and works well with PS fonts, please use it instead.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Sep 30 16:01:24 2023 UTC