svg: add a new function to specify the SVG document unit

Graphics / Cairo - Antonio Ospite [ao2.it] - 4 December 2017 21:58 EST

Add a cairo_svg_surface_set_document_unit() function to allow users to set a unit for the width and height values of the root element.

In particular this allows to draw in pixels and still have the expected result when generating SVG output.

Add also the correspondent getter function.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=90166

15559b54a svg: add a new function to specify the SVG document unit
src/cairo-svg-surface.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++--
src/cairo-svg.h | 47 +++++++++++++++++++++++++++
2 files changed, 129 insertions(+), 2 deletions(-)

Upstream: cgit.freedesktop.org


  • Share