Dear readers: This week, I turn the Tool Bar & Grill spatula and spoon over to graphics whiz Mark Lautman, who promised to paint the whole place. See you next week!
Scalable Vector Graphics, Part 3
by Mark Lautman
Saturday nights are particularly obstreperous at the Tool Bar's Linux Room. The music is loud, the conversation effervescent, and even the police officers who are sent to quell the noise end up having a good time.
Last weekend was a bit different, though. A swaggering businessman came in and asked for a beer. "What's your line for work?" I asked him, pouring him a ps -A | grep "Heinekin".
"I'm an exporter," he said. The DJ running the sound overhead the man, and lowered the volume on the speakers. The customers became hushed.
"An exporter?" I said, my muscles tensing. I didn't want trouble. "What do you export? Cars? Clothing?"
"Oh no, nothing like that," he replied.
"Weapons? Mercenaries?" I continued, hoping for the best. I just hoped he wasn't going to say...
"File formats. You know the 'Save As' function? That's my specialty. I export files from one format to another."
It was all I could do to get the guy out of the Linux Room in one piece before the regulars jumped him and ripped every line of source code out of his body. That's the thing about the Linux Room – we work in native formats, not "Save As." Exporters and emulators don't fit in here.
That brings us to the last installment of my series on SVG. [See part 1 in post #52 and part 2 in post #54. –JP] There are lots of applications that export to the SVG format. OpenOffice saves as SVG, and I understand that Adobe Photoshop also saves as SVG. Nevertheless, most of us have been around long enough to know that exporting to a non-native format isn't always as smooth as advertised, particularly for complicated formats like SVG (or RTF or even HTML). In this column, I'll discuss a few tools that work with native SVG format, as well as how you can start to roll your own SVG.
The premier SVG editor is Inkscape (http://www.inkscape.org/) (Windows/Linux/Mac). This is a full-featured drawing program, including fills, lines, text, shadows, etc. The files are saved in native SVG; when you open the files in a text editor, you see human-readable SVG commands. Here is an example of a file open in Inkscape and the same file displayed in a web browser:
Another fine SVG editor is Sketsa (http://www.kiyut.com/products/sketsa/) (Java). This application is not quite as intuitive as Inkscape, but provides almost all the same features.
A bite-sized SVG editor is the GLIPS Grafitti Editor (http://glipssvgeditor.sourceforge.net/) (Java). It contains the basic functions included in the other two applications.
Batik (http://xmlgraphics.apache.org/batik/), sponsored by the Apache foundation, provides a way to interact with SVG files. Go ahead; try the demo at http://xmlgraphics.apache.org/batik/demo.html. You owe it to yourself. It shows how SVG will eventually make its way into the Internet, and eliminate the need for heavy plug-ins into web browsers.
For those who are mechanically inclined and like to code their own files, I highly recommend the following tutorials: The best tutorial for the OpenDocument format we discussed two weeks ago [post #54 –JP] is J. David Eisenberg's "Custom Shapes in OpenOffice.org." (http://books.evc-cit.info/odbook/custom_shapes_article.pdf). His explanation is clear and really shortens the learning curve. The file format he describes is visible only in OpenOffice.
A great tutorial for the web-based SVG format is SVGBasics (http://www.svgbasics.com/index.html). This is also a fine example of clear explanation accompanied with examples and sample code.
This completes our survey of SVG – what it is, how to view it, and how to make it. Next week I'll discuss a Maltese recipe, kwarezimal – what it is, how to view it, and how to make it.
Thanks for dropping in to the Tool Bar & Grill. Feel free to share your thoughts by clicking “comments” below or dropping me a line to email@example.com. And be sure to stop by again next week!