Re: Subsettability of the SVG document

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 UTC