svg fonts and mathtext

I'd be curious to see a screenshot of what Safari looks like. It may be a simple fix on our end.

See attached.

As for file sizes, the SVG spec makes an "informational recommendation" to allow gzip-compressed SVG files. So some tools support commpression (Inkscape), and others don't (Firefox). Hopefully more will start supporting that.

Safari doesn't. IE 7 does.

Note that IE 7.0.5730.11 doesn't render mathtext_demo.svg with the Adobe
3.03 SVGViewer plugin. Instead it reports bad CSS selector. I looked around
for a bit, but couldn't find an alternative viewer. Other svg files work.

  - Paul

mathtext-safari.png

···

On Fri, Sep 07, 2007 at 06:40:55AM -0400, Michael Droettboom wrote:

Paul Kienzle wrote:

I'd be curious to see a screenshot of what Safari looks like. It may be a simple fix on our end.

See attached.

As for file sizes, the SVG spec makes an "informational recommendation" to allow gzip-compressed SVG files. So some tools support commpression (Inkscape), and others don't (Firefox). Hopefully more will start supporting that.

Safari doesn't. IE 7 does.

By IE7 you mean "IE7 on OS-X with Adobe SVG Plugin?" I've never used that browser -- it doesn't have built-in SVG support, correct?

Note that IE 7.0.5730.11 doesn't render mathtext_demo.svg with the Adobe 3.03 SVGViewer plugin. Instead it reports bad CSS selector. I looked around
for a bit, but couldn't find an alternative viewer. Other svg files work.

In general, I'm not too concerned about supporting a long abandoned tool like the Adobe SVG viewer. However...

I suspect this is related to a recent change to localize all the styles into a stylesheet (to save on filesize). There is a CSS stylesheet at the bottom that looks like this:

._6 { fill: #000000 }
._1 { fill: #bfbf00; stroke: #000000; stroke-width: 1.0; stroke-linejoin: miter; stroke-linecap: square; opacity: 1.0 }

It seems there might be a small discrepancy between the SVG spec and CSS2 specs. SVG 1.1 says using a period as a class selector is ok:

http://www.w3.org/TR/SVG/styling.html#ClassAttribute

CSS2 says they should only work with HTML:

http://www.w3.org/TR/REC-CSS2/selector.html#class-html

On second look, this change also breaks support for inkscape (which AFAICT doesn't support external stylesheets). So, I'll take this stuff out back out, which should also fix Adobe SVG problem.

Cheers,
Mike

···

On Fri, Sep 07, 2007 at 06:40:55AM -0400, Michael Droettboom wrote:

--
Michael Droettboom
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Paul Kienzle wrote:

I'd be curious to see a screenshot of what Safari looks like. It may be a simple fix on our end.

See attached.

It turns out this "difference" (I'm not calling it a bug) is visible in Inkscape as well.

There seems to be some disagreement about the 'Z' operator on SVG paths (which is supposed to close the current path segment). In Firefox, 'Z' doesn't move the reference point for subsequent relative operations, whereas in Inkscape (and presumably Safari) it does. So the delta problem is because the inner triangle was being drawn offset outside of the outer triangle. The workaround in matplotlib is to never do a relative operation after the 'Z' operator (r3808) and avoid exercising this difference.

Unfortunately, the SVG 1.1 and 1.2 specs don't appear to directly address this issue (at least it isn't very explicit):

  Paths — SVG 2

So it's hard to say who's "to blame" here, but perhaps the spec should be clarified.

Cheers,
Mike

···

On Fri, Sep 07, 2007 at 06:40:55AM -0400, Michael Droettboom wrote:

--
Michael Droettboom
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA