Thanks a lot but I'm incapable of building Gtk2. It may be possible but seems not to worth the effort as of yet. I would rather put something to work with the means easily accesible. With Imager suggested by Anonymous Monk I was able to put together this code:
use Imager;
my $icon_width=128;
my $icon_height=128;
my $image = Imager->new(xsize => $icon_width, ysize => $icon_height);
$image->box(
xmin=>0,
ymin=>0,
xmax=>$icon_width-1,
ymax => $icon_height-1,
filled => 1, color => '#ffffff'
);
my $font_filename = 'C:/Windows/Fonts/arialbd.ttf';
my $font = Imager::Font->new(file=>$font_filename) or die "Cannot loa
+d $font_filename: ", Imager->errstr;
print "Enter number: ";my $text=<>;chomp($text);
my $text_size = 96;
$font->align(
string => $text,
size => $text_size,
color => '#000000',
x => $image->getwidth/2,
y => $image->getheight/2,
halign => 'center',
valign => 'center',
image => $image
);
$image->write(file=>'number.ico') or die 'Cannot save image: ', $image
+->errstr;
It is a little bit weird (my be this is not the right font for this) but it works.