1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 03:35:53 +01:00

Added icns generation script

This commit is contained in:
Martin Tůma 2018-04-14 20:30:44 +02:00
parent daf0cf6f9d
commit 6266d71463
3 changed files with 31 additions and 2 deletions

28
icons/scripts/icns.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
EXTENSIONS="fit:#006600 gpx:#003399 igc:#ff3300 kml:#990000 nmea:#0083d7 \
plt:#66ff00 rte:#66ff00 tcx:#ffcc00 wpt:#66ff00"
for e in $EXTENSIONS; do
IFS=":"; set $e
EXT=`echo $1 | tr /a-z/ /A-Z/`
sed -e "s/\$EXTENSION/$EXT/" -e "s/\$COLOR/$2/" icon-template.svg > $1.svg
ICONSET=$1.iconset
mkdir $ICONSET
convert -background none -resize '!16x16' "$1.svg" "$ICONSET/icon_16x16.png"
convert -background none -resize '!32x32' "$1.svg" "$ICONSET/icon_16x16@2x.png"
cp "$ICONSET/icon_16x16@2x.png" "$ICONSET/icon_32x32.png"
convert -background none -resize '!64x64' "$1.svg" "$ICONSET/icon_32x32@2x.png"
convert -background none -resize '!128x128' "$1.svg" "$ICONSET/icon_128x128.png"
convert -background none -resize '!256x256' "$1.svg" "$ICONSET/icon_128x128@2x.png"
cp "$ICONSET/icon_128x128@2x.png" "$ICONSET/icon_256x256.png"
convert -background none -resize '!512x512' "$1.svg" "$ICONSET/icon_256x256@2x.png"
cp "$ICONSET/icon_256x256@2x.png" "$ICONSET/icon_512x512.png"
convert -background none -resize '!1024x1024' "$1.svg" "$ICONSET/icon_512x512@2x.png"
iconutil -c icns -o $1.icns "$ICONSET"
rm -R "$ICONSET" $1.svg
done

View File

@ -8,5 +8,6 @@ for e in $EXTENSIONS; do
EXT=`echo $1 | tr /a-z/ /A-Z/`
sed -e "s/\$EXTENSION/$EXT/" -e "s/\$COLOR/$2/" icon-template.svg > $1.svg
convert -density 384 $1.svg -define icon:auto-resize $1.ico
convert $1.svg -define icon:auto-resize $1.ico
rm $1.svg
done

View File

@ -12,6 +12,6 @@
</g>
<g transform="translate(16.573463,124.9782)">
<rect y="0" x="0" id="textrect" height="50" width="120" style="fill:$COLOR;fill-opacity:1;stroke:none;"/>
<text y="28" x="60" dominant-baseline="central" text-anchor="middle" style="fill:#FFFFFF;font-family:Arial,sans-serif;font-weight:bold;font-size:39px">$EXTENSION</text>
<text y="28" x="60" dominant-baseline="central" text-anchor="middle" style="fill:#FFFFFF;font-size:39px;font-family:sans-serif;font-weight:bold;">$EXTENSION</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB