#!/usr/bin/perl -w


use strict;
use GD;  # graphics library

# create a new image
   my  $im = new GD::Image(120,25);
   my $font = "/newbury/files/performance/ttf-bitstream-vera-1.10/Vera.ttf";
# allocate some colors
   my  $white = $im->colorAllocate(255,255,255);
   my  $black = $im->colorAllocate(0,0,0);       
   my  $red = $im->colorAllocate(255,0,0);      
   my  $blue = $im->colorAllocate(0,0,255);

# make the background transparent and interlaced
    $im->transparent($white);
    $im->interlaced('true');
# Put a black frame around the picture
    #$im->rectangle(0,0,99,24,$black);
  my ($day,$month,$aux,$num,$time,$year) = split(/ /,localtime());
  
   $day = sprintf "%2i",$num;
#  $month = "Aug";
#  $day = "26";
  my $extra = " !! ";
  my $text = join(' ',$day,$month,$year,$extra);
  $im->stringFT( $red, $font,10,0,10,15,"$text",
    {   linespacing=>0.6,
        charmap  => 'Unicode',
    });
# make sure we are writing to a binary stream
    binmode STDOUT;

# Convert the image to PNG and print it on standard output
open (OUT,">$day.$month.png");
print OUT $im->png;
close OUT;

