librsvg
=======

librsvg is a C library that renders Scalable Vector Graphics (SVG) to
Cairo surfaces.  The shared library, headers, and pkg-config module
are **librsvg-2.0**.

Version **2.62.3**.

Originally written by Raph Levien.

It can render non-animated SVG and SVGZ, including CSS styling,
filters, masks, clip paths, and SVG `<image>` rasters (PNG, JPEG,
GIF, WebP, BMP; optional AVIF).  A gdk-pixbuf loader (`libpixbufloader-svg`)
and the `rsvg-convert` tool are included.  rsvg-convert uses GLib
GOption (not clap).  It supports `--stylesheet` / `-s`, stdin
(`-` or no filename), `-f pdf` / `pdf1.4` … `pdf1.7`,
`--page-width` / `--page-height` / `--left` / `--top` (pixel
numbers), `-w` / `-h` as CSS lengths (`100`, `100px`, `2in`,
`50mm`), and `-l` / `--accept-language` for `systemLanguage`.
It does not match GNOME 2.62.3 help text; see NEWS for the CLI
gap list.  Bash Tab completion is installed from librsvg-c-bin
as `/usr/share/bash-completion/completions/rsvg-convert`.  There
is no `--completion` flag.

Dependencies
------------

Required: GLib, GIO, libxml2, cairo, pango (pangocairo / pangoft2),
gdk-pixbuf.  Stylesheets use the in-tree **css/** engine.  `libcroco/`
is an unbuilt archive (not compiled, not linked, not packaged).
A system libcroco is not used.

Raster decoders (each **auto** at configure time):

| Format | Library              | Disable              |
| ------ | -------------------- | -------------------- |
| PNG    | libpng               | `--disable-png`      |
| JPEG   | libjpeg / libjpeg-turbo | `--disable-jpeg`  |
| GIF    | giflib               | `--disable-gif`      |
| WebP   | libwebp              | `--disable-webp`     |
| BMP    | in-tree decoder      | `--disable-bmp`      |
| AVIF   | libavif              | `--disable-avif`     |

`--enable-*` without the corresponding library is an error for
PNG/JPEG/GIF/WebP/AVIF.  `--enable-bmp` needs no extra library.
`--disable-*` omits that decoder.

Limits
------

SVG `<image>` rasters are limited to a maximum side of 32767 pixels and
32×1024×1024 pixels total.  Very large `data:` payloads or stylesheet
buffers may be rejected.

Defaults
--------

`RsvgHandle` and `rsvg-convert` default to 96 DPI.
Use `rsvg-convert -d 90 -p 90` for the previous CLI default.

Building
--------

See `INSTALL`.  Typical sequence:

    ./configure --prefix=/usr
    make
    make DESTDIR="$PWD/stage" install

Do not run plain `make install` onto a live system prefix.

Licence
-------

The library (`librsvg-2.so`) is GNU Library GPL v2 or later
(`LICENCE-LIB`): you may link it from other programs; the library
itself stays under that license.  The tools (`rsvg-convert` and
similar) are GNU GPL v2 only (`LICENCE`; COPYING does not add
“or later”).  `rsvg-convert --version` prints GPL-2.0-only.
See `COPYING` for this map.

Release
-------

    make help
    make pkg

writes `librsvg-c-2.62.3.tar.xz` only under `../pkg/`.
The tarball is **source only**
(C tree, tests, autotools; `libcroco/` is an unbuilt archive). Packaging lives in
git `dist/` (Debian, CRUX), not in the public source archive.
`rust/`, `.git/`, `.gitignore`, and maintainer key files are omitted.
`make dist-release` is an alias of `pkg`. `make crux` writes under
`../pkg/`. `make deb` writes Debian packages under `../debpkg/`.
Neither installs onto a live prefix or runs pkgmk.

    cd ../pkg
    gpg --detach-sign --armor librsvg-c-2.62.3.tar.xz
    sha256sum librsvg-c-2.62.3.tar.xz > SHA256SUMS
    gpg --detach-sign --armor SHA256SUMS

Further reading
---------------

- `INSTALL` — configure flags, DESTDIR/stage, generic Autotools notes
- `deb/INSTALL.md` — Debian/Devuan local-deb install (apt one-shot)
- `tests/README` — optional `make fuzz-css` / `fuzz-afl` / `fuzz-bmp` (not `make check`)
- `NEWS` — user-visible changes
- `COPYING` — which files use which license
- `LICENCE-LIB` — library license (GNU Library GPL v2 or later)
- `LICENCE` — tools license (GNU GPL v2)
- `doc/html/` — API reference (Doxygen; `doxygen doc/Doxyfile` or `make html`)
- `doc/html/examples.html` — curated C samples (`examples/` in the tree)
- `rsvg-convert(1)` — command-line converter
