imagettftext only displays yellow text

Lately I have been doing some work with the PHP GD library. I wanted to put text on an image so I naturally used imagettftext(). I started by copying the example code provided by the manual and intended on modifying the code to fit my needs. When I executed the code my my browser, the text was yellow. I took a look at the code, and the results did not match. The text should have been black. I tried adjusting the imagecolorallocate parameters to reflect a different color. However, this time with I executed the code, no text showed up. It turns out I needed configure PHP –with-freetype-dir. After a recompile with the new configuration it worked fine.

./configure \
–disable-magic-quotes \
–enable-bcmath \
–enable-sockets \
–with-mysq=/usr/local \
–with-apxs2=/usr/local/apache2/bin/apxs \
–with-curl \
–with-gd \
–with-freetype-dir=/usr
–with-png \
–with-jpeg \
–with-ttf

text1

No related posts.

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.