W3C home > Mailing lists > Public > www-svg@w3.org > February 2012

Re: path data attribute lacks units!

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 9 Feb 2012 02:16:33 -0800
Message-ID: <CAAWBYDB_vmE2VbrPfdsFOAXWJqEapR+kv=fbOs68PsU1BVGWPQ@mail.gmail.com>
To: Sebastian Kuzminsky <seb@highlab.com>
Cc: www-svg@w3.org
On Wed, Feb 8, 2012 at 9:09 AM, Sebastian Kuzminsky <seb@highlab.com> wrote:
> Hi there, I'm working with a group of people in the open source world, trying to use SVG as an interchange format for 2-dimensional CAD (computer-aided design) data. We are hoping to replace the old closed-source DXF format with SVG, and we're mostly having good success.
> However, we have run in to one stumbling block.  Some shapes can be well represented by SVG Basic Shapes, and those work well.  Some shapes cannot be represented by Basic Shapes and instead require Paths, for example partial arcs.
> The problem is that Path data does not have user-specifiable units.  It is always represented in "px" user units, which have undefined size.  We're currently assuming that the SVG will be viewed/used in a 90 dpi environment, and that is getting us past this obstacle, but it seems an unsafe assumption to make.  We'd much rather have proper units on path data, and remove this ambiguity.
> Is this limitation intentional?
> Is there a way to specify path data units that we're missing?
> Thanks for your work on a (mostly!) great spec!  :-)

The size of a userspace unit (the numbers without explicit unit
identifiers) is determined by the size of the SVG itself and the
viewBox attribute.  The viewBox defines how many userspace units fit
into the space that the SVG occupies.

For example, with something like:

<svg width='10in' height='8in' viewBox='0 0 100 100'>...</svg>

Inside of the SVG, a userspace unit is a rectangle .1in wide and .08in tall.

Received on Thursday, 9 February 2012 10:17:23 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:34 UTC