Re: SVG with pixel (not points) sizes?

Simon Sapin <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
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.

-- 
Simon Sapin
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.