note 27335 added to function.imagettftext

From: Date: Mon, 02 Dec 2002 17:13:46 +0000
Subject: note 27335 added to function.imagettftext
Groups: php.notes 
Request: Send a blank email to php-notes+get-40253@lists.php.net to get a copy of this message
Hello people, finally I FOUND the solution for TFF fonts and GD the problem is path to font, when path contains long file names like Program Files\Apache group\Apache..... I wrote a litle func to convert long file names into short(8.3) and GD works fine now!!! so here a little example how to convert path into 8.3 format so GD can understand it. ----------------------------------------------------------- function convert16($s) { if (strlen($s) > 8) { $p = pathinfo($s); $ss = substr(str_replace('.','',$s),0,6); $s = $ss.'~1'; if($p['extension']) $s .= '.'.$p['extension']; } return $s; } function convertpath($path) { $pathinfo = pathinfo($path); $dirname = split("/",$pathinfo['dirname']); $res = ''; foreach ($dirname as $dir) { $res .= convert16($dir).'\\'; } return $res.$pathinfo['basename']; } ---------------------------------------------------------- ok, good luck!! -- http://www.php.net/manual/en/function.imagettftext.php http://master.php.net/manage/user-notes.php?action=edit+27335 http://master.php.net/manage/user-notes.php?action=delete+27335 http://master.php.net/manage/user-notes.php?action=reject+27335

« previous php.notes (#40253) next »