SVG

From ShawnReevesWiki
Jump to navigationJump to search

In 2008-2009, I needed a vector graphics format for making wind roses printable, so I started using Scalable Vector Graphics (SVG), the open format XML files used to represent vector graphics and recognized by some web browsers.

When I first developed the wind roses in SVG at http://energyteachers.org/secondlife/windrose.php I simply copied the header from a file I found on the web:

<?xml version="1.0" encoding="iso-8859-1" ?>
 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000303 Stylable//EN" "http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-stylable.dtd">
 <svg xml:space="preserve" width="7in" height="9in" viewBox="0 0 800 1000 ">

But, some time around September 2009, Safari stopped rendering the graphics, even though the same code would work in Illustrator. I found a better header, but I wanted to understand the components of the header better. I found a decent document explaining XML headers, making them less of a black magic than so many sources had obscured: http://www.layoutgalaxy.com/xml/doc1.php4

As of 2009-11-20, for my wind rose, the following is working in Safari:

<?xml version="1.0" standalone="no"?>
 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
 <svg xml:space="preserve" width="7in" height="9in" viewBox="0 0 800 1000 " version="1.1" xmlns="http://www.w3.org/2000/svg">

Notice, no encoding attribute. The standalone option is "rarely used," but it works for me. Safari isn't presenting a scroll bar even though the document is 1000 pixels high and my Safari window is smaller. I wonder whether this is a problem still with my header.