note 16167 added to function.imagettftext

From: Date: Thu, 18 Oct 2001 14:29:41 +0000
Subject: note 16167 added to function.imagettftext
Groups: php.notes 
Request: Send a blank email to php-notes+get-19093@lists.php.net to get a copy of this message
The font path issue is in no way related to PHP as the gd library itself loads the font and not PHP. As observed, absolute paths do work when the font file is in a custom path. GD has a built-in default directory where to search for font files. On my recent debian system this is /usr/share/fonts/truetype . So, if you supply a font name not starting with a '/' (and, sadly this is also true for windows) it is searched in the default path PLUS(!) the extension 'ttf' is added. myfont -> /usr/share/fonts/truetype/myfont.ttf /myfont -> /myfont ./myfont.ttf /usr/share/fonts/truetype/./myfont.ttf.ttf However, you can supply a custom default search path with the environment variable GDFONTPATH: <? putenv('GDFONTPATH=/home/user/myfonts'); ImageTTFFonts('myfont'); ?> Will be expanded to /home/user/myfonts/myfont.ttf HTH to clean up the fuzz (in now way I think this is a good behaviour ;) - Markus -- http://www.php.net/manual/en/function.imagettftext.php http://master.php.net/manage/user-notes.php?action=edit+16167 http://master.php.net/manage/user-notes.php?action=delete+16167 http://master.php.net/manage/user-notes.php?action=reject+16167

« previous php.notes (#19093) next »