3 # Update generated stuff in graphics/ from the source files.
5 # It would be nice to do this with waf but:
6 # a) getting the wscript right is a complete pain in the arse
7 # b) running Inkscape from the command line on OS X is a complete pain in the arse
10 if [ `basename $pwd` != "graphics" ]; then
11 echo "$0: run within graphics/"
15 svg_apps="dcpomatic2_kdm dcpomatic2_server dcpomatic2_batch dcpomatic2_player dcpomatic2_playlist dcpomatic2_disk"
17 if [ `uname -s` == "Darwin" ]; then
18 # Convert OS X icons using OS X-only iconutil
19 for p in dcpomatic2 $svg_apps; do
20 iconutil --convert icns --output osx/$p.icns osx/$p.iconset
24 for c in icotool convert inkscape; do
25 if [ ! -x "$(command -v $c)" ]; then
31 INKSCAPE="inkscape -z -C -e"
33 # OS X application icons
35 for r in 16 32 128 256 512; do
36 for p in dcpomatic2; do
37 mkdir -p osx/$p.iconset
38 convert src/dcpomatic.png -resize $rx$r osx/$p.iconset/icon_${r}x${r}.png
39 convert src/dcpomatic.png -resize $rx$r osx/$p.iconset/icon_${r}x${r}@2x.png
41 for p in $svg_apps; do
42 mkdir -p osx/$p.iconset
43 $INKSCAPE osx/$p.iconset/icon_${r}x${r}.png -w $r -h $r src/$p.svg
44 $INKSCAPE osx/$p.iconset/icon_${r}x${r}@2x.png -w $r -h $r src/$p.svg
48 # Linux application icons
50 for r in 16 22 32 48 64 128 256 512; do
52 convert src/dcpomatic.png -resize $rx$r linux/$r/dcpomatic2.png
53 for p in $svg_apps; do
54 $INKSCAPE linux/$r/$p.png src/$p.svg -w $r -h $r
58 # Windows application icons
60 for p in dcpomatic2 $svg_apps; do
61 icotool -c -o windows/$p.ico linux/16/$p.png linux/32/$p.png linux/48/$p.png linux/64/$p.png linux/128/$p.png
63 convert src/dcpomatic.png -resize 400x400 windows/dcpomatic.bmp
65 # OS X preferences icons
66 # servers.png does not have an SVG version
67 mkdir -p osx/preferences
68 for i in colour_conversions defaults email kdm_email cover_sheet keys tms notifications locations sound; do
69 $INKSCAPE osx/preferences/$i.png src/$i.svg -w 32 -h 32
72 # OS X menu bar icon for the server
73 $INKSCAPE osx/dcpomatic_small.png -w 64 -h 64 src/dcpomatic_small.svg
75 # Splash screen (all platforms)
76 $INKSCAPE splash.png src/splash.svg -w 400 -h 300
78 # Timeline toolbar icons (all platforms)
79 for i in select zoom zoom_all snap sequence; do
80 $INKSCAPE $i.png src/$i.svg -w 32 -h 32
83 # Playlist editor tick/no-tick
84 $INKSCAPE tick.png src/tick.svg -w 16 -h 16
85 $INKSCAPE no_tick.png src/no_tick.svg -w 16 -h 16
89 convert src/web.png -resize 256x256 -transparent white web/favicon-256x256.png
90 for r in 16 32 64 128; do
91 convert web/favicon-256x256.png -resize $rx$r web/favicon-${r}x${r}.png
93 convert web/favicon-16x16.png web/favicon-32x32.png web/favicon-64x64.png web/favicon-128x128.png web/favicon-256x256.png web/favicon.ico
94 convert src/web.png -resize 123x123 -transparent white web/logo.png