php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33484 Rendered Text gets Blocks around characters
Submitted: 2005-06-27 07:08 UTC Modified: 2005-07-29 09:55 UTC
From: designshoe at gmx dot net Assigned: pajoye (profile)
Status: Not a bug Package: GD related
PHP Version: 5CVS, 4CVS (2005-06-28) OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: designshoe at gmx dot net
New email:
PHP Version: OS:

 

 [2005-06-27 07:08 UTC] designshoe at gmx dot net
Description:
------------
I have been playing around with a class that would render a given text using any font (truetype, type1) on a canvas.

I developed on an box that has PHP 4.3.8 installed. I have tested it on PHP 4.3.9 before.

Now that I moved to PHP 4.3.10 on my server the text gets very ugly. And it is the same on 5.0.3.

See the examples:

http://krapplack.de/php-bug/textimage_php-4.3.8.png (works)
http://krapplack.de/php-bug/textimage_php-4.3.10.png (broken)
http://krapplack.de/php-bug/textimage_php-5.0.3.png (broken)

As you can see, there are some white boxes around some of the characters.

I hope that we will find the source of the problem.

Here are the three different configure lines:

4.3.8

'./configure' '--prefix=/usr' '--datadir=/usr/share/php' '--mandir=/usr/share/man' '--bindir=/usr/bin' '--libdir=/usr/share' '--includedir=/usr/include' '--sysconfdir=/etc' '--with-_lib=lib' '--with-config-file-path=/etc' '--with-exec-dir=/usr/lib/php/bin' '--disable-debug' '--enable-inline-optimization' '--enable-memory-limit' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sigchild' '--disable-ctype' '--disable-session' '--without-mysql' '--disable-cli' '--without-pear' '--with-openssl' '--with-apxs2=/usr/sbin/apxs2-prefork' 'i586-suse-linux'

4.3.10

'./configure' '--program-prefix=php4-' '--prefix=/usr/local/php4' '--datadir=/usr/share/php4' '--with-config-file-path=/etc' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2=shared' '--with-dom=shared,/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd=shared' '--enable-gd-native-ttf' '--with-ttf=shared' '--with-gdbm=shared' '--with-gettext=shared' '--with-iconv=shared' '--with-jpeg-dir=shared,/usr' '--with-openssl' '--with-png=shared' '--with-pspell=shared' '--with-regex=system' '--with-xml=shared' '--with-expat=shared' '--with-zlib=/usr/local' '--with-zlib-dir=/usr/local' '--with-layout=GNU' '--enable-bcmath=shared' '--enable-exif=shared' '--enable-ftp=shared' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-versioning' '--enable-calendar=shared' '--enable-dbx=shared' '--enable-dio=shared' '--enable-mcal=shared' '--enable-dba=shared' '--enable-dbase=shared' '--with-ndbm=shared' '--with-ndb=shared' '--with-mcrypt=shared' '--with-mhash=shared' '--with-ming=shared' '--with-curl=shared,/usr' '--with-apxs=/usr/local/apache/bin/apxs'

5.0.3-1.dotdeb.0

'../configure' '--disable-cli' '--prefix=/usr' '--with-regex=php' '--enable-fastcgi' '--enable-force-cgi-redirect' '--with-config-file-path=/etc/php5/cgi' '--disable-rpath' '--enable-memory-limit' '--disable-debug' '--with-layout=GNU' '--disable-pear' '--enable-calendar' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-bcmath' '--with-bz2' '--enable-ctype' '--with-db2' '--enable-dbx' '--with-iconv' '--enable-exif' '--enable-filepro' '--enable-ftp' '--enable-dbase' '--with-gettext' '--with-mime-magic' '--enable-mbstring' '--with-pcre-regex' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-simplexml' '--with-libxml-dir=/usr' '--with-dom=/usr' '--with-xsl=/usr' '--with-sqlite' '--enable-sqlite-utf8' '--enable-tokenizer' '--enable-yp' '--with-zlib' '--with-zlib-dir=/usr' '--with-kerberos=/usr' '--with-openssl=/usr' '--with-exec-dir=/usr/lib/php5/libexec' '--disable-static' '--without-pear' '--without-mm' '--enable-pcntl' '--without-mysql' '--without-sybase-ct'



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-27 10:52 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-06-28 08:59 UTC] designshoe at gmx dot net
I finally managed to set up a system with PHP 5.1.0-dev (php5-200506271430).

The problem still exists:

http://krapplack.de/php-bug/textimage_php-5.1.0-dev.png

My new configure line:

'./configure' '--prefix=/opt/phpcvs/usr' '--datadir=/opt/phpcvs/usr/share/php' '--mandir=/opt/phpcvs/usr/share/man' '--bindir=/opt/phpcvs/usr/bin' '--libdir=/opt/phpcvs/usr/share' '--includedir=/opt/phpcvs/usr/include' '--sysconfdir=/opt/phpcvs/etc' '--with-_lib=lib' '--with-config-file-path=/opt/phpcvs/etc' '--with-exec-dir=/opt/phpcvs/usr/lib/php/bin' '--disable-debug' '--enable-inline-optimization' '--enable-memory-limit' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sigchild' '--with-gd' '--with-freetype-dir=/usr/include/freetype2/freetype' '--with-png-dir=/usr/include/libpng12' '--with-jpeg-dir=/usr/include' '--with-zlib-dir=/usr/include' '--with-bz2' '--with-mysql=/usr/include/mysql' '--with-apxs2=/usr/sbin/apxs2-prefork' 'i586-suse-linux'

Note on snaps: I must say that it would be a lot easier to test with snaps if there were a test system a php.net available. Maybe this could be an option for the future as it would help speed up and simplify testing bugs against the most current devel version.

Cheers,
Thomas
 [2005-06-28 18:29 UTC] sniper@php.net
Pierre, yet another one..

 [2005-07-23 18:48 UTC] pajoye@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

use #33484, same problem.
 [2005-07-24 12:06 UTC] designshoe at gmx dot net
> use #33484, same problem.

This is 33484. Did I miss anything?

Cheers,
Thomas
 [2005-07-24 12:21 UTC] pajoye@php.net
I meant #33489 :)
 [2005-07-28 09:53 UTC] designshoe at gmx dot net
As I can see for #33489 this bug seems to be closed.

If you have a look at the pictures over there and at mine here (see above): they are different. At #33489 the characters were completely left out. I am talking about the letters surrounded by white space.

I do not think that it is because of bad font files because I tried it with Type1 fonts from Adobe. And it worked for all fonts (free TTFs from the web and highq quality Type1s from Adobe) on Version 4.3.9 and before.

Here is the font file I used above:
http://krapplack.de/php-bug/zod.ttf

What I can say is that it only happens with italic fonts. Neither with regular nor with bold font faces.

Any ideas?

Cheers,
Thomas
 [2005-07-28 14:44 UTC] pajoye@php.net
This font works (zod.ttf) for me using php 5.1 (head) or b3 and freetype 2.1.10.

--Pierre
 [2005-07-28 15:21 UTC] designshoe at gmx dot net
Okay, let's track that one down.

I tried it on two different systems.

On system (1) I used the snapshot _and_ PHP 4.3.8. It works with the old version, it is broken with the snapshot (freetype-php-connection?). I will check the freetype version on that system when I get home.

How do I determine the Freetype version? I habe been using Google now but was not successful. And "freetype-config --version" is obviously not the same. I am not an admin on system (2) so I do not know all packages installed.

Cheers,
Thomas
 [2005-07-28 15:24 UTC] pajoye@php.net
You see the freetype version in phpinfo().

rpm -q should work even when you are not admin. I do not know if apt works neither other exotic system :)

--Pierre
 [2005-07-28 15:35 UTC] designshoe at gmx dot net
> You see the freetype version in phpinfo().

I thought so too, in the first place. But it only says:

FreeType Support 	enabled
FreeType Linkage 	with freetype

on system (2).

> rpm -q should work even when you are not admin. I do not know if apt works neither other exotic system :)

It is a very well secured debian system on which I am not allowed to use "apt-cache search" :)

As for now, I have to wait until I get home to check my development system for its version of freetype.

Cheers,
Thomas
 [2005-07-28 15:41 UTC] pajoye@php.net
Ok, but now please use one of our mailing lists to ask for further information. The font you provided works here, so it does seem to be a bug.
 [2005-07-29 07:56 UTC] designshoe at gmx dot net
Here are the freetype versions:

System (1): Freetype 2.1.9 (libfreetype.so.6.3.7), tested with PHP 4.3.8 (worked) and PHP Snapshot (broken).

System (2): Freetype 2.x (undeterminable, maybe 2.0.9 according to rpm.pbone.net, libfreetype.so.6.3.0), tested with PHP 4.3.10 and 5.0.3-1.dotdeb.0 (both broken).

I will now install Freetype 2.1.10 and the latest Snapshot on system (1) to see what happens.

My GD by the way is 2.0.28.

Cheers,
Thomas
 [2005-07-29 08:13 UTC] pajoye@php.net
Your configure looks like you use the bundled GD. Be sure you use it and not a random external version.

But again, this font works well here, with 4.4, 5.1 (same result as http://krapplack.de/php-bug/textimage_php-4.3.8.png ). You have a setup problem, sorry.

--Pierre
 [2005-07-29 09:55 UTC] designshoe at gmx dot net
Solution: WORKS FOR ME.

> You have a setup problem, sorry.

You were right (at least partly). I rendered PNG images with alpha transparency. When I turned that OFF, the font looks just fine, as you said.

I will now go on and try to find out whether it is a PNG transparency problem or just my code.

Thanks a lot,
Thomas
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 01:01:30 2024 UTC