- From: Cameron McCormack <cam@mcc.id.au>
- Date: Sat, 23 Jan 2016 17:40:55 +1100
- To: Sairus Patel <sppatel@adobe.com>
- Cc: "public-svgopentype@w3.org" <public-svgopentype@w3.org>, Chris Lilley <chris@w3.org>, Vladimir Levantovsky <Vladimir.Levantovsky@monotype.com>
Sairus Patel: > Does the requirement to ignore external references when processing > SVG docs in an SVG-in-OT font include the dtd and xmlns http > references in the header? Here's an example glyph from GeckoEmoji.ttf > (http://people.mozilla.org/~jkew/opentype-svg/GeckoEmoji.html): > > <![CDATA[<?xml version="1.0" encoding="utf-8"?> > <!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' > 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'> ### <== dtd > <svg ... > xmlns="http://www.w3.org/2000/svg" ### <=== xmlns > xmlns:xlink="http://www.w3.org/1999/xlink" ### <=== xmlns > > ... The intention was to prevent any network access from happening. XML implementations aren’t required to download the referenced external DTD, by the way, and can rely on a local copy of the DTD if they wanted to use a validating parsing mode. XML namespace URIs are always opaque identifiers (even if they can look like a URL), and so are never dereferenced. > 2. > Also, since https://www.microsoft.com/typography/otspec/svg.htm says the required UA stylesheet must have: > > @namespace svg url(http://www.w3.org/2000/svg) > > there should be no need for the SVG doc in the font itself to have an > xmlns (as in the above example), right (unless, presumably, it’s > different from the UA stylesheet namespace)? No, this defines the “svg” namespace prefix for use within that user agent style sheet only. It is what allows the “svg|blah” rules to target “blah” elements in the SVG namespace and no other namespace. > Also, is a dtd needed at all in the font's SVG doc? Hin-Tak Leung > (who's working on the Microsoft Font Validator's SVG-in-OT support) > brought this up a couple of days ago on the OT list. He said, re. the > dtd in Gecko Emoji: No there is no real need to include a DOCTYPE declaration in SVG documents today. (Many SVG authoring tools do still include one though.) > <<< > this causes the XML > parser to go online to fetch the dtd from www.w3.org to actually validate > the XML against the dtd. I know this behavior is technically correct, > and XML parsers are supposed to validate whenever possible - and > possibly cache the DTD whenever possible. But mono's XML parser > happens not to do that, and hammering www.w3.org repeatedly for each > glyph (or each run at least, it seems and it chokes on alternative runs > when failing to fetch) seems stupid so I turn the validation feature off > mono's parser manually. > >>> Yes, turning off DTD validation for the document in your XML library is the right answer here. There’s no need to validate the document to the structure defined by the DTD, and the SVG DTDs don’t define any entities that could be used. Note that SVG 2 does not define a DTD for the language. -- Cameron McCormack ≝ http://mcc.id.au/
Received on Saturday, 23 January 2016 06:41:35 UTC