W3C home > Mailing lists > Public > www-svg@w3.org > June 2002

What does viewBox really do?

From: <rbw@polyglotinc.com>
Date: Sun, 23 Jun 2002 12:38:38 -0400
Message-Id: <4.3.2.7.2.20020623123750.05229050@pop.mindspring.com>
To: www-svg@w3.org

I have been going in circles with the author of SVG Essentials
(OReilly) regarding its description on page 19 of what viewBox
does.  According to the book, (but heavily back-pedaled by the
author quoting SVG Std excepts) is the simple assertion that one
defines the equivalence of user coords to specific units (e.g. cm,
inches, etc) via the viewBox in an outer SVG tag.
HOWEVER, neither Batik-1.1.1 nor Adobe 3.0 plugin viewers agree.

So, What DOES viewBox really do if not defining the meaning of
user coords?

In the trivial example below, a 100-user-coord line does not draw
the same length as a 1-inch line by either Batik or Adobe (but
they disagree on which is longer!).  Since 100 user coords to the
inch was specified in the viewBox, why aren't they the same length?
If that is not what viewBox does, WHAT DOES IT DO?

<?xml version="1.0" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
     "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">

<svg xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 850 1100" height="11in" width="8.5in">
<line stroke-width="10" stroke="yellow" x1="0" y1="20" x2="1in"    y2="20"/>
<line stroke-width="10" stroke="orange" x1="0" y1="30" x2="100"    y2="30"/>
<line stroke-width="10" stroke="green"  x1="0" y1="40" x2="100px" y2="40"/>
</svg>

thanks,
Bruce Wallace
Received on Sunday, 23 June 2002 12:36:34 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:22 GMT