dbuenzli/vg — pull request #7 by art-w (2014-12-15 12:10:40+00:00)
Title: Cairo renderer

The main motivation for this backend is the ability to rasterize a Vg image to a custom surface in memory, but it can also be used to produce PNG and PS files (and more redundantly, PDF and SVG.) It adds an optional dependency to the `cairo2` bindings for OCaml.

The implementation is based on the existing Vgr_htmlc renderer, as the semantics of the javascript canvas are very close to the cairo surface model, with the following known limitations:
- Gradients are performed in non-linearized RGB space.
- Outline cuts are only possible on primitive images (constant, gradients).
- While Cairo is able to render text, it's intended to be used with Pango (which isn't binded with OCaml at this time). Hence, the text API is severely lacking: Beside not using the glyphs infos provided by Vg, the most striking offense is that the weights are limited to Normal and Bold (arbitrarily chosen at `W600`.)

The `rcairo` demo has an additional `-format` argument to specify the file backend.

Let me know if I overlooked anything!