forked from twitter/twemoji
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvg.sh
34 lines (30 loc) · 724 Bytes
/
svg.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
createsvg() {
local d
local svg
for d in assets/*.ai; do
svg=$(echo "$d" | sed 's/.ai/.svg/')
echo "creating $svg ..."
inkscape -f "$d" -l "$svg"
done
mkdir -p svg
mv assets/*.svg svg/
}
viewport() {
local f
for f in svg/*.svg; do
content=$(
cat "$f" |
sed 's/<!-- Created with Inkscape (http:\/\/inkscape.org\/) -->//' |
sed 's/viewBox="0 0 47.5 47.5"//' |
sed 's/height="47.5"/viewBox="0 0 47.5 47.5"/' |
sed 's/width="47.5"/style="enable-background:new 0 0 47.5 47.5;"/' |
sed -e ':a' -e 'N' -e '$!ba' -e 's/\n//g' |
sed -e 's/ */ /g' |
sed -e 's/ \/>/\/>/g'
)
echo "$f"
echo "$content" >"$f"
done
}
createsvg
viewport