X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=graphics%2Fupdate;h=005bcf3fdb77cbe27e3e91fc502b9bcadfabf83b;hb=bb1c1b89260cf36c621f7f2b471eb23f2ff15b0c;hp=9b75493dbd94a0e5480d92540241f06a2d2ad6f9;hpb=a1f7bf2d9e5610075fbd898cdf52f4f8373741f2;p=dcpomatic.git diff --git a/graphics/update b/graphics/update index 9b75493db..005bcf3fd 100755 --- a/graphics/update +++ b/graphics/update @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e # # Update generated stuff in graphics/ from the source files. # @@ -6,13 +6,27 @@ # a) getting the wscript right is a complete pain in the arse # b) running Inkscape from the command line on OS X is a complete pain in the arse +set -e + pwd=`pwd` if [ `basename $pwd` != "graphics" ]; then echo "$0: run within graphics/" exit 1 fi -svg_apps="dcpomatic2_kdm dcpomatic2_server dcpomatic2_batch dcpomatic2_player dcpomatic2_playlist dcpomatic2_disk" +function required_font() +{ + set +e + check=$(fc-list | grep "$1") + set -e + if [ "$check" == "" ]; then + echo "Missing font $1" + exit 1 + fi +} + +svg_apps="dcpomatic2_kdm dcpomatic2_server dcpomatic2_batch dcpomatic2_player dcpomatic2_playlist dcpomatic2_disk dcpomatic2_combiner dcpomatic2_editor" + if [ `uname -s` == "Darwin" ]; then # Convert OS X icons using OS X-only iconutil @@ -20,15 +34,17 @@ if [ `uname -s` == "Darwin" ]; then iconutil --convert icns --output osx/$p.icns osx/$p.iconset done else + required_font "Libre Baskerville" - for c in icotool convert inkscape; do + INKSCAPE="$HOME/Applications/inkscape" + for c in icotool convert inkbatch $INKSCAPE; do if [ ! -x "$(command -v $c)" ]; then echo "$c is required" exit 1 fi done - INKSCAPE="inkscape -z -C -e" + INKSCAPE_EXPORT="$INKSCAPE -C --export-type=png" # OS X application icons mkdir -p osx @@ -40,8 +56,8 @@ else done for p in $svg_apps; do mkdir -p osx/$p.iconset - $INKSCAPE osx/$p.iconset/icon_${r}x${r}.png -w $r -h $r src/$p.svg - $INKSCAPE osx/$p.iconset/icon_${r}x${r}@2x.png -w $r -h $r src/$p.svg + $INKSCAPE_EXPORT --export-filename=osx/$p.iconset/icon_${r}x${r}.png -w $r -h $r src/$p.svg + $INKSCAPE_EXPORT --export-filename=osx/$p.iconset/icon_${r}x${r}@2x.png -w $r -h $r src/$p.svg done done @@ -51,7 +67,7 @@ else mkdir -p linux/$r convert src/dcpomatic.png -resize $rx$r linux/$r/dcpomatic2.png for p in $svg_apps; do - $INKSCAPE linux/$r/$p.png src/$p.svg -w $r -h $r + $INKSCAPE_EXPORT --export-filename=linux/$r/$p.png src/$p.svg -w $r -h $r done done @@ -63,26 +79,41 @@ else convert src/dcpomatic.png -resize 400x400 windows/dcpomatic.bmp # OS X preferences icons - # servers.png does not have an SVG version mkdir -p osx/preferences - for i in colour_conversions defaults email kdm_email cover_sheet keys tms notifications locations sound; do - $INKSCAPE osx/preferences/$i.png src/$i.svg -w 32 -h 32 + for c in black white; do + for i in defaults email kdm_email cover_sheet keys tms notifications locations sound identifiers servers general advanced non_standard; do + inkbatch --inkscape $INKSCAPE -i bounds-$i -o osx/preferences/${i}_${c}.png --width 32 --height 32 src/preferences_$c.svg + inkbatch --inkscape $INKSCAPE -i bounds-$i -o osx/preferences/${i}@2x_${c}.png --width 64 --height 64 src/preferences_$c.svg + done done - # OS X menu bar icon for the server - $INKSCAPE osx/dcpomatic_small.png -w 64 -h 64 src/dcpomatic_small.svg + # OS X menu bar icon for the server (in dark and light mode) + $INKSCAPE_EXPORT --export-filename=osx/dcpomatic_small_white.png -w 64 -h 64 src/dcpomatic_small_white.svg + $INKSCAPE_EXPORT --export-filename=osx/dcpomatic_small_black.png -w 64 -h 64 src/dcpomatic_small_black.svg # Splash screen (all platforms) - $INKSCAPE splash.png src/splash.svg -w 400 -h 300 + $INKSCAPE_EXPORT --export-filename=splash.png src/splash.svg -w 400 -h 300 # Timeline toolbar icons (all platforms) - for i in select zoom zoom_all snap sequence; do - $INKSCAPE $i.png src/$i.svg -w 32 -h 32 + for c in black white; do + for i in select zoom zoom_all snap sequence; do + inkbatch --inkscape $INKSCAPE -i timeline-$i -o ${i}_${c}.png --width 32 --height 32 src/timeline_$c.svg + done + done + + # Batch converter toolbar icons (all platforms) + for c in black white; do + for i in add pause; do + inkbatch --inkscape $INKSCAPE -i batch-$i -o ${i}_${c}.png --width 32 --height 32 src/batch_$c.svg + done done # Playlist editor tick/no-tick - $INKSCAPE tick.png src/tick.svg -w 16 -h 16 - $INKSCAPE no_tick.png src/no_tick.svg -w 16 -h 16 + $INKSCAPE_EXPORT --export-filename=tick.png src/tick.svg -w 16 -h 16 + $INKSCAPE_EXPORT --export-filename=no_tick.png src/no_tick.svg -w 16 -h 16 + + # Link icon + $INKSCAPE_EXPORT --export-filename=link.png src/link.svg -w 9 -h 16 # favicon mkdir -p web