4
4
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
5
5
<title>SVG Surfaces</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.72.0">
6
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
7
7
<link rel="start" href="index.html" title="Cairo: A Vector Graphics Library">
8
8
<link rel="up" href="Surfaces.html" title="Surfaces">
9
9
<link rel="prev" href="cairo-Win32-Surfaces.html" title="Win32 Surfaces">
10
10
<link rel="next" href="cairo-XLib-Surfaces.html" title="XLib Surfaces">
11
<meta name="generator" content="GTK-Doc V1.8 (XML mode)">
11
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
13
<link rel="part" href="pt01.html" title="Part I. Tutorial">
14
14
<link rel="part" href="pt02.html" title="Part II. Reference">
30
30
<th width="100%" align="center">Cairo: A Vector Graphics Library</th>
31
31
<td><a accesskey="n" href="cairo-XLib-Surfaces.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
33
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2584708" class="shortcut">Top</a>
33
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2623230" class="shortcut">Top</a>
35
<a href="#id2643342" class="shortcut">Description</a></nobr></td></tr>
35
<a href="#id2655251" class="shortcut">Description</a></nobr></td></tr>
37
37
<div class="refentry" lang="en">
38
38
<a name="cairo-SVG-Surfaces"></a><div class="titlepage"></div>
39
39
<div class="refnamediv"><table width="100%"><tr>
42
<a name="id2584708"></a><span class="refentrytitle">SVG Surfaces</span>
42
<a name="id2623230"></a><span class="refentrytitle">SVG Surfaces</span>
44
44
<p>SVG Surfaces — Rendering SVG documents</p>
54
<a href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a>* <a href="cairo-SVG-Surfaces.html#cairo-svg-surface-create">cairo_svg_surface_create</a> (const char *filename,
54
<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a>* <a class="link" href="cairo-SVG-Surfaces.html#cairo-svg-surface-create">cairo_svg_surface_create</a> (const char *filename,
55
55
double width_in_points,
56
56
double height_in_points);
57
<a href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a>* <a href="cairo-SVG-Surfaces.html#cairo-svg-surface-create-for-stream">cairo_svg_surface_create_for_stream</a> (<a href="cairo-PNG-Support.html#cairo-write-func-t">cairo_write_func_t</a> write_func,
57
<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a>* <a class="link" href="cairo-SVG-Surfaces.html#cairo-svg-surface-create-for-stream">cairo_svg_surface_create_for_stream</a> (<a class="link" href="cairo-PNG-Support.html#cairo-write-func-t">cairo_write_func_t</a> write_func,
59
59
double width_in_points,
60
60
double height_in_points);
61
void <a href="cairo-SVG-Surfaces.html#cairo-svg-surface-restrict-to-version">cairo_svg_surface_restrict_to_version</a>
62
(<a href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a> *surface,
63
<a href="cairo-SVG-Surfaces.html#cairo-svg-version-t">cairo_svg_version_t</a> version);
64
enum <a href="cairo-SVG-Surfaces.html#cairo-svg-version-t">cairo_svg_version_t</a>;
65
void <a href="cairo-SVG-Surfaces.html#cairo-svg-get-versions">cairo_svg_get_versions</a> (<a href="cairo-SVG-Surfaces.html#cairo-svg-version-t">cairo_svg_version_t</a> const **versions,
61
void <a class="link" href="cairo-SVG-Surfaces.html#cairo-svg-surface-restrict-to-version">cairo_svg_surface_restrict_to_version</a>
62
(<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a> *surface,
63
<a class="link" href="cairo-SVG-Surfaces.html#cairo-svg-version-t">cairo_svg_version_t</a> version);
64
enum <a class="link" href="cairo-SVG-Surfaces.html#cairo-svg-version-t">cairo_svg_version_t</a>;
65
void <a class="link" href="cairo-SVG-Surfaces.html#cairo-svg-get-versions">cairo_svg_get_versions</a> (<a class="link" href="cairo-SVG-Surfaces.html#cairo-svg-version-t">cairo_svg_version_t</a> const **versions,
66
66
int *num_versions);
67
const char* <a href="cairo-SVG-Surfaces.html#cairo-svg-version-to-string">cairo_svg_version_to_string</a> (<a href="cairo-SVG-Surfaces.html#cairo-svg-version-t">cairo_svg_version_t</a> version);
67
const char* <a class="link" href="cairo-SVG-Surfaces.html#cairo-svg-version-to-string">cairo_svg_version_to_string</a> (<a class="link" href="cairo-SVG-Surfaces.html#cairo-svg-version-t">cairo_svg_version_t</a> version);
70
70
<div class="refsect1" lang="en">
71
<a name="id2643342"></a><h2>Description</h2>
71
<a name="id2655251"></a><h2>Description</h2>
76
76
<div class="refsect1" lang="en">
77
<a name="id2643358"></a><h2>Details</h2>
77
<a name="id2655267"></a><h2>Details</h2>
78
78
<div class="refsect2" lang="en">
79
<a name="id2643368"></a><h3>
79
<a name="id2655278"></a><h3>
80
80
<a name="cairo-svg-surface-create"></a>cairo_svg_surface_create ()</h3>
81
<a class="indexterm" name="id2643382"></a><pre class="programlisting"><a href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a>* cairo_svg_surface_create (const char *filename,
81
<a class="indexterm" name="id2655291"></a><pre class="programlisting"><a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a>* cairo_svg_surface_create (const char *filename,
82
82
double width_in_points,
83
83
double height_in_points);</pre>
91
91
<col align="left" valign="top">
94
<td><span class="term"><em class="parameter"><code>filename</code></em> :</span></td>
94
<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
95
95
<td> a filename for the SVG output (must be writable)
99
<td><span class="term"><em class="parameter"><code>width_in_points</code></em> :</span></td>
99
<td><p><span class="term"><em class="parameter"><code>width_in_points</code></em> :</span></p></td>
100
100
<td> width of the surface, in points (1 point == 1/72.0 inch)
104
<td><span class="term"><em class="parameter"><code>height_in_points</code></em> :</span></td>
104
<td><p><span class="term"><em class="parameter"><code>height_in_points</code></em> :</span></p></td>
105
105
<td> height of the surface, in points (1 point == 1/72.0 inch)
109
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
109
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
110
110
<td> a pointer to the newly created surface. The caller
111
111
owns the surface and should call cairo_surface_destroy when done
114
114
This function always returns a valid pointer, but it will return a
115
115
pointer to a "nil" surface if an error such as out of memory
116
occurs. You can use <a href="cairo-cairo-surface-t.html#cairo-surface-status"><code class="function">cairo_surface_status()</code></a> to check for this.
116
occurs. You can use <a class="link" href="cairo-cairo-surface-t.html#cairo-surface-status"><code class="function">cairo_surface_status()</code></a> to check for this.
126
126
<div class="refsect2" lang="en">
127
<a name="id2643514"></a><h3>
127
<a name="id2655424"></a><h3>
128
128
<a name="cairo-svg-surface-create-for-stream"></a>cairo_svg_surface_create_for_stream ()</h3>
129
<a class="indexterm" name="id2643528"></a><pre class="programlisting"><a href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a>* cairo_svg_surface_create_for_stream (<a href="cairo-PNG-Support.html#cairo-write-func-t">cairo_write_func_t</a> write_func,
129
<a class="indexterm" name="id2655437"></a><pre class="programlisting"><a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a>* cairo_svg_surface_create_for_stream (<a class="link" href="cairo-PNG-Support.html#cairo-write-func-t">cairo_write_func_t</a> write_func,
131
131
double width_in_points,
132
132
double height_in_points);</pre>
140
140
<col align="left" valign="top">
143
<td><span class="term"><em class="parameter"><code>write_func</code></em> :</span></td>
144
<td> a <a href="cairo-PNG-Support.html#cairo-write-func-t"><span class="type">cairo_write_func_t</span></a> to accept the output data
143
<td><p><span class="term"><em class="parameter"><code>write_func</code></em> :</span></p></td>
144
<td> a <a class="link" href="cairo-PNG-Support.html#cairo-write-func-t"><span class="type">cairo_write_func_t</span></a> to accept the output data
148
<td><span class="term"><em class="parameter"><code>closure</code></em> :</span></td>
148
<td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
149
149
<td> the closure argument for <em class="parameter"><code>write_func</code></em>
153
<td><span class="term"><em class="parameter"><code>width_in_points</code></em> :</span></td>
153
<td><p><span class="term"><em class="parameter"><code>width_in_points</code></em> :</span></p></td>
154
154
<td> width of the surface, in points (1 point == 1/72.0 inch)
158
<td><span class="term"><em class="parameter"><code>height_in_points</code></em> :</span></td>
158
<td><p><span class="term"><em class="parameter"><code>height_in_points</code></em> :</span></p></td>
159
159
<td> height of the surface, in points (1 point == 1/72.0 inch)
163
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
163
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
164
164
<td> a pointer to the newly created surface. The caller
165
165
owns the surface and should call cairo_surface_destroy when done
168
168
This function always returns a valid pointer, but it will return a
169
169
pointer to a "nil" surface if an error such as out of memory
170
occurs. You can use <a href="cairo-cairo-surface-t.html#cairo-surface-status"><code class="function">cairo_surface_status()</code></a> to check for this.
170
occurs. You can use <a class="link" href="cairo-cairo-surface-t.html#cairo-surface-status"><code class="function">cairo_surface_status()</code></a> to check for this.
180
180
<div class="refsect2" lang="en">
181
<a name="id2643700"></a><h3>
181
<a name="id2655609"></a><h3>
182
182
<a name="cairo-svg-surface-restrict-to-version"></a>cairo_svg_surface_restrict_to_version ()</h3>
183
<a class="indexterm" name="id2643713"></a><pre class="programlisting">void cairo_svg_surface_restrict_to_version
184
(<a href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a> *surface,
185
<a href="cairo-SVG-Surfaces.html#cairo-svg-version-t">cairo_svg_version_t</a> version);</pre>
183
<a class="indexterm" name="id2655623"></a><pre class="programlisting">void cairo_svg_surface_restrict_to_version
184
(<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t">cairo_surface_t</a> *surface,
185
<a class="link" href="cairo-SVG-Surfaces.html#cairo-svg-version-t">cairo_svg_version_t</a> version);</pre>
187
Restricts the generated SVG file to <em class="parameter"><code>version</code></em>. See <a href="cairo-SVG-Surfaces.html#cairo-svg-get-versions"><code class="function">cairo_svg_get_versions()</code></a>
187
Restricts the generated SVG file to <em class="parameter"><code>version</code></em>. See <a class="link" href="cairo-SVG-Surfaces.html#cairo-svg-get-versions"><code class="function">cairo_svg_get_versions()</code></a>
188
188
for a list of available version values that can be used here.
199
199
<col align="left" valign="top">
202
<td><span class="term"><em class="parameter"><code>surface</code></em> :</span></td>
203
<td> a SVG <a href="cairo-cairo-surface-t.html#cairo-surface-t"><span class="type">cairo_surface_t</span></a>
202
<td><p><span class="term"><em class="parameter"><code>surface</code></em> :</span></p></td>
203
<td> a SVG <a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t"><span class="type">cairo_surface_t</span></a>
207
<td><span class="term"><em class="parameter"><code>version</code></em> :</span></td>
207
<td><p><span class="term"><em class="parameter"><code>version</code></em> :</span></p></td>
217
217
<div class="refsect2" lang="en">
218
<a name="id2643822"></a><h3>
218
<a name="id2655734"></a><h3>
219
219
<a name="cairo-svg-version-t"></a>enum cairo_svg_version_t</h3>
220
<a class="indexterm" name="id2643835"></a><pre class="programlisting">typedef enum _cairo_svg_version {
220
<a class="indexterm" name="id2661408"></a><pre class="programlisting">typedef enum _cairo_svg_version {
221
221
CAIRO_SVG_VERSION_1_1,
222
222
CAIRO_SVG_VERSION_1_2
223
223
} cairo_svg_version_t;
226
<a href="cairo-SVG-Surfaces.html#cairo-svg-version-t"><span class="type">cairo_svg_version_t</span></a> is used to describe the version number of the SVG
226
<a class="link" href="cairo-SVG-Surfaces.html#cairo-svg-version-t"><span class="type">cairo_svg_version_t</span></a> is used to describe the version number of the SVG
227
227
specification that a generated SVG file will conform to.</p>
232
232
<col align="left" valign="top">
235
<td><span class="term"><a name="CAIRO-SVG-VERSION-1-1:CAPS"></a><code class="literal">CAIRO_SVG_VERSION_1_1</code></span></td>
235
<td><p><span class="term"><a name="CAIRO-SVG-VERSION-1-1:CAPS"></a><code class="literal">CAIRO_SVG_VERSION_1_1</code></span></p></td>
236
236
<td> The version 1.1 of the SVG specification.
240
<td><span class="term"><a name="CAIRO-SVG-VERSION-1-2:CAPS"></a><code class="literal">CAIRO_SVG_VERSION_1_2</code></span></td>
240
<td><p><span class="term"><a name="CAIRO-SVG-VERSION-1-2:CAPS"></a><code class="literal">CAIRO_SVG_VERSION_1_2</code></span></p></td>
241
241
<td> The version 1.2 of the SVG specification.
248
248
<div class="refsect2" lang="en">
249
<a name="id2644186"></a><h3>
249
<a name="id2661484"></a><h3>
250
250
<a name="cairo-svg-get-versions"></a>cairo_svg_get_versions ()</h3>
251
<a class="indexterm" name="id2644199"></a><pre class="programlisting">void cairo_svg_get_versions (<a href="cairo-SVG-Surfaces.html#cairo-svg-version-t">cairo_svg_version_t</a> const **versions,
251
<a class="indexterm" name="id2661497"></a><pre class="programlisting">void cairo_svg_get_versions (<a class="link" href="cairo-SVG-Surfaces.html#cairo-svg-version-t">cairo_svg_version_t</a> const **versions,
252
252
int *num_versions);</pre>
254
254
Used to retrieve the list of supported versions. See
255
<a href="cairo-SVG-Surfaces.html#cairo-svg-surface-restrict-to-version"><code class="function">cairo_svg_surface_restrict_to_version()</code></a>.</p>
255
<a class="link" href="cairo-SVG-Surfaces.html#cairo-svg-surface-restrict-to-version"><code class="function">cairo_svg_surface_restrict_to_version()</code></a>.</p>
260
260
<col align="left" valign="top">
263
<td><span class="term"><em class="parameter"><code>versions</code></em> :</span></td>
263
<td><p><span class="term"><em class="parameter"><code>versions</code></em> :</span></p></td>
264
264
<td> supported version list
268
<td><span class="term"><em class="parameter"><code>num_versions</code></em> :</span></td>
268
<td><p><span class="term"><em class="parameter"><code>num_versions</code></em> :</span></p></td>
278
278
<div class="refsect2" lang="en">
279
<a name="id2644289"></a><h3>
279
<a name="id2661586"></a><h3>
280
280
<a name="cairo-svg-version-to-string"></a>cairo_svg_version_to_string ()</h3>
281
<a class="indexterm" name="id2644302"></a><pre class="programlisting">const char* cairo_svg_version_to_string (<a href="cairo-SVG-Surfaces.html#cairo-svg-version-t">cairo_svg_version_t</a> version);</pre>
281
<a class="indexterm" name="id2661600"></a><pre class="programlisting">const char* cairo_svg_version_to_string (<a class="link" href="cairo-SVG-Surfaces.html#cairo-svg-version-t">cairo_svg_version_t</a> version);</pre>
283
283
Get the string representation of the given <em class="parameter"><code>version</code></em> id. This function
284
will return NULL if <em class="parameter"><code>version</code></em> isn't valid. See <a href="cairo-SVG-Surfaces.html#cairo-svg-get-versions"><code class="function">cairo_svg_get_versions()</code></a>
284
will return NULL if <em class="parameter"><code>version</code></em> isn't valid. See <a class="link" href="cairo-SVG-Surfaces.html#cairo-svg-get-versions"><code class="function">cairo_svg_get_versions()</code></a>
285
285
for a way to get the list of valid version ids.</p>
290
290
<col align="left" valign="top">
293
<td><span class="term"><em class="parameter"><code>version</code></em> :</span></td>
293
<td><p><span class="term"><em class="parameter"><code>version</code></em> :</span></p></td>
294
294
<td> a version id
298
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
298
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
299
299
<td> the string associated to given version.