<?php
$color1 = $_GET['color1'];
$color2 = $_GET['color2'];
$color3 = $_GET['color3'];
$color4 = $_GET['color4'];
$fontsize = $_GET['s'];
$gettext = $_GET['t'];
$getborder = $_GET['b'];
$getwidth = $_GET['w'];
$getheight = $_GET['h'];
$r1 = hexdec(substr($color1, 0, 2));
$g1 = hexdec(substr($color1, 2, 2));
$b1 = hexdec(substr($color1, 4, 2));
$r2 = hexdec(substr($color2, 0, 2));
$g2 = hexdec(substr($color2, 2, 2));
$b2 = hexdec(substr($color2, 4, 2));
$r3 = hexdec(substr($color3, 0, 2));
$g3 = hexdec(substr($color3, 2, 2));
$b3 = hexdec(substr($color3, 4, 2));
$r4 = hexdec(substr($color4, 0, 2));
$g4 = hexdec(substr($color4, 2, 2));
$b4 = hexdec(substr($color4, 4, 2));
$font = './fonts/arial.ttf';
$im = imagecreatetruecolor($getwidth, $getheight);
imageantialias($im, true);
function imagettfborder($im, $size, $angle, $x, $y, $color, $font, $text, $width) {
imagettftext($im, $size, $angle, $x-$width, $y-$width, $color, $font, $text);
imagettftext($im, $size, $angle, $x, $y-$width, $color, $font, $text);
imagettftext($im, $size, $angle, $x+$width, $y-$width, $color, $font, $text);
imagettftext($im, $size, $angle, $x-$width, $y+$width, $color, $font, $text);
imagettftext($im, $size, $angle, $x, $y+$width, $color, $font, $text);
imagettftext($im, $size, $angle, $x-$width, $y+$width, $color, $font, $text);
imagettftext($im, $size, $angle, $x-$width, $y, $color, $font, $text);
imagettftext($im, $size, $angle, $x+$width, $y, $color, $font, $text);
for ($i = 1; $i < $width; $i++) {
imagettftext($im, $size, $angle, $x-$i, $y-$width, $color, $font, $text);
imagettftext($im, $size, $angle, $x+$i, $y-$width, $color, $font, $text);
imagettftext($im, $size, $angle, $x-$i, $y+$width, $color, $font, $text);
imagettftext($im, $size, $angle, $x+$i, $y+$width, $color, $font, $text);
imagettftext($im, $size, $angle, $x-$width, $y-$i, $color, $font, $text);
imagettftext($im, $size, $angle, $x-$width, $y+$i, $color, $font, $text);
imagettftext($im, $size, $angle, $x+$width, $y-$i, $color, $font, $text);
imagettftext($im, $size, $angle, $x+$width, $y+$i, $color, $font, $text);
}
}
$farbe1 = imagecolorallocate($im, $r1, $g1, $b1);
$farbe2 = imagecolorallocate($im, $r2, $g2, $b2);
$farbe3 = imagecolorallocate($im, $r3, $g3, $b3);
$farbe4 = imagecolorallocate($im, $r4, $g4, $b4);
imageFill($im, 0, 0, $farbe3);
if($color4!=""){imagettfborder($im, $fontsize, 0, $getborder*2, $fontsize+$getborder*2, $farbe4, $font, $gettext, $getborder+1);}
if($color2!=""){imagettfborder($im, $fontsize, 0, $getborder*2, $fontsize+$getborder*2, $farbe2, $font, $gettext, $getborder);}
imagettftext($im, $fontsize, 0, $getborder*2, $fontsize+$getborder*2, $farbe1, $font, $gettext);
header("Content-type: image/png");
imagePng($im);
imageDestroy($im);
?>