Commit ff36118b authored by Antonio Ospite's avatar Antonio Ospite Committed by Federico Mena Quintero

(#365): rsvg-convert: Specify pixel dimensiosn for SVG output

The RsvgDimensionData structure uses pixels as unit for drawing
dimensions (see librsvg/rsvg.h), but the default unit for SVG documents
in cairo is pt; thus, when exporting to SVG with rsvg-convert, the
output drawing results scaled up compared to the original one.

Since rsvg already converted input units to pixels, it's safe to assume
the SVG output is always in pixels, so set the SVG surface units to
pixels to keep the original dimensions.

Bump cairo dependency to 1.5.12 as cairo_svg_surface_set_document_unit()
was not available before that version.

Fixes #365
parent 82604290
......@@ -39,7 +39,7 @@ AC_SUBST([LIBRSVG_MICRO_VERSION],[rsvg_micro_version])
dnl ===========================================================================
dnl Please update with version numbers if these change
dnl This corresponds to Freetype2 2.8
......@@ -409,9 +409,11 @@ main (int argc, char **argv)
else if (!strcmp (format, "svg"))
else if (!strcmp (format, "svg")) {
surface = cairo_svg_surface_create_for_stream (rsvg_cairo_write_func, output_file,
scaled_width, scaled_height);
cairo_svg_surface_set_document_unit(surface, CAIRO_SVG_UNIT_PX);
else if (!strcmp (format, "xml")) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment