|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13796 Configure sets both HAVE_GD_STRINGTTF and HAVE_GD_STRINGFT
Submitted: 2001-10-23 04:10 UTC Modified: 2001-10-24 06:43 UTC
From: johan at ekenberg dot se Assigned:
Status: Closed Package: GD related
PHP Version: 4.0CVS-2001-10-23 OS: Linux
Private report: No CVE-ID: None
 [2001-10-23 04:10 UTC] johan at ekenberg dot se
Configuring with freetype 2 and NOT freetype 1.* installed:

./configure \
--with-gd \

results in both HAVE_GD_STRINGTTF and HAVE_GD_STRINGFT being defined in main/php_config.h

This produces this error when trying to use the imagettf*() functions in GD:

"libgd was not built with TrueType font support"

Removing HAVE_GD_STRINGTTF from main/php_config.h before compiling fixes this issue. But of course it should be permanently fixed in autoconf.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-24 00:46 UTC]
Could you check if this works in latest CVS now?


 [2001-10-24 04:20 UTC] johan at ekenberg dot se
No, still the same problem:

$ grep HAVE_GD_STRING main/php_config.h

Gives the same error when compiled and tried with imagettf*().
 [2001-10-24 05:47 UTC]
Sorry, I didn't notice that you're using invalid configure
option value here. --with-freetype-dir expects the
install prefix dir for freetype2.

# ./configure --help |grep freetype
--with-freetype-dir=DIR   GD: Set the path to freetype2 install prefix.

Also, is your GD library compiled with freetype 2?


 [2001-10-24 06:25 UTC] johan at ekenberg dot se
Yes, GD is compiled with freetype 2. Please observe that everything works perfectly when I edit main/php_config.h manually (removing HAVE_GD_STRINGTTF) before compiling.

It doesn't seem to matter what prefix I enter at --with-freetype-dir, configure reports that it finds freetype 2 anyway. And it apparently works.

In my view there are two issues here:
1. Something is wrong in the autoconf stuff which makes both HAVE_GD_STRINGTTF and HAVE_GD_STRINGFT be defined in main/php_config.h although there is no libttf (freetype 1) on the system and HAVE_GD_STRINGTTF should (as far as I understand) not be defined.

2. The if/else preprocessor stuff in ext/gd/gd.c around line 2765 is strange (or wrong):

    error = gdImageStringFT(...);
# endif

    error = gdImageStringTTF(...);
# endif

Shouldn't this be changed to:

    error = gdImageStringFT(...);
    error = gdImageStringTTF(...);

Or is there a hidden point in both gdImageStringFT() and gdImageStringTTF() being called in sequence if both HAVE_GD_STRINGTTF and HAVE_GD_STRINGFT are defined?
 [2001-10-24 06:29 UTC]
Please check your system for all libg.a (or .so) files.
You most likely have old one there somewhere.
And if this is not the case, send me the libgd.a|so file
so I can check it out myself. (


 [2001-10-24 06:43 UTC]
Thank you for noticing that bug (2.).
Fixed in CVS now. I had introduced it myself. :(


PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Jun 04 11:03:40 2023 UTC