[cairo] Holiday cleanup

Emmanuel Pacaud emmanuel.pacaud at lapp.in2p3.fr
Sat Dec 29 07:02:58 PST 2007


Hi,

Le jeudi 27 décembre 2007 à 20:12 -0800, Sasha Kovar a écrit :
> .-- Behdad Esfahbod:
> | That's all for now.  What are some issues you want to fix for 1.6?
> 
> Hi.  I'd like to resurrect an old thread [1] on the default units used when
> writing SVGs.  
> 
> In my work, i read in SVGs via librsvg, and write them out again using
> cairo's svg surface.  With the current behavior of the svg tag specifying
> the units in points, the output files render at a different size than the
> originals I read in, which seems counterintuitive, and is a problem for me.

Did you try to set the librsvg dpi to 72 (rsvg_set_default_dpi) ? With
this setting, 1 pixel = 1 point. That's what we do when converting SVG
files to PNG in the cairo test suite.

> While the correct solution may be as Emmanuel Pacaud describes, allowing the
> user to specify the units used, a simpler solution that at least respects
> the default svg unit of pixels would be a welcome stopgap.
> 
> I've been using a version of this patch against 1.4.2 (Ubuntu feisty's
> version) for months, and for my use it has worked well.  The attached patch
> is against the 1.5.4 snapshot. 

It's too late for a change of the default unit, and we should not change
the API. If the librsvg dpi change doesn't solve your issue, a patch
that would add a way to change the unit for the SVG document could be
accepted.

I still don't understand the use of pixel as a unit in a vector
format...

	Emmanuel.



More information about the cairo mailing list