5 # Render SVG files from ./path/file.svg to OUTDIR/path/file.tga
6 # Overwrites existing tga files.
9 # ./render.sh OUTDIR SVG...
12 # One file: ./render.sh ~/.xonotic/data gfx/crosshair64.svg
13 # All files: ./render.sh ~/.xonotic/data $(find . -name "*.svg")
22 # Extract name components
23 svgDir=$(dirname -- "$svg")
24 svgName=$(basename -- "$svg" .svg)
26 # Compose target file names
28 tga="$dir/$svgName.tga"
29 tmp="$dir/$svgName.tmp.png"
31 # Ensure target directory exists
35 inkscape --export-filename "$tmp" "$svg"
36 convert -auto-orient "$tmp" -compress RLE "$tga"