Jump to content

Archived

This topic is now archived and is closed to further replies.

idahoprime

I need help changing font in a countdown script

Recommended Posts

Hi, please help me! lol its driving me crazy. I have the countdown script running at my site ( www.kal-el.org )

all i want to do is make the font be trebuchet. I cannot get it to work! Im not sure how to edit the imagestring!

please help me! i have the ttf uploaded to my server, not sure if thats needed or not. its at [a href=\"http://www/kal-el.org/trubuc.ttf\" target=\"_blank\"]http://www/kal-el.org/trubuc.ttf[/a]

i understand i might need to use imagettftext instead of imagestring, but i reall dont know what im doing, im lucky i got it this far. Im hoping someone can please help me out with this font problem...

here is the code i am using now:

thanks!

---------------------------

[img src=\"http://www.kal-el.org/countdown.png\" border=\"0\" alt=\"IPB Image\" /]


<?
// Bizzar PHP GD Countdown Script
// Written by: Brad Derstine (Brad@BizzarScripts.net)

$month = 6; // Month of the countdown
$day = 30; // Day of the countdown
$year = 2006; // Year of the countdown

// mktime is the marked time, and time() is the current time.
$target = mktime(0,0,0,$month,$day,$year);
$diff = $target - time();

$days = ($diff - ($diff % 86400)) / 86400;
$diff = $diff - ($days * 86400);
$hours = ($diff - ($diff % 3600)) / 3600;
$diff = $diff - ($hours * 3600);
$minutes = ($diff - ($diff % 60)) / 60;
$diff = $diff - ($minutes * 60);
$seconds = ($diff - ($diff % 1)) / 1;

header ("Content-type: image/png");
$imgname = "houseofel.png";
$im = @imagecreatefrompng ($imgname);

//Here are some common color codes in case you want to change the colors.
//$white = imagecolorallocate ($im, 255, 255, 255);
//$blue = imagecolorallocate ($im, 0, 0, 255);
//$black = imagecolorallocate ($im,0,0,0);
//$gray = imagecolorallocate ($im,153,153,153);
//$red = imagecolorallocate ($im,255,0,0);
//$orange = imagecolorallocate ($im, 255, 127, 36);

$background_color = imagecolorallocate ($im, 0, 0, 0);
$orange = imagecolorallocate ($im, 255, 127, 36);
$yellow = imagecolorallocate ($im, 247, 246, 201);
$red = imagecolorallocate ($im, 163, 37, 41);
$blue = imagecolorallocate ($im, 2, 137, 185);
$gold = imagecolorallocate ($im, 246, 164, 39);
imagestring ($im, 8, 44, 255, "SUPERMAN RETURNS", $gold);
imagestring ($im, 2, 51, 275, "IN $days DAYS & $hours HOUR(S)", $gold);
imagepng ($im);
imagedestroy ($im);
?>

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.