ID: 23527
Updated by: iliaa@php.net
Reported By: nid at home dot se
-Status: Assigned
+Status: Closed
Bug Type: GD related
Operating System: Linux Slackware 8
PHP Version: 4.3.1
Assigned To: iliaa
New Comment:
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2003-05-09 08:14:21] nid at home dot se
The syntax seems to be uncorrect about the "space"-variable. This might
be called "width".
------------------------------------------------------------------------
[2003-05-09 08:10:40] nid at home dot se
I found a solution for this problem, when tampering with ext/gd/gd.c
I don't have the original line numbers available, because of some
tampering. But it is not hard to find it.
In the php-function imagepstext, there is a codesnippet that looks like
this:
--------[code starts]-----
for (i = 1; i < str_len; i++) {
amount_kern = (int) T1_GetKerning(*f_ind, str[i-1],
str[i]);
amount_kern += str[i-1] == ' ' ? space : 0;
add_width = (int) (amount_kern+width)/extend;
char_path = T1_GetMoveOutline(*f_ind, add_width, 0, 0,
size, transform);
str_path = T1_ConcatOutlines(str_path, char_path);
char_path = T1_GetCharOutline(*f_ind, str[i], size,
transform);
str_path = T1_ConcatOutlines(str_path, char_path);
}
str_img = T1_AAFillOutline(str_path, 0);
-----[code ends]-------
if you instead make this like it WAS in <=php4.2, it should look like
this:
----[code starts]----
if (width) // this is the change
{
for (i = 1; i < str_len; i++) {
amount_kern = (int) T1_GetKerning(*f_ind, str[i-1],
str[i]);
amount_kern += str[i-1] == ' ' ? space : 0;
add_width = (int) (amount_kern+width)/extend;
char_path = T1_GetMoveOutline(*f_ind, add_width, 0, 0,
size, transform);
str_path = T1_ConcatOutlines(str_path, char_path);
char_path = T1_GetCharOutline(*f_ind, str[i], size,
transform);
str_path = T1_ConcatOutlines(str_path, char_path);
}
str_img = T1_AAFillOutline(str_path, 0);
}
else // change continues here
{
str_img = T1_AASetString(*f_ind, str, str_len, space,
T1_KERNING, size, transform);
}
----[code ends]----
Then the problem went away (until you set the space-property to a
non-zero value). So, evidentually, there is some kind of bug, or PHP
handles spaced texts differently than t1lib does as standard.
For further releases, can you _please_ put the "if (width)"-statement
as it was before?
------------------------------------------------------------------------
[2003-05-09 06:07:56] nid at home dot se
I just downloaded the latest snapshot from snaps.php.net
(http://snaps.php.net/php4-STABLE-200305090930.tar.gz). It does not
work as I want, since the font is still not correct in size 9,10 and
12. (as it is in php <=4.2).
The build parameters this time is:
./configure \
--with-mysql \
--enable-track-vars \
--enable-ftp \
--enable-sockets \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-zlib-dir=/usr \
--with-gd \
--with-t1lib=/usr/local \
--with-dom \
--with-expat-dir=/usr/local \
--enable-xslt \
--with-xslt-sablot \
--with-apxs=/usr/local/apache/bin/apxs \
--with-curl=/usr/local \
--disable-session
so, yes. I do use the bundled version of GD. (it says: bundled (2.0.12
compatible) in phpinfo()).
------------------------------------------------------------------------
[2003-05-09 05:26:24] sniper@php.net
When you use the latest stable snapshot and compile
it to use the _bundled_ GD library (by leaving the path out of
--with-gd), does it work or not?
------------------------------------------------------------------------
[2003-05-09 01:38:11] nid at home dot se
Try generating an image with font size 12, and you might get the same
results as me. The font renders well in some sizes (i've been testing
11 and 13 and higher).
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/23527
--
Edit this bug report at http://bugs.php.net/?id=23527&edit=1