I created an existing sample that writes input text to a background image no problem. See here.
I attempted to use a font using Imagettftext () following the steps outlined here, however I can't get the function to create the image using the font I specified. This is the code I added to the working page above:
Also tried it with:
Attempted troubleshooting
1. My host supports freetype and it's compiled with 4.4.9.
'../configure' '--with-pear=/usr/lib/php' '--prefix=/usr' '--with-mysql=/usr/' '--with-zlib' '--enable-debug=no' '--enable-safe-mode=no' '--enable-discard-path=no' '--with-gd' '--with-png-dir' '--enable-track-vars' '--with-db' '--with-gdbm' '--enable-force-cgi-redirect' '--with-ttf' '--enable-ftp' '--with-mcrypt' '--enable-dbase' '--enable-memory-limit' '--enable-calendar' '--enable-wddx' '--with-jpeg-dir' '--enable-bcmath' '--enable-gd-imgstrttf' '--enable-shmop' '--enable-mhash' '--with-mhash' '--with-openssl' '--enable-xslt' '--with-xslt-sablot' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--with-imap' '--with-curl' '--with-iconv' '--with-freetype-dir' '--with-bz2' '--with-gettext' '--enable-exif' '--with-idn' '--enable-mbstring=all' '--with-kerberos' '--with-imap-ssl' '--with-sqlite' '--with-zip'
2. I changed my FTP settings to upload text files as ASCII instead of binary and tried it with a number of basic ttfs in the same folder but still did not work.
3. I confirmed with my web host - 1and1 - and they assured me it should work providing my code was correct.
4. I tried using the imagefttext function but to no avail. It just generates an image with no text at all as seen here.
I can't find any other method of troubleshooting this issue, so anything that I haven't tried here....??
I attempted to use a font using Imagettftext () following the steps outlined here, however I can't get the function to create the image using the font I specified. This is the code I added to the working page above:
Code:
$font = 'arial.ttf'; imagettftext ($my_img, 10, 15, 30, 40, $txt_colour, $font, $input_text);
Code:
putenv('GDFONTPATH=' . realpath('.')); $font = 'arial.ttf';
1. My host supports freetype and it's compiled with 4.4.9.
'../configure' '--with-pear=/usr/lib/php' '--prefix=/usr' '--with-mysql=/usr/' '--with-zlib' '--enable-debug=no' '--enable-safe-mode=no' '--enable-discard-path=no' '--with-gd' '--with-png-dir' '--enable-track-vars' '--with-db' '--with-gdbm' '--enable-force-cgi-redirect' '--with-ttf' '--enable-ftp' '--with-mcrypt' '--enable-dbase' '--enable-memory-limit' '--enable-calendar' '--enable-wddx' '--with-jpeg-dir' '--enable-bcmath' '--enable-gd-imgstrttf' '--enable-shmop' '--enable-mhash' '--with-mhash' '--with-openssl' '--enable-xslt' '--with-xslt-sablot' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--with-imap' '--with-curl' '--with-iconv' '--with-freetype-dir' '--with-bz2' '--with-gettext' '--enable-exif' '--with-idn' '--enable-mbstring=all' '--with-kerberos' '--with-imap-ssl' '--with-sqlite' '--with-zip'
2. I changed my FTP settings to upload text files as ASCII instead of binary and tried it with a number of basic ttfs in the same folder but still did not work.
3. I confirmed with my web host - 1and1 - and they assured me it should work providing my code was correct.
4. I tried using the imagefttext function but to no avail. It just generates an image with no text at all as seen here.
I can't find any other method of troubleshooting this issue, so anything that I haven't tried here....??
Comment