php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25830 imagepsloadfont() returns int, not resource
Submitted: 2003-10-10 17:33 UTC Modified: 2003-10-12 21:55 UTC
From: michaelw at darkhorse dot com Assigned:
Status: Not a bug Package: GD related
PHP Version: 4.3.4RC1 OS: Mac OS X 10.2.x
Private report: No CVE-ID: None
 [2003-10-10 17:33 UTC] michaelw at darkhorse dot com
Description:
------------
imagepsloadfont() returns int, not resource, despite 
what the docs say.  I believe this causes functions 
like imagepstext() to fail when looking for a custom-
loaded font.

My understanding is that imagepsloadfont is supposed to 
return an int > 5 to avoid conflict with the built-ins.

Reproduce code:
---------------
$font = imagepsloadfont("/Library/WebServer/Documents/meta/MetaBolRom.pfb"); // or locate your .pfb files on your machine
echo gettype($font);
imagepstext ($im, "Testing... It worked!", $font, 32, $white, $black, 32, 32);

Expected result:
----------------
"int"

Actual result:
--------------
"resource
Warning:  imagepstext(): libt1 returned error -4 in /
Library/WebServer/Documents/index.php on line xx"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-12 21:55 UTC] sniper@php.net
Works fine for me. (Hint: Provide a COMPLETE example script)

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 02:01:30 2024 UTC