4 CONVERT
=${CONVERT:-convert}
5 COMPOSITE
=${COMPOSITE:-composite}
6 INKSCAPE
=${INKSCAPE:-inkscape}
7 PPMTOWINICON
=${PPMTOWINICON:-ppmtowinicon}
16 $0 -- Regenerate desktop icon files and windows icon files
20 --help Displays this message and exits
22 --skip-png Skips the regeneration of the .png file(s)
24 --skip-winicon Skips the regneration of the Windows icon file(s)
30 while test $# -ne 0 ; do
49 echo "$0: Unknown option $1"
60 if test $?
-ne 0 ; then
66 ## Export the SVG graphics
69 # see if we have inkscape
70 if test $do_inkscape = yes ; then
71 ${INKSCAPE} --version 2>&1 >/dev
/null
72 if test $?
-ne 0 ; then
73 echo "\"${INKSCAPE} --version\" failed."
74 echo "Make sure that inkscape is installed and functional on your system."
75 echo "Skipping the SVG -> PNG conversion."
80 if test $do_inkscape = yes ; then
81 echo "Export SVG graphics to png..."
83 for r
in 16 22 24 32 48 ; do
96 for f
in *-${rs}.svg
; do
97 fb
=`basename ${f} ${rs}.svg`
100 ${INKSCAPE} --export-png=${p} --export-area=${x}:${x}:${y}:${y} ${f}
106 ## Generate the windows icon file
109 app_icon
="application-x-pcb-layout"
111 if test $do_convert = yes ; then
112 # see if we have ImageMagick
113 ${CONVERT} --version 2>&1 >/dev
/null
114 if test $?
-ne 0 ; then
115 echo "\"${CONVERT} --version\" failed."
116 echo "Make sure that ImageMagick is installed and functional on your system."
117 echo "Skipping the PNG -> PPM conversion."
122 if test $do_convert = yes ; then
123 echo "Creating windows pbm mask files..."
124 ${CONVERT} -channel matte
-separate +matte
${app_icon}-48.png
- |
125 ${CONVERT} -threshold 65534 -negate - 48_mask.pbm
126 ${CONVERT} -channel matte
-separate +matte
${app_icon}-32.png
- |
127 ${CONVERT} -threshold 65534 -negate - 32_mask.pbm
128 ${CONVERT} -channel matte
-separate +matte
${app_icon}-16.png
- |
129 ${CONVERT} -threshold 65534 -negate - 16_mask.pbm
131 echo "Creating windows ppm flattened files..."
132 ${CONVERT} -flatten -colors 16 ${app_icon}-48.png
48_16.ppm
133 ${CONVERT} -flatten -colors 256 ${app_icon}-48.png
48_256.ppm
134 ${CONVERT} -flatten -colors 16 ${app_icon}-32.png
32_16.ppm
135 ${CONVERT} -flatten -colors 256 ${app_icon}-32.png
32_256.ppm
136 ${CONVERT} -flatten -colors 16 ${app_icon}-16.png
16_16.ppm
137 ${CONVERT} -flatten -colors 256 ${app_icon}-16.png
16_256.ppm
140 # see if we have netpbm
141 if test $do_winicon = yes ; then
142 ${PPMTOWINICON} --version 2>&1 >/dev
/null
143 if test $?
-ne 0 ; then
144 echo "\"${PPMTOWINICON} --version\" failed."
145 echo "Make sure that netpbm is installed and functional on your system."
146 echo "Skipping the pbm -> windows icon conversion."
151 if test $do_winicon = yes ; then
152 echo "Creating windows icon file..."
153 ${PPMTOWINICON} -output pcb_icon.ico
-andpgms\
154 48_16.ppm
48_mask.pbm
48_256.ppm
48_mask.pbm\
155 32_16.ppm
32_mask.pbm
32_256.ppm
32_mask.pbm\
156 16_16.ppm
16_mask.pbm
16_256.ppm
16_mask.pbm
160 48_16.ppm
48_256.ppm
48_mask.pbm\
161 32_16.ppm
32_256.ppm
32_mask.pbm\
162 16_16.ppm
16_256.ppm
16_mask.pbm