[cairo] SVG with pixel (not points) sizes?
simon.sapin at exyr.org
Thu Aug 16 09:42:52 PDT 2012
Le 16/08/2012 18:09, Behdad Esfahbod a écrit :
>> 1in = 72pt = 6pc = 2.54cm = 25.4mm = 90px
> No. The 90px is an example. The text says:
> "For example, suppose that the user agent can determine from its environment
> that "1px" corresponds to "0.2822222mm" (i.e., 90dpi)."
> The user agent may determine that the display is 140dpi, then 140px=1in.
You’re right. I completely misread the spec, sorry. On a more precise read:
SVG user units (unit-less lengths) are the same as px. Their ratio to
other absolute units is determined in some undefined way from "the
environment". (Unlike CSS where it is always 96dpi. Things get
interesting when you mix CSS on SVG elements and SVG attribute…)
Browsers just choose 96, probably to be consistent with CSS.
Anyway. So yes, it would be interesting be able to specify the size in
pixels / user units on cairo SVG surfaces. Although if you’re targeting
browsers I think it’s safe to assume 96dpi.
More information about the cairo