tjstalcup Posted January 18, 2007 Share Posted January 18, 2007 This returns nothing, what is wrong with the function:[code]<?phpheader("Content-type: image/png");$shell = imagecreatefromjpeg("imgs/shells/".$shell_image."");$red = imagecolorallocate($shell,220,50,50);$fontbold = "font/HU521BTB.ttf";function kearning($text, $fontsize, $font, $nxpos, $kearn, $ypos, $fontcolor) {for($i=0;$i<strlen($text);$i++){ // Get single character $value=substr($text,$i,1); if($pval){ // check for existing previous character list($lx,$ly,$rx,$ry) = imagettfbbox($fontsize,0,$font,$pval); $nxpos+=$rx+$kearn; }else{ $nxpos = $nxpos; } // Add the letter to the image imagettftext($shell, $fontsize, 0, $nxpos, $ypos, $fontcolor, $font, $value); $pval=$value; // save current character for next loop}}kearning("Testing", 13, $fontbold, 256, 1.25, 30, $red);imageline($shell,0,0,0,288,$blue);//leftimageline($shell,0,0,494,0,$blue);//topimageline($shell,0,287,494,287,$blue);//bottomimageline($shell,493,0,493,288,$blue);//rightimagepng($shell);imagepsfreefont($font);imagedestroy($shell);?>[/code] Link to comment https://forums.phpfreaks.com/topic/34775-code-help/ Share on other sites More sharing options...
blear Posted January 18, 2007 Share Posted January 18, 2007 There is no return statement in the function Link to comment https://forums.phpfreaks.com/topic/34775-code-help/#findComment-163996 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.