PDA

View Full Version : [HELP] Need a fix to this volter generator text generator!



iSwifter
08-12-2014, 04:35 AM
Basically I am using a volter text generator from habboemotions

but the problem seems that it makes these white lines n it

im not sure why heres the screenie and code

if u guys can help fix then that will be amazing thanks
http://i.imgur.com/4wy0Znm.png


<?php

/////////////////////////////////////////////////////////
// This script is free to use from the permission of //
// its author as long as this top portion stays intact //
// //
// **David a.k.a Decoma (HabbCrazy.NET)** //
/////////////////////////////////////////////////////////

//this function is a special brew of the imagettftext() function with a "stroke" effect
function imagettftextoutline(&$im,$size,$angle,$x,$y,&$col,
&$outlinecol,$fontfile,$text,$width) {

for ($xc=$x-abs($width);$xc<=$x+abs($width);$xc++) {

for ($yc=$y-abs($width);$yc<=$y+abs($width);$yc++) {

$text1 = imagettftext($im,$size,$angle,$xc,$yc,-$outlinecol,$fontfile,$text);
}
}
// Draw the main text
$text2 = imagettftext($im,$size,$angle,$x,$y,-$col,$fontfile,$text);
}
header( "Content-type: image/png" ); //tells the browser that the content is a PNG file

$font = "volterb.ttf"; //specify font

//these are the attributes
$text = htmlspecialchars($_GET["t"]);
$fontsize = $_GET["s"];
$width = $_GET["w"];

//determine how many pixels (x and y) the text will take up
$size = imagettfbbox($fontsize, 0, $font, $text);
//then use those to determine the appropriate size of the image
$x = (abs($size[0] - $size[2])) + ($width*3);
$y = (abs($size[1] - $size[5])) + ($width*3);

//create the image and add a whitish background that is later removed
$im = imagecreatetruecolor($x, $y);
imageantialias($im, false);
$transparent = imagecolorallocate($im, 255, 255, 254);
imagefill($im, 0, 0, $transparent);
imagecolortransparent($im, $transparent); //set the whitish background to transparent

//determine the appropriate coordinates for the baseline of the font
$left = $size[0] + ($width*2);
$bottom = ($width*2) + $fontsize;

$white = imagecolorallocate( $im, 0xFF, 0xFF, 0xFF ); //font fill color
$black = imagecolorallocate( $im, 0x0, 0x0, 0x0 ); //stroke color
imagettftextoutline($im,$fontsize,0,$left,$bottom, $white,$black,$font,$text,$width); //create text

imagepng( $im ); //create a png image
imagedestroy( $im ); //clear the image from memory
?>

Want to hide these adverts? Register an account for free!