|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-07-15 11:59 UTC] a dot vent at procommerz dot de
[2005-07-18 02:39 UTC] sniper@php.net
[2005-07-24 18:58 UTC] a dot vent at procommerz dot de
[2005-07-27 15:01 UTC] pajoye@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 23:00:02 2025 UTC |
Description: ------------ The ImageTTFText function produces no result, but also no error. I've tried several font files (Microsoft TT core fonts and also from other sources), several paths (the same dir as the PHP script, relative to DocRoot, absolute path a.s.o.). It looks like not calling imagettftext - the function silently does nothing... I have Debian "Woody" with Apache 1.3.29 / PHP 4.4.0. The GD lib is the bundled one (phpinfo says: "2.0.28 compatible"). The Freetype lib version is 1.4pre, as provided from Debian package manager. PHP configure options: './configure' '--with-apxs=/var/www/bin/apxs' '--with-mysql' '--enable-ftp' '--enable-shared' '--with-iconv' '--with-gd' '--with-curl' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-dom=/usr' '--with-zlib' '--enable-cli' '--with-ttf=/usr' Output snippet from phpinfo: GD Support enabled GD Version bundled (2.0.28 compatible) FreeType Support enabled FreeType Linkage with TTF library GIF Read Support enabled GIF Create Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled XBM Support enabled Reproduce code: --------------- <?php header("Content-type: image/png"); $im = imagecreatetruecolor(400, 30); $grey = imagecolorallocate($im, 102, 102, 102); $white = imagecolorallocate($im, 255, 255, 255); $red = imagecolorallocate($im, 255, 0, 0); imagefill($im, 0, 0, $grey); $fontfile = realpath("./Arial.ttf"); imagettftext($im, 20, 0, 10, 20, $white, $fontfile, "Hello World!"); imagepng($im); imagedestroy($im); ?> Expected result: ---------------- Displays an image with white-colored text "Hello World" in Arial font face on grey background. Actual result: -------------- Displays an grey-colored image without any text (empty grey box). No error messages.