1 Description: Use ‘rsvg’ for conversion from SVG to PNG.
2 Origin: Created to improve package build speed.
3 Author: Ben Finney <ben+debian@benfinney.id.au>
4 Last-Update: 2010-05-07
6 === modified file 'INSTALL'
7 --- old/INSTALL 2010-04-23 05:50:33 +0000
8 +++ new/INSTALL 2010-05-07 07:28:51 +0000
13 -- ImageMagick (www.imagemagick.org)
14 -- inkscape (www.inkscape.org)
15 +- ImageMagick <http://www.imagemagick.org/>
16 +- librsvg <http://librsvg.sourceforge.net/>
18 Download the ComixCursors sources from:
21 # tar -xjvf ComixCursours-0.5.0.tar.bz2
22 # cd ComixCursors-0.5.0
24 -With ImageMagick and inkscape installed
25 +With the programs from ImageMagick and librsvg installed,
26 build and install the custom ComixCursors:
30 This will parse the CONFIG and HOTSPOTS files, export the
31 cursor source files in the svn directory to PNGs in the
32 -build directory (using inkscape), assemble and apply some
33 -effects using ImageMagick tools convert and mogrify, create
34 +build directory (using ‘rsvg’), assemble and apply some
35 +effects using ImageMagick tools ‘convert’ and ‘mogrify’, create
36 the xcursors in the cursors directory, and install the files
37 in your ~/.icons directory.
38 Not that the shadow images will be cached to reduce building
40 === modified file 'README'
41 --- old/README 2010-04-23 05:50:33 +0000
42 +++ new/README 2010-05-07 07:30:06 +0000
47 -You need to have the ImageMagick (www.imagemagick.org)
48 -tools and Inkscape (www.inkscape.org) installed, to run
49 -the installation script!
50 +Refer to the ‘INSTALL’ file for requirements and detailed instructions
51 +to build and install.
54 +If you have the required programs, issue
59 === modified file 'svg2png.bash'
60 --- old/svg2png.bash 2010-04-23 05:50:33 +0000
61 +++ new/svg2png.bash 2010-05-07 11:52:49 +0000
64 ##########################################################
66 -# 2006 Jens Luetkens <j.luetkens@limitland.de> #
67 -# version: ComixCursors 0.5.0 #
68 -# flatbedcursors 0.1 (compatible) #
70 -# take a simple svg file, export it to an image, #
71 -# do some image magig, generate a shadow, scale #
72 -# and merge it to a single image #
75 -# ImageMagick : http://www.imagemagick.org #
76 -# Inkscape : http://www.inkscape.org #
79 +# Copyright © 2010 Ben Finney <ben+debian@benfinney.id.au>
80 +# Copyright © 2006 Jens Luetkens <j.luetkens@limitland.de>
81 +# version: ComixCursors 0.5.0
82 +# flatbedcursors 0.1 (compatible)
84 +# Take a simple svg file, export it to an image,
85 +# do some image magig, generate a shadow, scale
86 +# and merge it to a single image.
89 +# ImageMagick: http://www.imagemagick.org
90 +# librsvg: http://librsvg.sourceforge.net/
92 ##########################################################
97 SCALEBLUR=`echo "$BLUR * $TMPSCALE" | bc`
98 SCALESIZE=`echo "$SIZE * $TMPSCALE" | bc`
99 -CROP=`echo "($SCALESIZE - $TMPSIZE) / 2" | bc`
101 -# scaling the shadow from a 500x500 px image
102 -RIGHT=`echo "500 / $SHADOWSCALE" | bc`
103 -LEFT=`echo "500 - $RIGHT" | bc`
104 +# Scaling the shadow from the cursor image.
105 +SHADOWSIZE=$(echo "$TMPSIZE * $SHADOWSCALE" | bc)
106 +RIGHT=$(echo "$TMPSIZE / $SHADOWSCALE" | bc)
107 +LEFT=$(echo "$TMPSIZE - $RIGHT" | bc)
109 if [ ! -d tmp ]; then mkdir tmp ; fi
110 if [ ! -d shadows ]; then mkdir shadows ; fi
111 @@ -113,27 +114,28 @@
112 CURSORIMAGE=tmp/cursor.png
113 SCALEDIMAGE=tmp/scaledcursor.png
116 + # Convert a single SVG image to PNG.
121 + rsvg --format png \
122 + --dpi-x 72 --dpi-y 72 \
123 + --width $size --height $size \
128 -inkscape -e $CURSORIMAGE \
134 - $INFILE >> /dev/null
135 +svg2png $INFILE $CURSORIMAGE $TMPSIZE
137 if [ ! -f $SHADOWIMAGE ]; then
138 - # echo "creating shadow image $SHADOWIMAGE..."
139 - # scaling the shadow must be done with exporting a different area from inkscape...
140 - inkscape -e $SCALEDIMAGE \
141 - -a $LEFT:$LEFT:$RIGHT:$RIGHT \
147 - $INFILE >> /dev/null
149 + # Make the shadow image from an extract of the cursor.
151 + -extract ${SHADOWSIZE}x${SHADOWSIZE}+${LEFT}+${LEFT} \
152 + -resize ${TMPSIZE}x${TMPSIZE} \
153 + $CURSORIMAGE $SCALEDIMAGE
155 convert -modulate 0 \
156 -fill "$SHADOWCOLOR" \