Forum Moderators: coopster

Message Too Old, No Replies

ImageTTFText not supported.

GD, FreeType, TrueType fonts, and all that...

         

NickCoons

5:12 am on Oct 20, 2003 (gmt 0)

10+ Year Member



I'm trying to compile options into my PHP build to create PNG images on the fly. So far, all of the functions I've tried so far (imagecolorallocate, imagepng, imagestring, imagedestroy) all seem to work fine, except imagettftext.

When I call this function, I receive the following:

Fatal error: Call to undefined function: imagettftext() in image.php on line #

I'm using PHP 4.3.3 with the built-in GD support, FreeType has been installed, and so has ZLib (everything the PHP manual says is needed to manipulate PNG images and TrueType fonts). I've tried several different configure options, and here's my latest:

./configure --with-mysql --enable-ftp --enable-sockets --with-gd --with-png-dir=/usr/local --with-zlib --with-zlib-dir=/usr/local --enable-gd-native-ttf --with-freetype-dir=/usr/local --with-apxs=/usr/local/apache/bin/apxs

I receive no errors during configure, make, or make install. I just receive the above-mentioned runtime error when trying to use the imagettftext functions. My searches for answers to this problem have only revealed other people asking the same question, but no one responding with answers.

Hope someone here knows :-).

jatar_k

8:46 pm on Oct 20, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



maybe take a look at your GD version

[ca.php.net...]

The format of images you are able to manipulate depend on the version of GD you install, and any other libraries GD might need to access those image formats. Versions of GD older than gd-1.6 support GIF format images, and do not support PNG, where versions greater than gd-1.6 support PNG, not GIF.

DrDoc

11:32 pm on Oct 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This function requires both the GD library and the FreeType library.

Do you have that installed as well?

NickCoons

4:34 am on Oct 21, 2003 (gmt 0)

10+ Year Member



I'm running GD 2.0.15, the build that comes bundled with PHP 4.3.3, and FreeType 2.

Any other ideas?

jatar_k

6:33 am on Oct 21, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



have you tried looking for clues in the user comments here?
[ca.php.net...]

NickCoons

11:23 pm on Oct 21, 2003 (gmt 0)

10+ Year Member



I've gone through and re-read the user comments from there and have made a few modifications. First, I installed the JPEG library, even though I don't intend on using it, and I've reconfigured PHP with JPEG support. Here's my new configure line:

./configure --with-mysql --enable-ftp --enable-sockets --with-gd --with-png --with-png-dir=/usr/local --with-jpeg --with-jpeg-dir=/usr/local --with-zlib --with-zlib-dir=/usr/local --enable-gd-native-ttf --enable-gd-imgstrttf --with-freetype --with-freetype-dir=/usr/local --with-ttf --with-apxs=/usr/local/apache/bin/apxs

Everything compiles fine.. no errors, just as before. But I receive the same error when attempting to use ImageTTFText.

NickCoons

4:32 pm on Oct 26, 2003 (gmt 0)

10+ Year Member



I've been planning on moving my server because it's virtually hosted with other sites, and I want to put it on it's own dedicated server so I an play around with it, experiment, and not affect the other sites. So yesterday, that's is what I did.

I went ahead and reinstalled all of my software, including all of the libraries for all of the features that I wanted in PHP, and ImageTTFText worked just fine. As far as I can remember, I installed everything the same way, and each library is the same build as the old server.

So as an update.. everything's working fine on the new server, and that's all I really care about, but I don't know why it would work on one and not on the other :-).

jatar_k

5:50 pm on Oct 26, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I couldn't figure it out either, glad you have it sorted now.