I am in need of assistance with this form I am trying to create at
www.southshoreenterprises.com/boattest.php
the external php file is below.
I cannot seem to make the italics effect work.
Thank you.
<?PHP
function imagettftextoutline(&$im,$size,$angle,$x,$y,&$col,
&$outlinecol,$fontfile,$text,$width) {
// For every X pixel to the left and the right
for ($xc=$x-abs($width);$xc<=$x+abs($width);$xc++) {
// For every Y pixel to the top and the bottom
for ($yc=$y-abs($width);$yc<=$y+abs($width);$yc++) {
// Draw the text in the outline color
$text1 = imagettftext($im,$size,$angle,$xc,$yc,$outlinecol,$fontfile,$text);
}
}
// Draw the main text
$text2 = imagettftext($im,$size,$angle,$x,$y,$col,$fontfile,$text);
}
function ImageColorAllocateFromHex ($img, $hexstr)
{
$int = hexdec($hexstr);
return ImageColorAllocate ($img,
0xFF & ($int >> 0x10),
0xFF & ($int >> 0x8),
0xFF & $int);
}
header("Content-type: image/png");
$tcolor = '#'.$GET['textColor'];
$bcolor = '#'.$GET['boatColor'];
$t2color= '#'.$GET['text2Color'];
$ecolor = '#'.$GET['effectColor'];
$i = imagecreatetruecolor(500,170);
$fontcolour = imagecolorallocatefromhex($i,$tcolor);
$font2colour = imagecolorallocatefromhex($i, $t2color);
$bg = imagecolorallocatefromhex($i,$bcolor);
$ec = imagecolorallocatefromhex($i,$ecolor);
if($bcolor == '#000000') $bg = imagecolorallocate($i, 0, 0, 0);
if($tcolor == '#000000') $fontcolour = imagecolorallocate($i, 1, 0, 0);
if($t2color== '#000000') $font2colour = imagecolorallocate($i, 1, 0, 0);
if($ecolor == '#000000') $ec = imagecolorallocate($i, 1, 0, 0);
if($GET['fontFileName'] == "") {$fontfile = "arial.ttf";} else {$fontfile = $GET['fontFileName'];}
//echo "fonts/$fontfile";
$box = imagettfbbox(40, 0, "fonts/".$fontfile, $GET['text']);
$ax = ceil((500 - $box[2]) / 2);
$ay = ceil((170 - $box[3]) / 2);
$box2 = imagettfbbox(20, 0, "fonts/arial.ttf", $GET['text2']);
$bx = ceil((500 - $box2[2]) / 2);
$by = ceil((170 - $box2[3]) / 2) + 50;
//image, size, angle, x, y, color, font, text
imagefill($i, 0, 0, $bg);
if ($GET['shadowFlag'] == 1) imagettftext($i, 40, 0, $ax+3, $ay+3, $ec, "fonts/".$fontfile, $GET['text']);
if ($GET['strokeFlag'] == 1) imagettftextoutline($i, 40, 0, $ax, $ay, $fontcolour, $ec, "fonts/".$fontfile, $GET['text'], 1);
if ($GET['italicFlag'] == 1) imagettftext($ax, $ay, $angle=90, "fonts/".$fontfile, $GET['text']);
else imagettftext($i, 40, 0, $ax, $ay, $fontcolour, "fonts/".$fontfile, $GET['text']);
imagettftext($i, 20, 0, $bx, $by, $font2colour, "fonts/arial.ttf", $GET['text2']);
imagepng($i);
?>