#!/usr/bin/perl use GD; use strict; use warnings; my ($w, $h) = (50, 50); my $img = GD::Image->new($w, $h); my $white = $img->colorAllocate(255,255,255); my $black = $img->colorAllocate(0,0,0); my %pixmap = (); my $monaco = GD::Font->load('/System/Library/Fonts/Monaco.dfont') or die "Can't load monaco!"; $img->rectangle(10,10,20,20,$black); #this gives me a bus error #$img->stringFT($black,'/System/Library/Fonts/Monaco.dfont',12,0,10,10,'A'); #this does nothing #$img->stringFT($black,$monaco,12,0,10,10,'A'); #this dies with "font is not of type GD::Font " #$img->string('/System/Library/Fonts/Monaco.dfont',10,10,'A',$black); #this one does nothing #$img->string($monaco,10,10,'A',$black); $img->rectangle(0,0,10,10,$black); open (IMG, ">/Users/jim/Desktop/img.png"); print IMG $img->png; close IMG;