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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: michaelw at darkhorse dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Thu Nov 21 22:01:28 2024 UTC