|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-10-23 04:10 UTC] johan at ekenberg dot se
Configuring with freetype 2 and NOT freetype 1.* installed: ./configure \ --with-gd \ --with-freetype-dir=/usr/local/include/freetype2 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. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 10:00:01 2025 UTC |
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): # if HAVE_GD_STRINGFT error = gdImageStringFT(...); # endif # if HAVE_GD_STRINGTTF error = gdImageStringTTF(...); # endif Shouldn't this be changed to: #if HAVE_GD_STRINGFT error = gdImageStringFT(...); #elif HAVE_GD_STRINGTTF error = gdImageStringTTF(...); #endif 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?