W3C home > Mailing lists > Public > public-svgopentype@w3.org > January 2012

Re: Subsettability of the SVG document

From: Cameron McCormack <cam@mcc.id.au>
Date: Mon, 09 Jan 2012 16:14:49 +1100
Message-ID: <4F0A77C9.50907@mcc.id.au>
To: Vincent Hardy <vhardy@adobe.com>
CC: Sairus Patel <sppatel@adobe.com>, "public-svgopentype@w3.org" <public-svgopentype@w3.org>
Vincent Hardy:
> I am not aware of solutions that subset SVG in a way similar to what you
> are describing for font subseting. Subsetting glyphs that are not in the
> subset list should be a matter of taking out all the non-matching ids.

It might be that there are references between glyphs, e.g. let's say you had

   <g id="g100">
     <path d="..."/>
   </g>
   <g id="g101">
     <use xlink:href="#g100"/>
     <path d="..."/>
   </g>

and you are subsetting the font for a document that includes a g101 
glyph but not a g100 glyph.  You would want to make sure that the g101 
glyph is not broken by removing the g100 element.  It might be that the 
subsetter just leaves g100 in the font.  If it was important that there 
be no g100 glyph in the font after subsetting, then you could rename the 
ID so that it isn't recognised as an actual glyph.

(This is assuming we go down the route of using IDs to identify glyphs, 
rather than a separate attribute, which I think still might be a better 
idea.  Either way subsetting will need to be careful not to remove 
elements that are neeed by other glyphs.)

Note that even without issues like one glyph referencing another glyph's 
data with a <use> element, you'll be able to construct a document whose 
rendering is different when the subsetted-away glyphs are removed.  This 
is the same problem as the one we were discussing of progressing font 
download, really.  For example assume you begin with:

   <svg ...>
     <style>
       g { fill: red }
       g + g { fill: blue }
     </style>
     <g id="g100">
       <path d="..."/>
     </g>
     <g id="g101">
       <path d="..."/>
     </g>
   </svg>

and the subsetter wants to remove g100.  By doing so, the g101 element 
now matches different selectors from the style sheet, so it'll render as 
red instead of blue.

It would be possible of course for the subsetter to determine what the 
computed values are for all elements in the document, so that it could 
rewrite the style rules to have the same effect even after some glyph 
elements have been removed.  It just makes subsetting a somewhat less 
simple task.
Received on Monday, 9 January 2012 05:17:56 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 January 2012 05:17:56 GMT