I am pretty sure that there is a stupid reason why this does not work, but I just can't figure it out. I'm just trying to print some text as a graphic with imagettftext, but I can't get the words to display. This is on the GoDaddy server, so I do not control everything, but here are the specifications from phpinfo ():
- PHP Version 5.2.14
- - with-gd '' --with-freetype-dir = / usr '' --with-jpeg-dir = / usr '' --with-png-dir = / usr / bin / libpng-config '' - enable-gd-native-ttf '
- GD support
- GD version included (compatible with 2.0.34)
- FreeType Support Included
- FreeType Communication with freetype
- FreeType Version 2.2.1
Here is the code I'm using. Nothing unusual or strange.
$width = 270;
$height = 25;
$image = imageCreate($width, $height);
$white = imageColorAllocate($image, 255, 255, 255);
$black = imageColorAllocate($image, 0, 0, 0);
$font = 'verdana.ttf';
imagefttext($image, 16, 0, 0, 0, $black, $font, 'TESTING TEXT');
header("Content-type: image/gif");
imageGIF($image);
I tried changing the font name in many ways:
$font = './verdana.ttf';
$font = dirname(__FILE__).'/verdana.ttf';
PNG GIF, imagefttext() imagettftext(), , , . ? - ...