]> 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 44884aaf7b581a4382af3a59e9410687c3cade7f..6709481b625c270777683f0ad5e29121e369aeb0 100755 (executable)
@@ -9,22 +9,22 @@
 #   the svg files are rendered at a large size and then scaled down.
 #
 # DEPENDENCIES
 #   the svg files are rendered at a large size and then scaled down.
 #
 # DEPENDENCIES
-#   librsvg
-#   imagemagick
+#   rsvg-convert (librsvg 2.39.0)
+#   convert (imagemagick 6.8.6-9)
 #   Xolonium-Regular font
 #
 # USAGE
 #   ./render-version.sh [--no-font-check] DATADIR VERSION
 #
 # USAGE EXAMPLE
 #   Xolonium-Regular font
 #
 # USAGE
 #   ./render-version.sh [--no-font-check] DATADIR VERSION
 #
 # USAGE EXAMPLE
-#   ./render-version.sh ~/.xonotic/data 1.0
+#   ./render-version.sh ~/.xonotic/data "1.0"
 
 
 # Check for Xolonium font
 if [ "$1" = "--no-font-check" ]; then
        shift
 else
 
 
 # Check for Xolonium font
 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
                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
 
 # 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
 
 
        exit 1
 fi
 
 
-data="$1"
-version="$2"
-layers="gfx/menu/luma/background_l2.svg
-        gfx/menu/luma/background_ingame_l2.svg"
+input="$1"
+output="$2"
+version="$3"
+svgs="gfx/menu/luma/background_l2.svg
+      gfx/menu/luma/background_ingame_l2.svg"
 
 
 
 
-for svg in $layers; do
-       dir="$data/${svg%/*}"
-       tga="$data/${svg%.*}.tga"
+for svg in $svgs; do
+       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
 done