2011-09-14 18:28:57 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# make icons using Inkscape
|
2022-01-23 04:32:16 +00:00
|
|
|
# inkscape (1.0.2 minimum) and icotool are necessary
|
2011-09-14 18:28:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
# create output directories
|
|
|
|
rm -r tmp
|
|
|
|
rm icon_*.png
|
|
|
|
mkdir tmp
|
2024-02-10 04:52:47 +00:00
|
|
|
mkdir tmp/16 tmp/24 tmp/32 tmp/48 tmp/64 tmp/256 tmp/ico
|
2011-09-14 18:28:57 +00:00
|
|
|
echo "all directories created."
|
2022-01-23 02:08:01 +00:00
|
|
|
cd ../sources/light
|
2011-09-14 18:28:57 +00:00
|
|
|
|
|
|
|
ICON_FILES="icon_3d.svg
|
|
|
|
icon_gerbview.svg
|
|
|
|
icon_kicad.svg
|
2022-01-23 02:08:01 +00:00
|
|
|
icon_kicad_nightly.svg
|
2011-09-14 18:28:57 +00:00
|
|
|
icon_bitmap2component.svg
|
|
|
|
icon_pcbcalculator.svg
|
2022-01-23 02:08:01 +00:00
|
|
|
icon_pagelayout_editor.svg
|
2011-09-14 18:28:57 +00:00
|
|
|
icon_cvpcb.svg
|
|
|
|
icon_pcbnew.svg
|
2020-10-26 10:54:36 +00:00
|
|
|
icon_eeschema.svg
|
|
|
|
icon_pcm.svg"
|
2011-09-14 18:28:57 +00:00
|
|
|
|
|
|
|
# convert .svg files into .png files
|
|
|
|
for fl in $ICON_FILES
|
|
|
|
do
|
|
|
|
NAME=${fl%.*} # strip the file extension
|
2024-02-10 04:52:47 +00:00
|
|
|
inkscape -o ../../icons/tmp/16/$NAME.png -w 16 -h 16 --export-area-snap $fl
|
|
|
|
inkscape -o ../../icons/tmp/24/$NAME.png -w 24 -h 24 --export-area-snap $fl
|
2022-01-23 04:32:16 +00:00
|
|
|
inkscape -o ../../icons/tmp/32/$NAME.png -w 32 -h 32 --export-area-snap $fl
|
|
|
|
inkscape -o ../../icons/tmp/48/$NAME.png -w 48 -h 48 --export-area-snap $fl
|
|
|
|
inkscape -o ../../icons/tmp/64/$NAME.png -w 64 -h 64 --export-area-snap $fl
|
|
|
|
inkscape -o ../../icons/tmp/256/$NAME.png -w 256 -h 256 --export-area-snap $fl
|
2011-09-14 18:28:57 +00:00
|
|
|
echo "file $fl converted."
|
|
|
|
done
|
|
|
|
|
2021-06-09 19:32:58 +00:00
|
|
|
# convert .png files into .ico files using "icotool" from icoutils
|
2018-01-13 16:05:09 +00:00
|
|
|
# (see http://www.nongnu.org/icoutils/)
|
2022-01-23 02:08:01 +00:00
|
|
|
cd ../../icons
|
2011-09-14 18:28:57 +00:00
|
|
|
for fl in $ICON_FILES
|
|
|
|
do
|
|
|
|
NAME=${fl%.*} # strip the file extension
|
2024-02-10 04:52:47 +00:00
|
|
|
icotool -c tmp/16/$NAME.png tmp/24/$NAME.png tmp/32/$NAME.png tmp/48/$NAME.png \
|
|
|
|
tmp/64/$NAME.png tmp/256/$NAME.png -o tmp/ico/$NAME.ico
|
2011-09-14 18:28:57 +00:00
|
|
|
echo "file $fl converted in .ico file."
|
|
|
|
done
|
|
|
|
|
|
|
|
# make mosaic images locally
|
|
|
|
montage tmp/64/*.png -geometry +6+6 -tile x1 all.png
|
|
|
|
echo "mosaic images created"
|
|
|
|
|
2012-10-28 19:10:07 +00:00
|
|
|
# create png and xpm 64 px from icon_kicad
|
|
|
|
cp tmp/64/icon_kicad.png ./icon_kicad_64.png
|
|
|
|
convert icon_kicad_64.png icon_kicad_64.xpm
|
|
|
|
|
|
|
|
# create png and xpm 128 px from icon_kicad
|
|
|
|
cp tmp/128/icon_kicad.png ./
|
2011-09-14 18:28:57 +00:00
|
|
|
convert icon_kicad.png icon_kicad.xpm
|
|
|
|
|
|
|
|
# delete what is not needed
|
|
|
|
cp tmp/ico/* ./
|
|
|
|
rm -R tmp
|
|
|
|
|