rsvg-convert with SVG output should use the user-specified units
There is this code in rsvg-convert.rs:
Format::Svg => {
// TODO: SVG surface can be created with any unit type; let's use pixels for now
(
natural_size,
self.width.map(|l| l.to_user(¶ms)),
self.height.map(|l| l.to_user(¶ms)),
self.page_size.map(|(w, h)| Size {
w: w.to_user(¶ms),
h: h.to_user(¶ms),
}),
)
}
It should be possible to use set_document_unit
on the Cairo SVG surface with the user's provided units. One caveat is that Cairo only allows setting a single unit kind for both width/height; rsvg-convert needs to make a decision on what to do if they are different.