3 # Routino icons Perl script
5 # Part of the Routino routing software.
7 # This file Copyright 2008-2010 Andrew M. Bishop
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU Affero General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU Affero General Public License for more details.
19 # You should have received a copy of the GNU Affero General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
27 @names=("red","grey");
28 @borders=("black","grey");
29 @letters=("red","grey");
31 foreach $character ('0'..'9','home')
33 foreach $colour (0..$#names)
35 $image=Graphics::Magick->new;
36 $image->Set(size => "63x75");
38 $image->ReadImage('xc:white');
39 $image->Transparent('white');
41 $image->Draw(primitive => polygon, points => '1,32 32,73 61,32 32,10',
42 stroke => $borders[$colour], fill => 'white', strokewidth => 6,
43 antialias => 'false');
45 $image->Draw(primitive => arc, points => '1,1 61,61 -180,0',
46 stroke => $borders[$colour], fill => 'white', strokewidth => 6,
47 antialias => 'false');
49 if($character eq 'home')
51 $home=Graphics::Magick->new;
53 $home->ReadImage("home.png");
55 $home->Opaque(fill => $names[$colour], color => 'black');
57 $image->Composite(image => $home, compose => Over,
58 x => 32-$home->Get('width')/2, y => 26-$home->Get('height')/2);
62 ($x_ppem, $y_ppem, $ascender, $descender, $width, $height, $max_advance) =
63 $image->QueryFontMetrics(text => $character, font => 'Helvetica', pointsize => '36');
65 $image->Annotate(text => $character, font => 'Helvetica', pointsize => '36',
66 stroke => $letters[$colour], fill => $letters[$colour],
67 x => 32, y => 32-$descender, align => Center,
68 antialias => 'false');
71 $image->Resize(width => 21, height => 25);
73 $image->Write("marker-$character-$names[$colour].png");
79 # Balls for visualiser descriptions
92 foreach $colour (0..9)
94 $image=Graphics::Magick->new;
95 $image->Set(size => "9x9");
97 $image->ReadImage('xc:white');
98 $image->Transparent('white');
100 $image->Draw(primitive => circle, points => '4,4 4,8',
101 fill => $colours[$colour], stroke => $colours[$colour],
102 antialias => 'false');
104 $image->Write("ball-$colour.png");
111 foreach $limit (1..160)
116 foreach $limit (10..200)
118 &draw_limit(sprintf "%.1f",$limit/10);
123 unlink "limit-0.png";
124 link "limit-no.png","limit-0.png";
126 unlink "limit-0.0.png";
127 link "limit-no.png","limit-0.0.png";
133 $image=Graphics::Magick->new;
134 $image->Set(size => "57x57");
136 $image->ReadImage('xc:white');
137 $image->Transparent('white');
139 $image->Draw(primitive => circle, points => '28,28 28,55',
140 stroke => 'red', fill => 'white', strokewidth => 3,
141 antialias => 'false');
143 ($x_ppem, $y_ppem, $ascender, $descender, $width, $height, $max_advance) =
144 $image->QueryFontMetrics(text => "$limit", font => 'Helvetica', pointsize => '22');
146 $image->Annotate(text => "$limit", font => 'Helvetica', pointsize => '22',
147 stroke => 'black', fill => 'black',
148 x => 28, y => 28-$descender, align => Center,
149 antialias => 'false');
151 $image->Resize(width => 19, height => 19);
153 $image->Write("limit-$limit.png");