1 |
#!/usr/local/bin/perl -w |
2 |
|
3 |
use Image::Magick; |
4 |
|
5 |
sub dump_gif { |
6 |
my ($text) = @_; |
7 |
my $file=$text; |
8 |
$file=~s/[^a-zA-Z]+/_/g; |
9 |
|
10 |
print "$text"; |
11 |
|
12 |
$image = Image::Magick->new; |
13 |
$image->Set(size=>'125x11'); |
14 |
#$image->Set(size=>'250x30'); |
15 |
$image->ReadImage('xc:#ffffff'); |
16 |
#$image->Read(filename=>"gif:template/contact.gif"); |
17 |
|
18 |
$image->Scale(geometry=>'300%'); |
19 |
|
20 |
#($x_ppem, $y_ppem, $ascender, $descender, $width, $height, $max_advance) = |
21 |
# split(', ', $image->QueryFontMetrics(text=>$text,font=>"\@/usr/local/ttfonts/arialbd.ttf", pointsize=>20)); |
22 |
|
23 |
$image->Annotate(text=>$text, |
24 |
geometry=>'+1+0', |
25 |
font=>"\@/usr/local/ttfonts/arialbd.ttf", |
26 |
pointsize=>35, |
27 |
pen=>'#333399', |
28 |
align=>'left'); |
29 |
|
30 |
#$image->Resize(geometry=>'125x15', filter=>'Lanczos', blur=>1.8); |
31 |
#$image->GaussianBlur(radius=>1); |
32 |
$image->Scale(geometry=>'33%'); |
33 |
|
34 |
#$image->Draw(stroke=>'#cccccc', primitive=>'line', points=>'0,14 118,14', linewidth=>1); |
35 |
#$image->Draw(stroke=>'#cccccc', primitive=>'line', points=>'118,14 118,7', linewidth=>2); |
36 |
|
37 |
|
38 |
if (0) { |
39 |
$image->Annotate(text=> |
40 |
geometry=>'+7+2', |
41 |
font=>"\@/usr/local/ttfonts/arialbd.ttf", |
42 |
pointsize=>10, |
43 |
pen=>'white', |
44 |
align=>'left'); |
45 |
} |
46 |
|
47 |
print " -> "; |
48 |
|
49 |
$image->Trim(); |
50 |
|
51 |
$image->Write(filename=>"gif:b/$file.gif", |
52 |
colors=>256, |
53 |
interlace=>"none", |
54 |
compress=>'lzw'); |
55 |
|
56 |
print "$file.gif\n"; |
57 |
|
58 |
} |
59 |
|
60 |
@words = ( "HOME", "ABOUT US", "PRODUCTS", "INVESTOR'S PAGE", "R&D", |
61 |
"CAREERS", "|", "BACK", "Read More", "PDF" ); |
62 |
|
63 |
foreach (@words) { |
64 |
dump_gif($_); |
65 |
} |