note 16166 deleted from function.imagettftext by jimw

From: Date: Thu, 18 Oct 2001 16:11:57 +0000
Subject: note 16166 deleted from function.imagettftext by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-19099@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

« previous php.notes (#19099) next »