function imagettftextoutline(&$im,$size,$angle,$x,$y,&$col,$fontfile,$text,$width,&$outlinecol) { // For every X pixel to the left and the right $xd=0-abs($width); for ($xc=$x-abs($width);$xc<=$x+abs($width);$xc++) { // For every Y pixel to the top and the bottom $yd=0-abs($width); for ($yc=$y-abs($width);$yc<=$y+abs($width);$yc++) { //If this y x combo is within the bounds of a circle with a radius of $width //($xc*$xc + $yc*$yc) <= ($width * $width)+999 if(($xd*$xd+$yd*$yd)<=$width*$width){ // Draw the text in the outline color $text1 = imagettftext($im,$size,$angle,$xc,$yc,$outlinecol,$fontfile,$text); } $yd++; } $xd++; } // Draw the main text $text2 = imagettftext($im,$size,$angle,$x,$y,$col,$fontfile,$text); }