diff options
author | Reizner Evgeniy <razrfalcon@gmail.com> | 2018-05-06 15:21:33 +0300 |
---|---|---|
committer | Reizner Evgeniy <razrfalcon@gmail.com> | 2018-05-06 15:21:33 +0300 |
commit | 7d4dd569d9fab884b11bee64dc87829223ab6885 (patch) | |
tree | e88d76fae37fc341aa1ea6ddbd6be20fbfb20fe6 /docs | |
parent | b7fbea0f282622d37035f0743076dfbb252989b3 (diff) |
`doc` -> `docs`
Diffstat (limited to 'docs')
-rw-r--r-- | docs/backend_requirements.md | 54 | ||||
-rw-r--r-- | docs/build.md | 113 |
2 files changed, 167 insertions, 0 deletions
diff --git a/docs/backend_requirements.md b/docs/backend_requirements.md new file mode 100644 index 0000000..dc26b14 --- /dev/null +++ b/docs/backend_requirements.md @@ -0,0 +1,54 @@ +# Backend requirements + +List of features required from the 2D graphics library to implement a backend for `resvg`. + +- Composition modes: + - Clear + - DestinationIn + - DestinationOut +- Filling: + - With color + - With linear or radial gradient + - With pattern (texture/image) + - Fill rules: + - NonZero/Winding + - EvenOdd/OddEven + - Opacity +- Stroking: + - With color + - With linear or radial gradient + - With pattern (texture/image) + - Dasharray + Dashoffset + - Miterlimit + - Opacity + - Width + - LineCap: *butt*, *round* and *square* + - LineJoin: *miter*, *round* and *bevel* +- Bézier paths: + - Anti-aliasing + - Required segments support: + - MoveTo + - LineTo + - CurveTo (cubic) + - ClosePath +- Text + - Anti-aliasing + - Font properties: + - Family resolving (like `'Arial', monospace`) + - Style: *normal*, *italic* and *oblique* + - Weight + - Stretch + - Variant: *normal*, *small cap* + - Size + - Font metrics: + - Text bounding box + - Ascent/baseline + - Overline position and thickness (optional) + - Strikeout position and thickness (optional) + - Underline position and thickness (optional) +- Raster images: + - Formats: + - PNG + - JPEG + - Loading from file and memory + - Smooth scaling diff --git a/docs/build.md b/docs/build.md new file mode 100644 index 0000000..f40efb9 --- /dev/null +++ b/docs/build.md @@ -0,0 +1,113 @@ +# How to build resvg + +## General + +Currently, *resvg* supports only two backend: Qt and cairo. + +You can build them separately or together. + +To enable a backend use the `--features` option of the `cargo`: +```bash +# Build with a Qt backend +cargo build --release --features="qt-backend" +# or with a cairo backend +cargo build --release --features="cairo-backend" +# or with both. +cargo build --release --features="qt-backend cairo-backend" +``` + +### Rust + +The library requires the latest stable Rust. + +### Qt backend + +Qt backend requires only `QtCore` and `QtGui` libraries. +And the JPEG image format plugin (eg. `plugins/imageformats/libqjpeg.so`). + +Technically, any Qt 5 version should work, but we support only Qt >= 5.6. + +### cairo backend + +We use `pango` for text rendering, so you have to install/build it too +with a `pangocairo` library. + +## Windows + +1. [Install Rust](https://www.rust-lang.org/en-US/install.html) with a +`stable-i686-pc-windows-gnu` target. +1. Install [MSYS2](http://www.msys2.org/). + +### Qt backend + +Only MinGW 32bit version is supported. MSVS should work too, but it is not tested. + +Install Qt MinGW 32bit using an +[official installer](http://download.qt.io/official_releases/online_installers/qt-unified-windows-x86-online.exe). + +In the MSYS2 Shell: +```bash +# We use Qt 5.9.3 for example. + +# Prepare PATH. +export PATH="/c/Qt/5.9.3/mingw53_32/bin:/c/Qt/Tools/mingw530_32/bin:/c/Users/$USER/.cargo/bin:$PATH" + +# Build. +QT_DIR=/c/Qt/5.9.3/mingw53_32 cargo.exe build --release --features "qt-backend" +``` + +### cairo backend + +Install GTK+ dependencies using MSYS2 as explained +[here](http://gtk-rs.org/docs/requirements.html#windows). + +We no need the whole GTK+, so we can install only `pango`, which will install +`cairo` too. + +Then run this command in the MSYS2 MinGW Shell: +``` +cargo.exe build --release --features "cairo-backend" +``` + +## Linux + +### Qt backend + +Install Qt 5 using your distributive package manager. + +``` +cargo build --release --features "qt-backend" +``` + +If you don't want to use the system Qt you can alter it with the `PKG_CONFIG_PATH` variable. + +``` +PKG_CONFIG_PATH='/path_to_qt/lib/pkgconfig' cargo build --release --features "qt-backend" +``` + +### cairo backend + +Install `cairo` and `pango`(with `pangocairo`) using your distributive package manager. + +For Ubuntu you need only `libpango1.0-dev`. + +``` +cargo build --release --features "cairo-backend" +``` + +## macOS + +[Install Rust](https://www.rust-lang.org/en-US/install.html). + +### Qt backend + +Install Qt using an +[official installer](http://download.qt.io/official_releases/online_installers/qt-unified-mac-x64-online.dmg). + +``` +QT_DIR=/Users/$USER/Qt/5.9.3/clang_64 cargo build --release --features "qt-backend" +``` + +### cairo backend + +Not supported. |