#!/usr/bin/perl -w

# Small hack to convert text to images
# - SAR

use GD;
use GD::Text;
use strict;

my ($gdText, $w, $h);
my ($im, $white, $black);

$gdText = GD::Text->new();

$gdText->set_font(gdSmallFont);

$gdText->set_text($ARGV[0]);

($w, $h) = $gdText->get('width', 'height');

$im = new GD::Image($w, $h);

$white = $im->colorAllocate(255, 255, 255);
$black = $im->colorAllocate(0, 0, 0);

#$im->transparent($white);

$im->string(gdSmallFont, 0, 0, $ARGV[0], $black);

binmode STDOUT;

print $im->png;
