images/genicons.sh
author Edouard Tisserant <edouard.tisserant@gmail.com>
Thu, 04 Apr 2024 17:31:49 +0200
changeset 3926 a6ec38dcbfb5
parent 3889 e9ad68178d36
permissions -rwxr-xr-x
Modbus: add CI test + test project
2238
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
     1
#!/bin/sh
197
a50b5fa04c57 SVG/Inkscape based icon generation script + SVG drawing.
etisserant
parents:
diff changeset
     2
a50b5fa04c57 SVG/Inkscape based icon generation script + SVG drawing.
etisserant
parents:
diff changeset
     3
INKSCAPE=inkscape
a50b5fa04c57 SVG/Inkscape based icon generation script + SVG drawing.
etisserant
parents:
diff changeset
     4
2238
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
     5
for fname in `ls *.svg`; do
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
     6
    for i in `cat $fname |grep -o -e '%%[^%]*%%'|sed 's/%//g'` 
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
     7
    do
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
     8
        if [ $i.png -nt $fname ]; then
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
     9
 	    echo "Skip $i"
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    10
        else
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    11
	    rm  -f $i.png
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    12
	    echo "$INKSCAPE" $fname -z -e $i.png -i $i
3889
e9ad68178d36 IDE. update genicons.sh to inkscape 1.1 command line
Edouard Tisserant <edouard@beremiz.fr>
parents: 3574
diff changeset
    13
	    "$INKSCAPE" $fname -o $i.png -i $i
2238
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    14
        fi
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    15
    done
197
a50b5fa04c57 SVG/Inkscape based icon generation script + SVG drawing.
etisserant
parents:
diff changeset
    16
done
a50b5fa04c57 SVG/Inkscape based icon generation script + SVG drawing.
etisserant
parents:
diff changeset
    17
2238
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    18
cp ico024.png brz.png
3574
889cbde22ec4 IDE+runtime: Fix .ico generation
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3569
diff changeset
    19
convert -compress none ico???.png brz.ico
3569
419f17564583 IDE: fix image generation from svg script that was deleting to many files on cleanup
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2238
diff changeset
    20
rm -f ico???.png
2238
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    21
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    22
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    23
convert -compress none poeico*.png poe.ico
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    24
rm -f poeico*.png
a01a3ed1af2c Take plcopen_icons.svg as source of png icons as well
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 533
diff changeset
    25