icon: Create all icons from .svg files
authorKeith Packard <keithp@keithp.com>
Sun, 15 Jun 2014 00:51:46 +0000 (17:51 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 15 Jun 2014 00:51:46 +0000 (17:51 -0700)
Remove images from repository, leaving only the svg files and build
instructions

Signed-off-by: Keith Packard <keithp@keithp.com>
26 files changed:
debian/control
icon/.gitignore [new file with mode: 0644]
icon/Makefile.am
icon/altus-metrum-128.png [deleted file]
icon/altus-metrum-16.png [deleted file]
icon/altus-metrum-256.png [deleted file]
icon/altus-metrum-32.png [deleted file]
icon/altus-metrum-48.png [deleted file]
icon/altus-metrum-512.png [deleted file]
icon/altus-metrum-64.png [deleted file]
icon/altus-metrum.ico [deleted file]
icon/make-png [new file with mode: 0755]
icon/micro-peak.ico [deleted file]
icon/micropeak-128.png [deleted file]
icon/micropeak-16.png [deleted file]
icon/micropeak-256.png [deleted file]
icon/micropeak-32.png [deleted file]
icon/micropeak-48.png [deleted file]
icon/micropeak-64.png [deleted file]
icon/telegps-128.png [deleted file]
icon/telegps-16.png [deleted file]
icon/telegps-256.png [deleted file]
icon/telegps-32.png [deleted file]
icon/telegps-48.png [deleted file]
icon/telegps-64.png [deleted file]
icon/telegps.ico [deleted file]

index 13f8e1a..1d4ee52 100644 (file)
@@ -3,7 +3,7 @@ Section: electronics
 Priority: optional
 Maintainer: Bdale Garbee <bdale@gag.com>
 Uploaders: Keith Packard <keithp@keithp.com>
-Build-Depends: debhelper (>= 7), autoconf, automake, gawk, libreadline-dev, libusb-1.0-0-dev, nickle, cc1111, xsltproc, fop, xmlto, docbook-xml, docbook-xsl, swig, default-jdk, freetts, libtool, libjfreechart-java, libbluetooth-dev, pkg-config, libelf-dev, libbluetooth-dev, libssl-dev, gcc-arm-none-eabi, icoutils, librsvg2-bin
+Build-Depends: debhelper (>= 7), autoconf, automake, gawk, libreadline-dev, libusb-1.0-0-dev, nickle, cc1111, xsltproc, fop, xmlto, docbook-xml, docbook-xsl, swig, default-jdk, freetts, libtool, libjfreechart-java, libbluetooth-dev, pkg-config, libelf-dev, libbluetooth-dev, libssl-dev, gcc-arm-none-eabi, icoutils, librsvg2-bin, icnsutils
 Standards-Version: 3.9.5
 Homepage: http://altusmetrum.org/AltOS
 Vcs-Git: git://git.gag.com/fw/altos
diff --git a/icon/.gitignore b/icon/.gitignore
new file mode 100644 (file)
index 0000000..e89555d
--- /dev/null
@@ -0,0 +1,6 @@
+altus-metrum-*.png
+micropeak-*.png
+telegps-*.png
+*.ico
+*.icns
+*.build
index 60afdb1..db5577d 100644 (file)
@@ -1,10 +1,17 @@
-RES=16 32 48 64 128 256
+LINUX_RES=16 32 48 64 128 256 512
+MAC_RES=16 32 128 256 512
+WIN_RES=16 24 32 48 64 72 96 128 180 256
+RES=$(shell echo $(LINUX_RES) $(MAC_RES) $(WIN_RES) | awk '{ for (i = 1; i <= NF; i++) printf("%s\n", $$i); }' | sort -n -u)
 
 AM_FILES=$(shell for i in $(RES); do echo altus-metrum-$$i.png; done)
 MP_FILES=$(shell for i in $(RES); do echo micropeak-$$i.png; done)
 TG_FILES=$(shell for i in $(RES); do echo telegps-$$i.png; done)
+MAC_TG_FILES=$(shell for i in $(MAC_RES); do echo telegps-$$i.png; done)
+MAC_MP_FILES=$(shell for i in $(MAC_RES); do echo micropeak-$$i.png; done)
+MAC_AM_FILES=$(shell for i in $(MAC_RES); do echo altus-metrum-$$i.png; done)
 
 ICO_FILES=altus-metrum.ico micro-peak.ico telegps.ico
+ICNS_FILES=AltosUIIcon.icns TeleGPS.icns MicroPeak.icns
 
 icondir = $(datadir)/icons/hicolor/scalable/apps
 
@@ -16,10 +23,28 @@ icon_DATA = $(AM_ICON) $(MP_ICON) $(TG_ICON)
 
 EXTRA_DIST = $(icon_DATA) $(AM_FILES) $(MP_FILES) $(TG_FILES)
 
-all-local: $(ICO_FILES)
+res:
+       echo $(RES)
 
-$(TG_FILES): telegps.svg
-       for i in $(RES); do rsvg-convert -w $$i -o telegps-$$i.png telegps.svg; done
+all-local: $(ICO_FILES) $(ICNS_FILES)
+
+clean-local:
+       $(RM) $(TG_FILES) $(MP_FILES) $(ICO_FILES) $(ICNS_FILES) *.build
+
+$(AM_FILES): altusmetrum.build
+
+altusmetrum.build: altusmetrum.svg
+       for i in $(RES); do ./make-png altusmetrum.svg $$i altus-metrum-$$i.png; done && touch $@
+
+$(TG_FILES): telegps.build
+
+telegps.build: telegps.svg
+       for i in $(RES); do ./make-png telegps.svg $$i telegps-$$i.png; done && touch $@
+
+$(MP_FILES): micropeak.build
+
+micropeak.build: micropeak.svg
+       for i in $(RES); do ./make-png micropeak.svg $$i micropeak-$$i.png; done && touch $@
 
 #clean-local:
 #      $(RM) -f $(ICO_FILES)
@@ -32,3 +57,12 @@ micro-peak.ico: $(MP_FILES)
 
 telegps.ico: $(TG_FILES)
        icotool -c -o $@ $(TG_FILES)
+
+AltosUIIcon.icns: $(MAC_AM_FILES)
+       png2icns $@ $(MAC_AM_FILES)
+
+TeleGPS.icns: $(MAC_TG_FILES)
+       png2icns $@ $(MAC_TG_FILES)
+
+MicroPeak.icns: $(MAC_MP_FILES)
+       png2icns $@ $(MAC_MP_FILES)
diff --git a/icon/altus-metrum-128.png b/icon/altus-metrum-128.png
deleted file mode 100644 (file)
index f1343d9..0000000
Binary files a/icon/altus-metrum-128.png and /dev/null differ
diff --git a/icon/altus-metrum-16.png b/icon/altus-metrum-16.png
deleted file mode 100644 (file)
index 5bd4599..0000000
Binary files a/icon/altus-metrum-16.png and /dev/null differ
diff --git a/icon/altus-metrum-256.png b/icon/altus-metrum-256.png
deleted file mode 100644 (file)
index 46e1670..0000000
Binary files a/icon/altus-metrum-256.png and /dev/null differ
diff --git a/icon/altus-metrum-32.png b/icon/altus-metrum-32.png
deleted file mode 100644 (file)
index c858889..0000000
Binary files a/icon/altus-metrum-32.png and /dev/null differ
diff --git a/icon/altus-metrum-48.png b/icon/altus-metrum-48.png
deleted file mode 100644 (file)
index 3bee98e..0000000
Binary files a/icon/altus-metrum-48.png and /dev/null differ
diff --git a/icon/altus-metrum-512.png b/icon/altus-metrum-512.png
deleted file mode 100644 (file)
index 47c4700..0000000
Binary files a/icon/altus-metrum-512.png and /dev/null differ
diff --git a/icon/altus-metrum-64.png b/icon/altus-metrum-64.png
deleted file mode 100644 (file)
index 0ee086a..0000000
Binary files a/icon/altus-metrum-64.png and /dev/null differ
diff --git a/icon/altus-metrum.ico b/icon/altus-metrum.ico
deleted file mode 100644 (file)
index bedf04e..0000000
Binary files a/icon/altus-metrum.ico and /dev/null differ
diff --git a/icon/make-png b/icon/make-png
new file mode 100755 (executable)
index 0000000..748cf32
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+case $# in
+3)
+       ;;
+*)
+       echo "Usage: $0 <input.svg> <size> <output.png>" 1>&2
+       exit 1
+       ;;
+esac
+
+SVG=$1
+SIZE=$2
+PNG=$3
+
+SHADOW=$(($SIZE / 16))
+IMAGE=$(($SIZE - $SHADOW))
+
+OPACITY=80
+BLUR=$(($SHADOW / 4))
+SHIFT=$(($SHADOW - $BLUR))
+
+echo SHADOW $SHADOW IMAGE $IMAGE OPACITY $OPACITY SHIFT $SHIFT BLUR $BLUR
+
+TMP=image-$$.png
+
+trap "rm $TMP" 0 1 15
+
+rsvg-convert -w $IMAGE -h $IMAGE -o $TMP $SVG
+
+convert $TMP \
+       \( +clone -background black -shadow ${OPACITY}x${BLUR}+${SHIFT}+${SHIFT} \) \
+       +swap -background none -layers merge -crop ${SIZE}x${SIZE}+0+0 +repage $PNG
+
diff --git a/icon/micro-peak.ico b/icon/micro-peak.ico
deleted file mode 100644 (file)
index b672aa0..0000000
Binary files a/icon/micro-peak.ico and /dev/null differ
diff --git a/icon/micropeak-128.png b/icon/micropeak-128.png
deleted file mode 100644 (file)
index f045dc6..0000000
Binary files a/icon/micropeak-128.png and /dev/null differ
diff --git a/icon/micropeak-16.png b/icon/micropeak-16.png
deleted file mode 100644 (file)
index d814080..0000000
Binary files a/icon/micropeak-16.png and /dev/null differ
diff --git a/icon/micropeak-256.png b/icon/micropeak-256.png
deleted file mode 100644 (file)
index b96d470..0000000
Binary files a/icon/micropeak-256.png and /dev/null differ
diff --git a/icon/micropeak-32.png b/icon/micropeak-32.png
deleted file mode 100644 (file)
index d34c5c1..0000000
Binary files a/icon/micropeak-32.png and /dev/null differ
diff --git a/icon/micropeak-48.png b/icon/micropeak-48.png
deleted file mode 100644 (file)
index 86dc4f7..0000000
Binary files a/icon/micropeak-48.png and /dev/null differ
diff --git a/icon/micropeak-64.png b/icon/micropeak-64.png
deleted file mode 100644 (file)
index 6ca7c2e..0000000
Binary files a/icon/micropeak-64.png and /dev/null differ
diff --git a/icon/telegps-128.png b/icon/telegps-128.png
deleted file mode 100644 (file)
index 6b72cc4..0000000
Binary files a/icon/telegps-128.png and /dev/null differ
diff --git a/icon/telegps-16.png b/icon/telegps-16.png
deleted file mode 100644 (file)
index 3010a4e..0000000
Binary files a/icon/telegps-16.png and /dev/null differ
diff --git a/icon/telegps-256.png b/icon/telegps-256.png
deleted file mode 100644 (file)
index 7565b52..0000000
Binary files a/icon/telegps-256.png and /dev/null differ
diff --git a/icon/telegps-32.png b/icon/telegps-32.png
deleted file mode 100644 (file)
index a01d41d..0000000
Binary files a/icon/telegps-32.png and /dev/null differ
diff --git a/icon/telegps-48.png b/icon/telegps-48.png
deleted file mode 100644 (file)
index e9bbda0..0000000
Binary files a/icon/telegps-48.png and /dev/null differ
diff --git a/icon/telegps-64.png b/icon/telegps-64.png
deleted file mode 100644 (file)
index b39c8f6..0000000
Binary files a/icon/telegps-64.png and /dev/null differ
diff --git a/icon/telegps.ico b/icon/telegps.ico
deleted file mode 100644 (file)
index bbe2283..0000000
Binary files a/icon/telegps.ico and /dev/null differ