~ubuntu-branches/ubuntu/maverick/ploticus/maverick

« back to all changes in this revision

Viewing changes to doc/svg.html

  • Committer: Bazaar Package Importer
  • Author(s): James W. Penny
  • Date: 2002-04-10 23:02:04 UTC
  • Revision ID: james.westby@ubuntu.com-20020410230204-64em4ns2f57c5u3l
Tags: 2.0.3-1
* The "That Tears it, Now You Have to Update Docs Package" Release.
* New upstream release (well, not so new :-( )   closes: Bug#137578
* Correct missing libpng2-dev in build-depends.  closes: Bug#142205
* Use correct syntax to:
* close URL type.                                closes: Bug#137577
* fix Architecture                               closes: Bug#141657
* close ITP                                      closes: Bug#132878

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<head>
 
3
<!-- This file has been generated by unroff 1.0, 03/01/02 13:57:15. -->
 
4
<!-- Do not edit! -->
 
5
<STYLE TYPE="text/css">
 
6
<!--
 
7
        A:link{text-decoration:none}
 
8
        A:visited{text-decoration:none}
 
9
        A:active{text-decoration:none}
 
10
-->
 
11
</STYLE>
 
12
<title>ploticus: scalable vector graphics (svg) format</title>
 
13
<body bgcolor=D0D0EE vlink=0000FF>
 
14
<br>
 
15
<br>
 
16
<center>
 
17
<table cellpadding=2 bgcolor=FFFFFF width=550 ><tr>
 
18
<td>
 
19
  <table cellpadding=2 width=550><tr>
 
20
  <td><br><h2>Scalable vector graphics (SVG) format</h2></td>
 
21
  <td align=right>
 
22
  <small>
 
23
  <a href="../doc/Welcome.html"><img src="../doc/ploticus.gif" border=0></a><br>
 
24
  <a href="../doc/Welcome.html">Welcome</a> &nbsp; &nbsp;
 
25
  <a href="../gallery/index.html">Gallery</a> &nbsp; &nbsp;
 
26
  <a href="../doc/Contents.html">Handbook</a> 
 
27
  <td></tr></table>
 
28
</td></tr>
 
29
<td>
 
30
<br>
 
31
<br>
 
32
 
 
33
<title>Manual page for Scalable_vector_graphics_(SVG)_format(PL)</title>
 
34
</head>
 
35
<body>
 
36
 
 
37
<p>
 
38
ploticus (2.01 or higher, all builds) can produce graphics in SVG format.<tt> </tt>
 
39
SVG is a vector graphic format supported by
 
40
<a href="http://www.adobe.com/svg">
 
41
 Adobe Systems
 
42
</a>
 
43
and defined in a 
 
44
<a href="http://www.w3.org/TR/SVG/">
 
45
 W3C spec
 
46
</a>
 
47
 . SVGs look good because nice fonts are standard,
 
48
and graphics are easily scaled up or down with no degradation in
 
49
appearance.  
 
50
SVG can be viewed with newer versions of
 
51
Netscape and MSIE browsers, and can be imported into 
 
52
MS word, MS powerpoint, etc.<tt> </tt>
 
53
 
 
54
<p>
 
55
SVG files have names ending in <tt>.svg</tt>.<tt> </tt>
 
56
SVG files can also be compressed for smaller size; these files have names ending in <tt>.svgz</tt>.<tt> </tt>
 
57
Browsers and applications that understand SVG generally understand SVG also.<tt> </tt>
 
58
Compression requires zlib and hence may not be available in all ploticus builds.<tt> </tt>
 
59
 
 
60
<br><br><br>
 
61
<h2>Generating SVG</h2>
 
62
To generate SVG, use the <b>-svg</b> or <b>-svgz</b> command line option. 
 
63
<dl>
 
64
<dt><dd><p>
 
65
<tt>pl -svgz -tag bars2.pl</tt>
 
66
</dl>
 
67
<p>
 
68
Output files will have an <tt>.svg</tt> or <tt>.svgz</tt> ending by default.<tt> </tt>
 
69
The <b>-tag</b> option may be used to have a suitable 
 
70
HTML <tt>&lt;EMBED&gt;</tt> tag written to standard output.<tt> </tt>
 
71
The <b>-zlevel </b><i>n</i> option may be used to set the compression level to <i>n</i> 
 
72
(0 - 9 where 9 is highest level of compression).<tt> </tt>
 
73
 
 
74
<br><br><br>
 
75
<h2>Embedding SVG graphics within HTML</h2>
 
76
<p>
 
77
Netscape and MSIE display SVGs using a the Adobe SVG viewer plug-in.  
 
78
To include an SVG graphic in an HTML document, use an <tt>&lt;EMBED&gt;</tt> tag like this:
 
79
<p>
 
80
<pre>
 
81
&lt;embed src="bars2.svg" name="SVGEmbed" width="500" height="616"
 
82
type="image/svg-xml" pluginspage="http://www.adobe.com/svg/viewer/install/"&gt;
 
83
</pre>
 
84
<p>
 
85
The <tt>width</tt> and <tt>height</tt> attributes control the size of the graphic
 
86
so you can adjust these to resize the graphic if desired 
 
87
(the height/width ratio should remain constant).<tt> </tt>
 
88
As with the &lt;img&gt; tag, src can be any URL, including CGI invocation.<tt> </tt>
 
89
As mentioned above, the <b>-tag</b> command line option may be used to generate a suitable 
 
90
html &lt;embed&gt; tag containing appropriate height and width values, for convenience.<tt> </tt>
 
91
 
 
92
<br><br><br>
 
93
<h2>Examples</h2>
 
94
Here is a 
 
95
<a href="../gallery/gall.svg.html">
 
96
 page of some SVG examples
 
97
</a>
 
98
(plug-in will be required).<tt> </tt>
 
99
Notice how the full size graphics are automatically sized to your browser window.<tt> </tt>
 
100
 
 
101
<br><br><br>
 
102
<h2>Fonts</h2>
 
103
<p>
 
104
Default font is <tt>Helvetica</tt>.  Postscript font names such as
 
105
<tt>Times-Roman</tt> and <tt>Courier</tt> may be used.<tt> </tt>
 
106
<a href="fonts.html">
 
107
 More info
 
108
</a>
 
109
 
 
110
 
 
111
<br><br><br>
 
112
<h2>Importing SVG into applications</h2>
 
113
Microsoft Office applications can import SVG graphics.<tt> </tt>
 
114
On the version I have, import via dragging and dropping works.  
 
115
Import via the "Insert graphic" menu does not.<tt> </tt>
 
116
 
 
117
 
 
118
<br><br><br>
 
119
<h2>Troubleshooting</h2>
 
120
The location for downloading the SVG viewer is
 
121
<a href="http://www.adobe.com/svg/viewer/install">
 
122
 www.adobe.com/svg/viewer/install
 
123
</a>
 
124
 .  Follow the instructions there for easy installation.<tt> </tt>
 
125
Then restart your browser.<tt> </tt>
 
126
If your Netscape browser doesn't display SVG properly when originating
 
127
via a web server, try accessing an SVG file directly using <tt>file:///</tt>.<tt> </tt>
 
128
If this works then there is probably a mime types problem with your 
 
129
web server.  Ask your web server administrator to add a <tt>mime.types</tt> entry 
 
130
such as this:
 
131
<dl>
 
132
<dt><dd><p>
 
133
<pre>
 
134
image/svg-xml                   svg svgz
 
135
</pre>
 
136
</dl>
 
137
<p>
 
138
Or with apache you can add lines like this to your .htaccess file:
 
139
<dl>
 
140
<dt><dd><p>
 
141
<pre>
 
142
AddType image/svg+xml svg
 
143
AddType image/svg+xml svgz
 
144
</pre>
 
145
</dl>
 
146
<p>
 
147
I have noticed that the SVG viewer plugin works differently for Netscape vs. IE,
 
148
and that there is some occasional flakiness, at least on my system.<tt> </tt>
 
149
Netscape seems more likely to default to postage-stamp size graphics when
 
150
sizes aren't fully specified.<tt> </tt>
 
151
 
 
152
 
 
153
 
 
154
<br><br><br>
 
155
<h2>Acknowledgement</h2>
 
156
Many thanks to Bill Traill 
 
157
(<tt> bill@traill.demon.co.uk </tt>)
 
158
for initiating ploticus 
 
159
SVG support and writing the ploticus SVG driver.<tt> </tt>
 
160
 
 
161
<br><br><br>
 
162
 
 
163
<br>
 
164
<br>
 
165
</td></tr>
 
166
<td align=right>
 
167
<a href="../doc/Welcome.html">
 
168
<img src="../doc/ploticus.gif" border=0></a><br><small>data display engine &nbsp; <br>
 
169
<a href="../doc/Copyright.html">Copyright Steve Grubb</a>
 
170
<br>
 
171
<br>
 
172
<center>
 
173
<img src="../gallery/all.gif">
 
174
</center>
 
175
</td></tr>
 
176
</table>
 
177
 
 
178
 
 
179
<p><hr>
 
180
Markup created by <em>unroff</em> 1.0,&#160;<tt> </tt>&#160;<tt> </tt>March 01, 2002.
 
181
</body>
 
182
</html>