forked from ge0rg/yaxim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
export-icons.sh
executable file
·52 lines (42 loc) · 1.13 KB
/
export-icons.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
# convert a single svg file into a png in the according drawable dir
svg2png() {
basename=$1
width=$2
height=$3
dest=$4
inkscape --export-png=res/$dest/$basename.png --export-width=$width --export-height=$height --export-background-opacity=0,0 -C -z asset-graphics/$basename.svg
}
svg2icon() {
basename=$1
svg2png $basename 36 36 drawable-ldpi
svg2png $basename 48 48 drawable
svg2png $basename 72 72 drawable-hdpi
svg2png $basename 96 96 drawable-xhdpi
}
# a roster status icon is 66% of a regular icon
svg2status() {
basename=$1
svg2png $basename 24 24 drawable-ldpi
svg2png $basename 32 32 drawable
svg2png $basename 48 48 drawable-hdpi
svg2png $basename 64 64 drawable-xhdpi
}
# a status bar icon is 24x38 on hdpi, and has according downscaled sizes
svg2sbar() {
basename=$1
svg2png $basename 12 19 drawable-ldpi
svg2png $basename 16 25 drawable
svg2png $basename 24 38 drawable-hdpi
}
# convert icon
svg2icon icon
# convert statusbar notification icon
svg2sbar sb_message
# convert status
# convert paw status
for file in `ls asset-graphics/ic_*.svg`
do
basename=`basename $file .svg`
svg2status $basename
done