Hi,

At work we are having problem with the gd extension. Rendering of
truetype fonts in truecolor mode does not work: it gives weird colors
or no output at all. 

Configuring php5-gd to use freetype2 from X11 instead of freetype1
solves our problems. 

I know nothing of ports, my fix is probably subject to much needed
improvement (especially wrt dependencies), please have a look. 

Below a little program to reproduce the problem (run php image.php >
image.png) and my diff.

        -Otto


<?php
$im = imagecreatetruecolor(500, 230);
$width = imagesx($im);
$height = imagesy($im);
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, $width, $height, $white);
imagestring($im, 5, 20, 20, 'imagestring', $black);
imagettftext($im, 40, 0, 20, 90, $black,
             '/usr/local/lib/X11/fonts/mscorefonts/verdana.ttf',
             'imagettftext');
imagepng($im);
?>

Index: extensions/Makefile
===================================================================
RCS file: /cvs/ports/www/php5/extensions/Makefile,v
retrieving revision 1.16
diff -u -p -r1.16 Makefile
--- extensions/Makefile 21 Dec 2005 15:42:06 -0000      1.16
+++ extensions/Makefile 3 Apr 2006 09:11:41 -0000
@@ -97,7 +97,7 @@ GD_DEPENDS=           ttf.1::print/freetype ${GRA
                        t1.5::devel/t1lib
 GD_WANTLIB=            z
 CONFIGURE_ARGS+=       --with-gd=shared ${GRAPHIC_CONFIG} \
-                       --with-ttf=shared,${LOCALBASE} --without-freetype-dir \
+                       --with-ttf=shared,${LOCALBASE} 
--with-freetype-dir=/usr/X11R6 \
                        --with-t1lib=${LOCALBASE}
 . if !${FLAVOR:L:Mno_x11}
 USE_X11=               yes


Reply via email to