sinasalek - 2006-06-29 16:29:36
Hi, at first i must thank you for your useful class.
as you know some server doesn't Compiled GD with TrueType, so i changed your code a bit to make it word in this kind of situation.
Best Regards - Sina Salek
-----------------------------------------------------
if ($i%2) ImageTTFText($image, $this -> size, $this -> angle, $x, $this -> size + $this -> grid - mt_rand(0, 5), $stringcolor_1, $this -> font, $str{$i} );
else ImageTTFText($image, $this -> size, $this -> angle, $x, $this -> size + $this -> grid + mt_rand(0, 5), $stringcolor_2, $this -> font, $str{$i} );
-----------changed to-----------
if (is_callable('imagettftext')) {
if ($i%2) ImageTTFText($image, $this -> size, $this -> angle, $x, $this -> size + $this -> grid - mt_rand(0, 5), $stringcolor_1, $this -> font, $str{$i} );
else ImageTTFText($image, $this -> size, $this -> angle, $x, $this -> size + $this -> grid + mt_rand(0, 5), $stringcolor_2, $this -> font, $str{$i} );
} else {
/* Edited By Sina : some server doesn't compile GD with TrueType so i added this lines to solve this problem*/
if ($i%2) imagechar($image, $this -> size, $x, $this -> grid - mt_rand(0, 5), $str{$i},$stringcolor_1 );
else imagechar($image, $this -> size, $x, $this -> grid + mt_rand(0, 5), $str{$i},$stringcolor_2 );
}