[BZ#762039] Extract accurate positions and dimensions
Submitted by Jehan
Assigned to Federico Mena Quintero
Created attachment 321138 Fix em/ex dimensions in RsvgDimensionData.
RsvgDimensionData has both int (width, height) and double (em, ex) dimensions, but in practice, em/ex are created from width/height, which makes them useless. It should be the other way around, especially since we compute double values (either through cairo or _rsvg_css_hand_normalize_length).
As for RsvgPositionData, it does not even have any double value.
The point is that Inkscape (and probably any other vectorial editor) heavily uses double value so we need accurate positions and dimensions. In GIMP, we are switching to vector icons, and I want to use librsvg to extract the icons from a single source SVG. We cannot afford 1 pixel off errors for icons which will be displayed on 12 or 16 pixels.
The attached patch fixes rsvg_handle_get_dimensions/rsvg_handle_get_dimensions_sub() by now filling accurate double values in dimension_data->em/ex.
Patch 321138, "Fix em/ex dimensions in RsvgDimensionData.":