User:JoKalliauer/SVG test suites/scripts
Jump to navigation
Jump to search
- used environment installations
#librsvg&inkscape&prerequieries
sudo dnf --refresh upgrade
if [ -f "/etc/debian_version" ]; then
sudo apt install python3-pip cargo npm inkscape optipng scour librsvg2-bin
fi
if [ "$(grep -Ei 'fedora|redhat' /etc/*release)" ]; then
sudo dnf install inkscape #inkscape
sudo dnf install librsvg2 #librsvg
sudo dnf install cargo #resvg
sudo dnf install cabextract #for unpacking windows fonts
sudo dnf install google-noto-\* #for google-noto-fonts (>1GB!)
sudo dnf install python3-pip npm optipng python3-scour batik batik-rasterizer ImageMagick qt5-qtbase-devel harfbuzz-devel qt5-qtbase qt5-qtbase-devel qt5-qtsvg qt5-qtsvg-devel librsvg2-tools wxsvg wxsvg-devel #not shure if needed
fi
#batik
mkdir -p ~/prgm
cd ~/prgm
wget https://mirror.klaus-uwe.me/apache//xmlgraphics/batik/binaries/batik-bin-1.14.zip
unzip batik-bin-1.14.zip
#resvg
mkdir -p ~/Documents/GitDesktop/
cd ~/Documents/GitDesktop/
git clone https://github.com/RazrFalcon/resvg.git
cd resvg/
git config pull.rebase false #optional
git pull #optional
cargo build --release
./make-vendored.sh
- fonts
- https://github.com/RazrFalcon/resvg-test-suite/tree/master/fonts
- sudo rpm -i https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm ; fc-cache -f -v
- main
#!/bin/bash export WIDTH=512 mkdir -p 4Batik${WIDTH} 3Ink${WIDTH} 2lib${WIDTH} 1Resvg${WIDTH} 3InkShell${WIDTH} cp aa_resvg.sh 1Resvg${WIDTH}/aa_resvg.sh cp aa_librsvg.sh 2lib${WIDTH}/aa_librsvg.sh cp aa_Inkscape.sh 3Ink${WIDTH}/aa_Inkscape.sh cp aa_batik.sh 4Batik${WIDTH}/aa_batik.sh cp aa_InkShell.sh 3InkShell${WIDTH}/aa_InkShell.sh cd SVG #for file in *.svg # do # mv -- "$file" "${file// /_}" #done for file in *.svg do cp "$file" ../4Batik${WIDTH}/"$file" cp "$file" ../3Ink${WIDTH}/"$file" cp "$file" ../2lib${WIDTH}/"$file" cp "$file" ../1Resvg${WIDTH}/"$file" done cd .. date cd 1Resvg${WIDTH} echo $(pwd) time taskset -c 0 ./aa_render.sh &> aa_re.txt cd .. date cd 2lib${WIDTH} echo $(pwd) time taskset -c 0 ./aa_render.sh &> aa_lib.txt cd .. date cd 3Ink${WIDTH} echo $(pwd) time taskset -c 0 ./aa_render.sh &> aa_Ink.txt cd .. date cd 4Batik${WIDTH} echo $(pwd) time taskset -c 0 ./aa_render.sh &>aa_batxt cd .. date cd 3InkShell${WIDTH} echo $(pwd) ./aa_render.sh &> aa_Ink.txt cd .. date
- librsvg
#!/bin/bash date for file in *.svg do echo & #Add a empty line to split the output echo $file & rsvg-convert "$file" -w ${WIDTH} -a -d 96 -p 96 >"${file%.svg}_librsvg.png" done date
- resvg
#!/bin/bash date for file in *.svg do echo & #Add a empty line to split the output echo $file & ~/Dokumente/GitDesktop/resvg/target/release/resvg "$file" -w ${WIDTH} "${file%.svg}_rendersvg.png" done date
- Inkscape (start for each image)
#!/bin/bash date for file in *.svg do echo & #Add a empty line to split the output echo $file & inkscape "$file" -w ${WIDTH} --export-type="png" mv "${file%.svg}.png" "${file%.svg}_Inkscape.png" & done date
- Inkscape (start only once)
#!/bin/bash date for file in *.svg do echo "file-open:${file}; export-type:png; export-width:${WIDTH}px; export-do;" >> aa_toInkscape.txt done echo quit >> aa_toInkscape.txt date time taskset -c 0 inkscape --shell --actions="$(cat aa_toInkscape.txt)" date
- Batik
#!/bin/bash date for file in *.svg do echo & #Add a empty line to split the output echo $file & java -Djava.awt.headless=true -jar ~/prgm/batik-1.14/batik-rasterizer-1.14.jar -w ${WIDTH} "$file" -d "${file%.svg}_batik.png" done date