php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #24372 imagettftext and imagefttext
Submitted: 2003-06-28 05:22 UTC Modified: 2004-07-06 11:56 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: lapo at lapo dot it Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.2 OS: FreeBSD 4.8
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: lapo at lapo dot it
New email:
PHP Version: OS:

 

 [2003-06-28 05:22 UTC] lapo at lapo dot it
Description:
------------
Both imagettftext and imagefttext contain at least one documentation error:

  "int size, int angle" should be "double size, double angle"

as I read in ext/gd/gd.c around line 3080:

  convert_to_double_ex(PTSIZE);
  convert_to_double_ex(ANGLE);

Page about imagefttext has another error:

  [, array extrainfo]

but the function actualyl requires the last parameter to be present, it isn't optional.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-05 12:12 UTC] nlopess@php.net
docs are right!
 [2004-07-05 15:40 UTC] lapo at lapo dot it
No, they are not.
Not on the website, at least:

http://it2.php.net/manual/it/function.imagettftext.php
array imagettftext ( resource image, int size, int angle, int x, int y, int color, string fontfile, string text)

http://it2.php.net/manual/it/function.imagefttext.php
array imagefttext ( resource image, int size, int angle, int x, int y, int col, string font_file, string text [, array extrainfo])
 [2004-07-05 23:42 UTC] nlopess@php.net
I've re-checked them and they are right. If you think that's not the case, please explain where/how the protos aren't correct.
 [2004-07-06 10:12 UTC] lapo at lapo dot it
Well, as I quoted in my last comment the docs say that the "size" and "angle" parameters are "int" values, while they are "double" values instead:
http://cvs.php.net/co.php/php-src/ext/gd/gd.c?r=1.294#3217

To see why the proto is incorrect while the code is not, I just checked original GD's function, that accept "double" values as well:
http://www.boutell.com/gd/manual2.0.27.html#gdImageStringFT

Moreover, using "double" values for the "size" parameters works perfectly, I do it all the time in my website www.megatokyo.it (and, yes, sizes 8.0 and 8.5 and 9.0 give different results).
 [2004-07-06 11:56 UTC] nlopess@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.


 [2020-02-07 06:12 UTC] phpdocbot@php.net
Automatic comment on behalf of nlopess
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=f0d803fbb25bd32be1f412f8b137c4077a72bdb7
Log: fix #24372: protos fix
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Nov 20 15:00:01 2025 UTC