Hi everyone. I have made this site http://gamesigs.co.uk. I would like to add a second line of text which is placed under the first line and that is optional. I have managed to do similar stuff before but i cant seem to get it to work. Can someone help me please?
This is the code that creates the image. I want the new line to be called something like $tag or $line2. Thanks
header("Content-type: image/jpeg");
header('Content-Disposition: attachment; filename="Signature"');
$name = stripslashes($_GET['name']);
$size = stripslashes($_GET['size']);
$centre = stripslashes($_GET['centre']);
$font = 'images/sig_maker/fonts/'.stripslashes($_GET['font']).'.ttf';
$fontcolor['r'] = stripslashes($_GET['color_r']); // font color - RED
$fontcolor['g'] = stripslashes($_GET['color_g']); // font color - GREEN
$fontcolor['b'] = stripslashes($_GET['color_b']); // font color - BLUE
$lines = stripslashes($_GET['lines']);
function arrow($im, $x1, $y1, $x2, $y2, $alength, $awidth, $color){
///
}
if(is_numeric($_GET['color']) && $_GET['color'] >= '1' && $_GET['color'] <= '54')
{
$bgpic = 'images/sig_maker/' . $_GET['color'] . '.jpeg';
}
$im = imagecreatefromjpeg($bgpic);
//Calculate, the centre:
for(;;){
list($image_width, $image_height) = getimagesize($bgpic);
list($left_x, , $right_x) = imagettfbbox($size, 0, $font, $name);
$text_width = $right_x - $left_x;
if($image_width > $text_width+5){
break;
}
$size = $size - .5;
if($size == 1){
die('Script not responding to decreasing font size, in other words: try using less letters.');
}
}
$hpadding = ($image_width - $text_width)/2;
$vpadding = ($image_height/2);
$textcolor = imagecolorresolve($im, $fontcolor['r'], $fontcolor['g'], $fontcolor['b']);
if($centre== 'y'){
imagettftext($im, $size, 0, $hpadding,$vpadding, $textcolor, $font, $name);
}else{
imagettftext($im, $size, $angle, $x, $y, $textcolor, $font, $name);
}
imagegif($im);
imagedestroy($im);