in reply to Converting X11 fonts for GD
#!/usr/bin/perl use GD; use strict; use warnings; my ($w, $h) = (200, 200); my $img = GD::Image->new($w, $h); my $white = $img->colorAllocate(255,255,255); my $black = $img->colorAllocate(0,0,0); # this line causes a premature exit with "success". #my $monaco = GD::Font->load('Generic.ttf');# or die "Can't load monac +o!"; $img->rectangle(10,10,20,20,$black); # Generic.ttf is in script's working directory $img->stringFT($black,"./Generic.ttf",72,0,100,100,'A'); open (IMG, ">$0.png"); print IMG $img->png; close IMG;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Converting X11 fonts for GD
by BrowserUk (Patriarch) on Aug 23, 2012 at 15:42 UTC | |
by zentara (Cardinal) on Aug 23, 2012 at 19:17 UTC | |
by BrowserUk (Patriarch) on Aug 23, 2012 at 23:14 UTC |