php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #45396 imagepsbbox() built-in font support
Submitted: 2008-07-01 00:25 UTC Modified: 2008-08-05 07:53 UTC
From: next_ghost at quick dot cz Assigned: kalle (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.2.6 OS: Linux
Private report: No CVE-ID: None
 [2008-07-01 00:25 UTC] next_ghost at quick dot cz
Description:
------------
Documentation says that imagepsbbox() can calculate bounding box for built-in fonts (font index 1 through 5). It doesn't work.

imagestring() which accepts built-in fonts uses php_find_gd_font() to load font information. imagepsbbox() uses only ZEND_FETCH_RESOURCE().

Reproduce code:
---------------
$box = imagepsbbox("foo", 1, 1);

Expected result:
----------------
No warnings

Actual result:
--------------
Warning: imagepsbbox(): supplied argument is not a valid Type 1 font resource in foo.php on line 1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-04 10:06 UTC] kalle@php.net
This is not a bug, but rather a documentation issue. Ill patch up the documentation...
 [2008-08-04 10:21 UTC] next_ghost at quick dot cz
What function can I use to calculate built-in font bounding box then? imageftbbox() and imagettfbbox() take font filename as argument and you just told me that imagepsbbox() doesn't support built-in fonts either. If there's no such function, consider this a feature request.
 [2008-08-04 11:21 UTC] bjori@php.net
then please keep this report until its fixed.
 [2008-08-04 13:58 UTC] kalle@php.net
imageps*() functions uses PostScript Type 1 fonts and don't have any "builtin" fonts like imagechar[up]() and imagestring[up]() functions.

Theres no function to calculate the bounding box for builtin fonts, but I guess you could write your own by using the imagefontwidth() and imagefontheight() functions.

To open start a feature request then please open a new report with in the category "Feature request", so this doesn't get mixed up.
 [2008-08-05 07:53 UTC] kalle@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Dec 17 10:00:01 2025 UTC