$val){ $_b = imageTTFBbox($fsize,0,$font,$val); $_W = abs($_b[2]-$_b[0]); //Defining the X coordinate. $_X = $W-$_W; //Defining the Y coordinate. $_H = abs($_b[5]-$_b[3]); $__H += $_H; imagettftext($im, $fsize, $angle, $_X, $__H, $text_color, $font, $val); $__H += 6; } } elseif($L_R_C == 2){ //Justify Center $s = split("[\n]+", $text); $__H=0; foreach($s as $key=>$val){ $_b = imageTTFBbox($fsize,0,$font,$val); $_W = abs($_b[2]-$_b[0]); //Defining the X coordinate. $_X = abs($W/2)-abs($_W/2); //Defining the Y coordinate. $_H = abs($_b[5]-$_b[3]); $__H += $_H; imagettftext($im, $fsize, $angle, $_X, $__H, $text_color, $font, $val); $__H += 6; } } return $im; } ?>