]> de.git.xonotic.org Git - xonotic/mediasource.git/blobdiff - gfx/luma/render-version.sh
Merge branch 'LegendaryGuard/decompile_weapons' into 'master'
[xonotic/mediasource.git] / gfx / luma / render-version.sh
index 581f8f261cf4cb56731a6587e8a2b42603ad089f..6709481b625c270777683f0ad5e29121e369aeb0 100755 (executable)
@@ -9,8 +9,8 @@
 #   the svg files are rendered at a large size and then scaled down.
 #
 # DEPENDENCIES
-#   rsvg-convert (librsvg)
-#   convert (imagemagick)
+#   rsvg-convert (librsvg 2.39.0)
+#   convert (imagemagick 6.8.6-9)
 #   Xolonium-Regular font
 #
 # USAGE
@@ -24,7 +24,7 @@
 if [ "$1" = "--no-font-check" ]; then
        shift
 else
-       if [ -z "$(fc-list ':family=Xolonium:style=Regular')" ]; then
+       if [ -z "$(fc-list ':family=Xolonium GPL:style=Regular')" ]; then
                echo "Cannot find the Xolonium-Regular font."
                echo "Please install Xolonium before running this script."
                exit 2
@@ -34,21 +34,23 @@ fi
 
 # Check for arguments
 if [ -z "$1" ] || [ -z "$2" ]; then
-       echo "Usage: $0 [--no-font-check] DATADIR VERSION"
+       echo "Usage: $0 [--no-font-check] INPUTDIR OUTPUTDIR VERSION"
        exit 1
 fi
 
 
-data="$1"
-version="$2"
+input="$1"
+output="$2"
+version="$3"
 svgs="gfx/menu/luma/background_l2.svg
       gfx/menu/luma/background_ingame_l2.svg"
 
 
 for svg in $svgs; do
-       dir="$data/${svg%/*}"
-       tga="$data/${svg%.*}.tga"
+       dir="$output/${svg%/*}"
+       tga="$output/${svg%.*}.tga"
 
-       mkdir -p "$dir"
-       sed "s/LUMA/$version/g" "$svg" | rsvg-convert -z 2 | convert - -scale "50%" "$tga"
+       mkdir -p "$output"
+       # -auto-orient works around an inversion regression present in imagemagick 6.9.11-60
+       sed "s/LUMA/$version/g" "$input/$svg" | rsvg-convert -z 2 | convert - -auto-orient -scale "50%" "$tga"
 done