W3C home > Mailing lists > Public > www-svg@w3.org > April 2009

Re: how should 'top' width/height larger than screen be handled?

From: Dr. Olaf Hoffmann <Dr.O.Hoffmann@gmx.de>
Date: Mon, 20 Apr 2009 09:59:43 +0100
To: www-svg@w3.org, svg@steltenpower.com
Message-Id: <200904201059.43857.Dr.O.Hoffmann@gmx.de>
>Say i have <svg width="10in" height="10in" ......... </svg> ,
>what does the spec say about how to put this on screen?

I think, some viewers provide scrollbars and a few rescale it to
the available viewport, if it is too large. Typically the first solution
seems to be more useful - at least for my applications...

>Say i want to show a circular 'painting' at the same physical scale, on 
>every screen size. It should be centered on screen.
>For example: On a huge TV it would show completely with leftover space 
>surrounding it, on a desktop monitor it would just fit, on a laptop 
>screen it would have cut-offs top and bottom, on a netbook it would have 
>cut-offs on left,right,top and bottom, on a mobile you'd see only a 
>rectangular middle part.
>What ways can you do that?

You can use
preserveAspectRatio="xMidYMid slice" (in SVG 1.1 full, not in tiny)
to ensure, that the viewport is completely filled with parts of the 
viewBox and that it is centered.
This is maybe useful too, if the SVG document is used as a
CSS  background image without repetition, for example with
a Penrose tiling or something else without a periodicity.
Received on Monday, 20 April 2009 11:50:32 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:17 UTC