linebender / resvg

An SVG rendering library.
Apache License 2.0
2.83k stars 228 forks source link

How to install/use rendersvg #320

Closed JoKalliauer closed 4 years ago

JoKalliauer commented 4 years ago

I tried to install using

rustup update
if [ -f "/etc/debian_version" ]; then
 sudo apt install qtbase5-dev libharfbuzz-dev libcairo2-dev
fi
if [ "$(grep -Ei 'fedora|redhat' /etc/*release)" ]; then
 sudo dnf install qt5-qtbase-devel harfbuzz-devel cairo-devel 
fi
git clone https://github.com/RazrFalcon/resvg.git
cd resvg/
cargo build --release
./make-vendored.sh
cargo install -f usvg-cli
cd usvg/
cargo build --release
cd resvg/tools/
cd resvg/tools/kde-dolphin-thumbnailer/
cargo build --release
cd /resvg/tools/viewsvg/
cargo build --release

According to https://github.com/RazrFalcon/resvg/issues/208#issuecomment-588319920 it should be

cd tools/rendersvg
cargo run --release --features="qt-backend" -- in.svg out.png
# the binary could be found at resvg/target/release/rendersvg

However I cannot find rendersvg.


Edit for myself: to build vdiff:

#!/usr/bin/env bash
if [ -f "/etc/debian_version" ]; then
 sudo apt install libqt5svg5-dev libwxsvg-dev
fi
if [ "$(grep -Ei 'fedora|redhat' /etc/*release)" ]; then
 sudo dnf install qt5-qtbase-devel harfbuzz-devel qt5-qtbase qt5-qtbase-devel qt5-qtsvg qt5-qtsvg-devel npm inkscape librsvg2 batik batik-rasterizer wxsvg wxsvg-devel
fi

cd chrome-svgrender
npm i -g npm
npm i puppeteer
cd ..

cd qtsvgrender
if command -v qmake &> /dev/null; then
 qmake
else
 qmake-qt5
fi
make
cd ..

cd wxsvgrender
./build.sh
cd ..

#cd ../..
#git clone https://github.com/svg-net/SVG.git
#cd SVG/Samples/SvgConsole/
#sudo dnf dotnet dotnet-sdk-5.0
#dotnet publish -f netcoreapp3.1 -c Release -r linux-x64 -o SvgConsole-linux-x64-netcoreapp3.1
#cd SvgConsole-linux-x64-netcoreapp3.1
#cd ../../../..
#cd resvg-test-suite/tools/

cd vdiff
if command -v qmake &> /dev/null; then
 qmake
else
 qmake-qt5
fi
make
cd ..
JoKalliauer commented 4 years ago

It is now called "viewsvg"

cd resvg/viewsvg/
cargo run --release -- in.svg out.png

Edit: resvg is in /resvg/target/release

RazrFalcon commented 4 years ago

rendersvg became resvg. You can simply run cargo install -f resvg.

viewsvg is just for testing.