-
Notifications
You must be signed in to change notification settings - Fork 0
/
createImageset.sh
executable file
·59 lines (43 loc) · 1016 Bytes
/
createImageset.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
#! /bin/bash
function convert2pdf() {
cd "$DIR/$COLOR/resized"
mkdir -p ../pdf
for f in *.svg
do
echo "creating pdf from ${f}"
cairosvg "$f" -o "../pdf/$DIR-${f%.svg}.pdf"
done
cd -
}
function resizeSVGs() {
SIZE=$1
cd "$DIR/$COLOR/svg"
mkdir -p ../resized
for f in *.svg
do
echo "resizing ${f}"
sed -e "s/width=\"1792\"/width=\"$SIZE\"/" -e "s/height=\"1792\"/height=\"$SIZE\"/" "$f" > "../resized/$f"
done
cd -
}
function generateColorset() {
SIZE=$3
DIR=$1
COLOR=$2
font-awesome-svg-png --no-png --color "$COLOR" --dest "$DIR"
resizeSVGs $SIZE
convert2pdf
# cleanup
rm -rf "$DIR/$COLOR/svg"
rm -rf "$DIR/$COLOR/resized"
}
sizes=(25 44)
for size in "${sizes[@]}"
do
generateColorset "black-$size" "#000000" $size
generateColorset "white-$size" "#FFFFFF" $size
generateColorset "corn-$size" "#EEC100" $size
generateColorset "brandeis-blue-$size" "#0370E9" $size
generateColorset "steel-$size" "#686868" $size
generateColorset "tangelo-$size" "#F94710" $size
done