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 COMPILING.md with version numbers if these change
CAIRO_REQUIRED=1.15.4
CAIRO_REQUIRED=1.15.12
CROCO_REQUIRED=0.6.1
dnl This corresponds to Freetype2 2.8
FREETYPE2_REQUIRED=20.0.14
......
......@@ -409,9 +409,11 @@ main (int argc, char **argv)
}
#endif
#ifdef CAIRO_HAS_SVG_SURFACE
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);
}
#endif
#ifdef CAIRO_HAS_XML_SURFACE
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