Java Reference
In-Depth Information
Listing 16-11. A Simple SVG Tiny Document
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg [
<!ENTITY smile "
<rect x='0' y='0' width='128' height='128' fill='gray' stroke='black'/>
<g transform='translate(0, 0)'>
<circle cx='64' cy='64' r='64' fill='yellow'/>
<circle cx='40' cy='40' r='6.5' fill='black'/>
<circle cx='88' cy='40' r='6.5' fill='black'/>
<path d='M 40 88 L 64 96 88 88' stroke='black' stroke-width='2'/>
</g>
">
]>
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny">
<title>Smiley face</title>
&smile;
</svg>
This code produces the image you see in Figure 16-3.
Figure 16-3. A simple SVG image, rendered
In practice, however, most SVG images of any use are too complex to code by hand;
the vast number of objects in a complex image would simply take too long to produce
manually. Fortunately, most vector graphics applications, from heavyweights like Adobe
Illustrator to numerous smaller applications written by small shops and open source
teams such as Inkscape ( http://www.inkscape.org/ ), let you export images to SVG; these
tools should be familiar to any artist who produces digital content.
 
Search WWH ::




Custom Search