Building Web Applications with SVG - Cdn.oreilly.com
Building Web Applications with SVG - Cdn.oreilly.com
Building Web Applications with SVG - Cdn.oreilly.com
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Getting Started: A Simple Overview<br />
You’ll see a more detailed step-by-step example at the end of this chapter, but it is important that you<br />
gain some idea of what’s involved in viewing and creating <strong>SVG</strong> at the outset.<br />
Viewing <strong>SVG</strong><br />
Start up any modern browser and point it at the website related to this book, http://cs.sru.edu/~svg<br />
.<strong>com</strong>. Internet Explorer, Firefox, Chrome, Safari, and Opera all support viewing <strong>SVG</strong> on the web, so you<br />
can use any of those. The most important exception is this: if you are using Internet Explorer, you will<br />
either need to upgrade to Internet Explorer 9 (which requires Microsoft Windows Vista or later), or<br />
you will need to download the free <strong>SVG</strong> plug-in (ASV version 3.03) from Adobe, at http://www.adobe<br />
.<strong>com</strong>/svg/viewer/install/mainframed.html. For all the other browsers listed, using the latest version will<br />
always prove helpful, because all of these browsers are making steady and frequent progress on their<br />
implementations of the <strong>SVG</strong> specification.<br />
<strong>SVG</strong> is a big specification—one that’s not trivial to implement. <strong>SVG</strong> 1.1 is generally the version<br />
against which browsers are <strong>com</strong>pared. As of this writing, no browser implements all of <strong>SVG</strong> 1.1,<br />
despite the specification having reached re<strong>com</strong>mendation status (meaning that it is officially a W3C<br />
standard) in 2003 (http://www.w3.org/Graphics/<strong>SVG</strong>/History). Improvements to browser support tend<br />
to appear on a monthly basis, so it is best to make sure that you’re using the latest release of whatever<br />
browsers you use.<br />
As another example of the importance of using current browser versions, Firefox 3.6 does<br />
not support SMIL animation, while Firefox 4.0 does. You’ll see more about the idiosyncrasies of<br />
browser support in the discussions of the relevant topics, but note that the parts of <strong>SVG</strong> that pertain<br />
to animation, filters, and fonts are most likely to show browser differences.<br />
Writing <strong>SVG</strong><br />
There are many different paths that one can follow to develop <strong>SVG</strong>. This book will show you several of<br />
those in more detail in Chapter 6, “<strong>SVG</strong> Tools and Resources.” In the meantime, we re<strong>com</strong>mend using<br />
any simple text editor—for example, Notepad for Windows or TextEdit (properly configured for Mac;<br />
see http://support.apple.<strong>com</strong>/kb/HT2523)—or any of the plethora of editing tools in Linux or UNIX<br />
(nano, pico, emacs, vi, ed, kate, vim, kwrite, gEdit, etc.).<br />
First, enter this very simple <strong>SVG</strong> file into your text editor, and save the file <strong>with</strong> the name<br />
myfirstfile.svg (you can save the file to your local hard drive or a remote server, so long as you know<br />
how to get to it from your web browser):<br />
<br />
<br />
<br />
CHAPTER 1 <strong>SVG</strong> Basics 5