[Freeciv-Dev] Re: (PR#10734) SVG flags
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=10734 >
Jason Short wrote:
> - Borders are still missing (although this helps in spotting the
> "crappy" flags).
Here is a new conversion program. This one automatically adds the black
borders via some _very_ ugly scripting using ImageMagick.
jason
#!/bin/sh
files="$@"
# Renderer: inkscape or sodipodi. Inkscape seems slightly better.
#SODIPODI="sodipodi"
RENDERER="inkscape"
# Target width: 28 for trident/isotrident (height is then calculated
# automatically).
TARGET_WIDTH=28
for file0 in $files; do
filebase=`echo $file0 | sed s/.svg$//i`
file1="$filebase-1.png"
file2="$filebase-2.png"
file3="$filebase-3.png"
file4="$filebase.png"
echo "Converting $file0 to $file1"
# This is actually necessary for rendering
rm -f $file1 $file2 $file3 $file4
$RENDERER -f "$file0" -w $(($TARGET_WIDTH - 2)) -e "$file1"
# Ugly way to determine width and height. There must be a better way!
SIZE=`identify "$file1" | sed "s/^.*PNG //" | sed "s/ .*\$//"`
WIDTH=`echo $SIZE | sed "s/x.*\$//"`
HEIGHT=`echo $SIZE | sed "s/^.*x//"`
convert -resize $((2*$WIDTH))x$((2*$HEIGHT)) -fill black -draw "rectangle 0,0
$((2*$WIDTH)),$((2*$HEIGHT))" $file1 $file2
convert -crop $((2+$WIDTH))x$((2+$HEIGHT))+0x0 $file2 $file3
# convert -draw "image under 1,1 0,0 $file1" $file3 $file4
composite -geometry 0x0+1+1 $file1 $file3 $file4
rm -f $file1 $file2 $file3
done
- [Freeciv-Dev] Re: (PR#10734) SVG flags, Jason Short, 2004/10/25
- [Freeciv-Dev] Re: (PR#10734) SVG flags, Vasco Alexandre da Silva Costa, 2004/10/26
- [Freeciv-Dev] Re: (PR#10734) SVG flags, Jason Short, 2004/10/26
- [Freeciv-Dev] Re: (PR#10734) SVG flags, Jason Short, 2004/10/26
- [Freeciv-Dev] Re: (PR#10734) SVG flags, Vasco Alexandre da Silva Costa, 2004/10/26
- [Freeciv-Dev] Re: (PR#10734) SVG flags, Jason Short, 2004/10/26
- [Freeciv-Dev] Re: (PR#10734) SVG flags, Per I. Mathisen, 2004/10/26
- [Freeciv-Dev] Re: (PR#10734) SVG flags, Jason Short, 2004/10/26
- [Freeciv-Dev] (PR#10734) SVG flags, Vasco Alexandre da Silva Costa, 2004/10/26
- [Freeciv-Dev] Re: (PR#10734) SVG flags, Jason Short, 2004/10/26
- [Freeciv-Dev] Re: (PR#10734) SVG flags,
Jason Short <=
- [Freeciv-Dev] (PR#10734) SVG flags, Vasco Alexandre da Silva Costa, 2004/10/26
- [Freeciv-Dev] (PR#10734) SVG flags, Vasco Alexandre da Silva Costa, 2004/10/26
- [Freeciv-Dev] Re: (PR#10734) SVG flags, Vasco Alexandre da Silva Costa, 2004/10/26
- [Freeciv-Dev] Re: (PR#10734) SVG flags, Jason Short, 2004/10/26
- [Freeciv-Dev] Re: (PR#10734) SVG flags, Jason Short, 2004/10/26
- [Freeciv-Dev] Re: (PR#10734) SVG flags, Jason Short, 2004/10/26
- [Freeciv-Dev] Re: (PR#10734) SVG flags, Jason Short, 2004/10/26
- [Freeciv-Dev] Re: (PR#10734) SVG flags, Per I. Mathisen, 2004/10/27
- [Freeciv-Dev] Re: (PR#10734) SVG flags, Jason Short, 2004/10/27
- [Freeciv-Dev] Re: (PR#10734) SVG flags, Jason Short, 2004/10/27
|
|