ID:               20451
 User updated by:  [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Open
 Bug Type:         GD related
 Operating System: Red Hat Linux 7.3
-PHP Version:      4.3.0-pre2
+PHP Version:      4.3.0RC1
 New Comment:

Verified that the problem still exists in PHP 4.3.0RC1.


Previous Comments:
------------------------------------------------------------------------

[2002-11-16 13:44:42] [EMAIL PROTECTED]

Reopening the report

------------------------------------------------------------------------

[2002-11-15 23:06:10] [EMAIL PROTECTED]

I forgot to mention that I use t1lib 1.3.1 from the following address
to enable the imageps* functions in the gd extension (--with-t1lib
configure option):

ftp://sunsite.unc.edu/pub/Linux/libs/graphics/t1lib-1.3.1.tar.gz

------------------------------------------------------------------------

[2002-11-15 23:03:00] [EMAIL PROTECTED]

Yes, certainly, here's the whole code and the font in question:

http://web.axelero.hu/fdsoft/temp/fonttest.zip

There are some really ugly calculations and a brute force way of
determining the size of the would-be image in the code, since
imagepsbbox function didn't quite work well either. At least that was
the case with PHP 4.2.x, and since I added this workaround, I've yet to
re-check that in 4.3.0.

Now for this weird output problem I can't figure out a workaround, and
this was absolutely perfect with PHP 4.2.x., hence my bug report.
It's likely that the fonts I use are of low quality or buggy or both;
but that doesn't change the fact that this was working nicely with the
older versions.

Thanks

------------------------------------------------------------------------

[2002-11-15 21:18:24] [EMAIL PROTECTED]

Can you please provide a complete and working example script? This one
you added does not work.

--Jani


------------------------------------------------------------------------

[2002-11-15 17:08:45] [EMAIL PROTECTED]

I use the GD extension to generate .png images automatically for
displaying text with a specific Type1 font, using the imagepstext
function.

PHP 4.2.x generates these images perfectly, while using PHP 4.3.0-pre1
and -pre2 results in some really weird output.

Here are some examples to show the difference:
http://web.axelero.hu/fdsoft/temp/images.html

There actually seems to be two seperate problems:
- the characters are not lined up properly any more
- anti-aliasing produces weird output (most pronounced when the
resulting image is viewed in IE 6, less ugly but still noticeable in
Mozilla)

The anti-aliasing problem pretty much goes away if I recompile PHP
4.3.0-pre2 to use my old GD 1.8.4 (from the Red Hat rpms) instead of
PHP's built-in version of GD.

The php code in question:

<code>
$fonthandle=@imagepsloadfont(FONT_PATH.$font);
imagepsencodefont($fonthandle, FONT_PATH.'IsoLatin1.enc');

$im = imagecreate($imgwidth, $imgheight);
$background_color = imagecolorallocate ($im, $background[0],
$background[1], $background[2]);
imagecolortransparent($im, $background_color);
$text_color = imagecolorallocate ($im, 
        $color[0], $color[1], $color[2]);
imagepstext($im, $txt, $fonthandle, $size, $text_color,
$background_color,$x, $y, 0, 0, 0, 16);
imagepng($im);
</code>



Finally my php configure options:

<code>
--host=i686-pc-linux-gnu --build=i686-pc-linux-gnu
--target=i386-redhat-linux-gnu --program-prefix= --prefix=/usr
--exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
--sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include
--libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var
--sharedstatedir=/usr/com --mandir=/usr/share/man
--infodir=/usr/share/info --prefix=/usr --with-config-file-path=/etc
--with-exec-dir=/usr/bin --enable-force-cgi-redirect --disable-debug
--enable-dbg=shared --with-dbg-profiler --enable-pic --disable-rpath
--enable-inline-optimization --with-bz2 --with-db3
--with-curl=/usr/local --with-freetype-dir=/usr --with-png-dir=/usr
--with-gd=shared --enable-gd-native-ttf --with-ttf --with-t1lib
--with-gettext=shared --with-ncurses --with-iconv=shared
--with-jpeg-dir=/usr --with-openssl --with-png --with-regex=system
--with-expat-dir=/usr --with-zlib --with-layout=GNU --enable-bcmath
--enable-exif --enable-ftp
--enable-sockets --enable-sysvsem --enable-sysvshm
--enable-discard-path --enable-track-vars --enable-trans-sid
--enable-wddx --enable-exif --enable-memory-limit --enable-bcmath
--enable-shmop --enable-versioning --enable-calendar --enable-dbx
--enable-dio --enable-mcal --with-readline  --with-mysql=shared,/usr
--with-sybase-ct=shared,/usr/local --with-pgsql=shared
--with-unixODBC=shared --with-interbase=shared,/opt/interbase
--with-imap=shared --with-imap-ssl --with-kerberos=/usr/kerberos
--with-zip=shared --with-pspell=shared --with-ming=shared
--with-pdflib=shared --with-pear=/usr/share/pear
--with-apxs=/usr/sbin/apxs
</code>

The '--with-gd=shared' option was changed to '--with-gd=shared,/usr' to
produce the "without built-in GD" output.

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=20451&edit=1

Reply via email to