Re: Subsettability of the SVG document

While I agree with Cameron it is possible to write content that does not lend itself to the method I suggested (I overlooked these possibilities), I also agree with Leonard that we could warn the authors that the sub-setting could be jeopardized if they do fancy things. Unless there is something really common that would break sub-setting that I am overlooking?

-v

From: Leonard Rosenthol <lrosenth@adobe.com<mailto:lrosenth@adobe.com>>
Date: Mon, 9 Jan 2012 04:29:33 -0800
To: Cameron McCormack <cam@mcc.id.au<mailto:cam@mcc.id.au>>, Adobe Systems <vhardy@adobe.com<mailto:vhardy@adobe.com>>
Cc: Sairus Patel <sppatel@adobe.com<mailto:sppatel@adobe.com>>, "public-svgopentype@w3.org<mailto:public-svgopentype@w3.org>" <public-svgopentype@w3.org<mailto:public-svgopentype@w3.org>>
Subject: RE: Subsettability of the SVG document

OR we need to put some additional restrictions on "SVG fonts" so that such constructs can't be used.

-----Original Message-----
From: Cameron McCormack [mailto:cam@mcc.id.au]
Sent: Monday, January 09, 2012 12:15 AM
To: Vincent Hardy
Cc: Sairus Patel; public-svgopentype@w3.org<mailto:public-svgopentype@w3.org>
Subject: 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 Tuesday, 10 January 2012 05:15:08 UTC