1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>Cairo Rendering</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.74.3">
7 <link rel="home" href="index.html" title="Pango Reference Manual">
8 <link rel="up" href="rendering.html" title="Rendering with Pango">
9 <link rel="prev" href="pango-Xft-Fonts-and-Rendering.html" title="Xft Fonts and Rendering">
10 <link rel="next" href="pango-ATSUI-Fonts.html" title="ATSUI Fonts">
11 <meta name="generator" content="GTK-Doc V1.11 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 <link rel="chapter" href="pango.html" title="Basic Pango Interfaces">
14 <link rel="chapter" href="rendering.html" title="Rendering with Pango">
15 <link rel="chapter" href="lowlevel.html" title="Low Level Functionality">
16 <link rel="chapter" href="tools.html" title="Pango Tools">
17 <link rel="chapter" href="pango-hierarchy.html" title="Object Hierarchy">
18 <link rel="index" href="index-all.html" title="Index">
19 <link rel="index" href="index-deprecated.html" title="Index of deprecated symbols">
20 <link rel="index" href="index-1.2.html" title="Index of new symbols in 1.2">
21 <link rel="index" href="index-1.4.html" title="Index of new symbols in 1.4">
22 <link rel="index" href="index-1.6.html" title="Index of new symbols in 1.6">
23 <link rel="index" href="index-1.8.html" title="Index of new symbols in 1.8">
24 <link rel="index" href="index-1.10.html" title="Index of new symbols in 1.10">
25 <link rel="index" href="index-1.12.html" title="Index of new symbols in 1.12">
26 <link rel="index" href="index-1.14.html" title="Index of new symbols in 1.14">
27 <link rel="index" href="index-1.16.html" title="Index of new symbols in 1.16">
28 <link rel="index" href="index-1.18.html" title="Index of new symbols in 1.18">
29 <link rel="index" href="index-1.20.html" title="Index of new symbols in 1.20">
30 <link rel="index" href="index-1.22.html" title="Index of new symbols in 1.22">
31 <link rel="index" href="index-1.24.html" title="Index of new symbols in 1.24">
32 <link rel="index" href="index-1.26.html" title="Index of new symbols in 1.26">
34 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
35 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
37 <td><a accesskey="p" href="pango-Xft-Fonts-and-Rendering.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
38 <td><a accesskey="u" href="rendering.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
39 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
40 <th width="100%" align="center">Pango Reference Manual</th>
41 <td><a accesskey="n" href="pango-ATSUI-Fonts.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
43 <tr><td colspan="5" class="shortcuts">
44 <a href="#pango-Cairo-Rendering.synopsis" class="shortcut">Top</a>
46 <a href="#pango-Cairo-Rendering.description" class="shortcut">Description</a>
48 <a href="#pango-Cairo-Rendering.object-hierarchy" class="shortcut">Object Hierarchy</a>
50 <a href="#pango-Cairo-Rendering.prerequisites" class="shortcut">Prerequisites</a>
53 <div class="refentry" lang="en">
54 <a name="pango-Cairo-Rendering"></a><div class="titlepage"></div>
55 <div class="refnamediv"><table width="100%"><tr>
57 <h2><span class="refentrytitle"><a name="pango-Cairo-Rendering.top_of_page"></a>Cairo Rendering</span></h2>
58 <p>Cairo Rendering — Rendering with the Cairo backend</p>
60 <td valign="top" align="right"></td>
62 <div class="refsynopsisdiv">
63 <a name="pango-Cairo-Rendering.synopsis"></a><h2>Synopsis</h2>
64 <a name="PangoCairoFont"></a><a name="PangoCairoFontMap"></a><pre class="synopsis">
65 <a class="link" href="pango-Cairo-Rendering.html#PangoCairoFont-struct" title="PangoCairoFont">PangoCairoFont</a>;
66 <a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap-struct" title="PangoCairoFontMap">PangoCairoFontMap</a>;
67 <a class="link" href="pango-Fonts.html#PangoFontMap">PangoFontMap</a> * <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-font-map-get-default" title="pango_cairo_font_map_get_default ()">pango_cairo_font_map_get_default</a> (void);
68 void <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-font-map-set-default" title="pango_cairo_font_map_set_default ()">pango_cairo_font_map_set_default</a> (<a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap">PangoCairoFontMap</a> *fontmap);
69 <a class="link" href="pango-Fonts.html#PangoFontMap">PangoFontMap</a> * <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-font-map-new" title="pango_cairo_font_map_new ()">pango_cairo_font_map_new</a> (void);
70 <a class="link" href="pango-Fonts.html#PangoFontMap">PangoFontMap</a> * <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-font-map-new-for-font-type" title="pango_cairo_font_map_new_for_font_type ()">pango_cairo_font_map_new_for_font_type</a>
72 href="/usr/share/gtk-doc/html/cairo/cairo-font-face.html#cairo-font-type-t"
73 >cairo_font_type_t</a> fonttype);
75 href="/usr/share/gtk-doc/html/cairo/cairo-font-face.html#cairo-font-type-t"
76 >cairo_font_type_t</a> <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-font-map-get-font-type" title="pango_cairo_font_map_get_font_type ()">pango_cairo_font_map_get_font_type</a> (<a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap">PangoCairoFontMap</a> *fontmap);
77 void <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-font-map-set-resolution" title="pango_cairo_font_map_set_resolution ()">pango_cairo_font_map_set_resolution</a> (<a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap">PangoCairoFontMap</a> *fontmap,
79 double <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-font-map-get-resolution" title="pango_cairo_font_map_get_resolution ()">pango_cairo_font_map_get_resolution</a> (<a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap">PangoCairoFontMap</a> *fontmap);
80 <a class="link" href="pango-Text-Processing.html#PangoContext">PangoContext</a> * <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-font-map-create-context" title="pango_cairo_font_map_create_context ()">pango_cairo_font_map_create_context</a> (<a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap">PangoCairoFontMap</a> *fontmap);
82 href="/usr/share/gtk-doc/html/cairo/cairo-scaled-font.html#cairo-scaled-font-t"
83 >cairo_scaled_font_t</a> * <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-font-get-scaled-font" title="pango_cairo_font_get_scaled_font ()">pango_cairo_font_get_scaled_font</a> (<a class="link" href="pango-Cairo-Rendering.html#PangoCairoFont">PangoCairoFont</a> *font);
84 void <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-context-set-resolution" title="pango_cairo_context_set_resolution ()">pango_cairo_context_set_resolution</a> (<a class="link" href="pango-Text-Processing.html#PangoContext">PangoContext</a> *context,
86 double <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-context-get-resolution" title="pango_cairo_context_get_resolution ()">pango_cairo_context_get_resolution</a> (<a class="link" href="pango-Text-Processing.html#PangoContext">PangoContext</a> *context);
87 void <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-context-set-font-options" title="pango_cairo_context_set_font_options ()">pango_cairo_context_set_font_options</a>
88 (<a class="link" href="pango-Text-Processing.html#PangoContext">PangoContext</a> *context,
90 href="/usr/share/gtk-doc/html/cairo/cairo-font-options.html#cairo-font-options-t"
91 >cairo_font_options_t</a> *options);
93 href="/usr/share/gtk-doc/html/cairo/cairo-font-options.html#cairo-font-options-t"
94 >cairo_font_options_t</a> * <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-context-get-font-options" title="pango_cairo_context_get_font_options ()">pango_cairo_context_get_font_options</a>
95 (<a class="link" href="pango-Text-Processing.html#PangoContext">PangoContext</a> *context);
96 void (<a class="link" href="pango-Cairo-Rendering.html#PangoCairoShapeRendererFunc" title="PangoCairoShapeRendererFunc ()">*PangoCairoShapeRendererFunc</a>) (<a
97 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
99 <a class="link" href="pango-Text-Attributes.html#PangoAttrShape" title="PangoAttrShape">PangoAttrShape</a> *attr,
101 href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
102 >gboolean</a> do_path,
104 href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
106 void <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-context-set-shape-renderer" title="pango_cairo_context_set_shape_renderer ()">pango_cairo_context_set_shape_renderer</a>
107 (<a class="link" href="pango-Text-Processing.html#PangoContext">PangoContext</a> *context,
108 <a class="link" href="pango-Cairo-Rendering.html#PangoCairoShapeRendererFunc" title="PangoCairoShapeRendererFunc ()">PangoCairoShapeRendererFunc</a> func,
110 href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
113 href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
114 >GDestroyNotify</a> dnotify);
115 <a class="link" href="pango-Cairo-Rendering.html#PangoCairoShapeRendererFunc" title="PangoCairoShapeRendererFunc ()">PangoCairoShapeRendererFunc</a> <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-context-get-shape-renderer" title="pango_cairo_context_get_shape_renderer ()">pango_cairo_context_get_shape_renderer</a>
116 (<a class="link" href="pango-Text-Processing.html#PangoContext">PangoContext</a> *context,
118 href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
119 >gpointer</a> *data);
120 <a class="link" href="pango-Text-Processing.html#PangoContext">PangoContext</a> * <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-create-context" title="pango_cairo_create_context ()">pango_cairo_create_context</a> (<a
121 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
123 void <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-update-context" title="pango_cairo_update_context ()">pango_cairo_update_context</a> (<a
124 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
126 <a class="link" href="pango-Text-Processing.html#PangoContext">PangoContext</a> *context);
127 <a class="link" href="pango-Layout-Objects.html#PangoLayout">PangoLayout</a> * <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-create-layout" title="pango_cairo_create_layout ()">pango_cairo_create_layout</a> (<a
128 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
130 void <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-update-layout" title="pango_cairo_update_layout ()">pango_cairo_update_layout</a> (<a
131 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
133 <a class="link" href="pango-Layout-Objects.html#PangoLayout">PangoLayout</a> *layout);
134 void <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-show-glyph-string" title="pango_cairo_show_glyph_string ()">pango_cairo_show_glyph_string</a> (<a
135 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
137 <a class="link" href="pango-Fonts.html#PangoFont">PangoFont</a> *font,
138 <a class="link" href="pango-Glyph-Storage.html#PangoGlyphString" title="PangoGlyphString">PangoGlyphString</a> *glyphs);
139 void <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-show-glyph-item" title="pango_cairo_show_glyph_item ()">pango_cairo_show_glyph_item</a> (<a
140 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
143 <a class="link" href="pango-Glyph-Storage.html#PangoGlyphItem" title="PangoGlyphItem">PangoGlyphItem</a> *glyph_item);
144 void <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-show-layout-line" title="pango_cairo_show_layout_line ()">pango_cairo_show_layout_line</a> (<a
145 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
147 <a class="link" href="pango-Layout-Objects.html#PangoLayoutLine" title="PangoLayoutLine">PangoLayoutLine</a> *line);
148 void <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-show-layout" title="pango_cairo_show_layout ()">pango_cairo_show_layout</a> (<a
149 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
151 <a class="link" href="pango-Layout-Objects.html#PangoLayout">PangoLayout</a> *layout);
152 void <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-show-error-underline" title="pango_cairo_show_error_underline ()">pango_cairo_show_error_underline</a> (<a
153 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
159 void <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-glyph-string-path" title="pango_cairo_glyph_string_path ()">pango_cairo_glyph_string_path</a> (<a
160 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
162 <a class="link" href="pango-Fonts.html#PangoFont">PangoFont</a> *font,
163 <a class="link" href="pango-Glyph-Storage.html#PangoGlyphString" title="PangoGlyphString">PangoGlyphString</a> *glyphs);
164 void <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-layout-line-path" title="pango_cairo_layout_line_path ()">pango_cairo_layout_line_path</a> (<a
165 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
167 <a class="link" href="pango-Layout-Objects.html#PangoLayoutLine" title="PangoLayoutLine">PangoLayoutLine</a> *line);
168 void <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-layout-path" title="pango_cairo_layout_path ()">pango_cairo_layout_path</a> (<a
169 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
171 <a class="link" href="pango-Layout-Objects.html#PangoLayout">PangoLayout</a> *layout);
172 void <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-error-underline-path" title="pango_cairo_error_underline_path ()">pango_cairo_error_underline_path</a> (<a
173 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
181 <div class="refsect1" lang="en">
182 <a name="pango-Cairo-Rendering.object-hierarchy"></a><h2>Object Hierarchy</h2>
183 <pre class="synopsis">
187 <pre class="synopsis">
189 +----PangoCairoFontMap
192 <div class="refsect1" lang="en">
193 <a name="pango-Cairo-Rendering.prerequisites"></a><h2>Prerequisites</h2>
195 PangoCairoFont requires
196 <a class="link" href="pango-Fonts.html#PangoFont">PangoFont</a>.</p>
198 PangoCairoFontMap requires
199 <a class="link" href="pango-Fonts.html#PangoFontMap">PangoFontMap</a>.</p>
201 <div class="refsect1" lang="en">
202 <a name="pango-Cairo-Rendering.description"></a><h2>Description</h2>
204 The <a class="ulink" href="http://cairographics.org" target="_top">Cairo library</a> is a
205 vector graphics library with a powerful rendering model. It has such
206 features as anti-aliased primitives, alpha-compositing, and
207 gradients. Multiple backends for Cairo are available, to allow
208 rendering to images, to PDF files, and to the screen on X and on other
209 windowing systems. The functions in this section allow using Pango
210 to render to Cairo surfaces.
213 Using Pango with Cairo is straightforward. A <a class="link" href="pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a> created
214 with <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-font-map-create-context" title="pango_cairo_font_map_create_context ()"><code class="function">pango_cairo_font_map_create_context()</code></a> can be used on any
215 Cairo context (cairo_t), but needs to be updated to match the
216 current transformation matrix and target surface of the Cairo context
217 using <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-update-context" title="pango_cairo_update_context ()"><code class="function">pango_cairo_update_context()</code></a>. The convenience functions
218 <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-create-layout" title="pango_cairo_create_layout ()"><code class="function">pango_cairo_create_layout()</code></a> and <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-update-layout" title="pango_cairo_update_layout ()"><code class="function">pango_cairo_update_layout()</code></a> handle
219 the common case where the program doesn't need to manipulate the
220 properties of the <a class="link" href="pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a>.
223 When you get the metrics of a layout or of a piece of a layout using
224 functions such as <a class="link" href="pango-Layout-Objects.html#pango-layout-get-extents" title="pango_layout_get_extents ()"><code class="function">pango_layout_get_extents()</code></a>, the reported metrics
225 are in user-space coordinates. If a piece of text is 10 units long,
226 and you call cairo_scale (cr, 2.0), it still is more-or-less 10
227 units long. However, the results will be affected by hinting
228 (that is, the process of adjusting the text to look good on the
229 pixel grid), so you shouldn't assume they are completely independent
230 of the current transformation matrix. Note that the basic metrics
231 functions in Pango report results in integer Pango units. To get
232 to the floating point units used in Cairo divide by <a class="link" href="pango-Glyph-Storage.html#PANGO-SCALE--CAPS" title="PANGO_SCALE"><code class="literal">PANGO_SCALE</code></a>.
234 <div class="example">
235 <a name="rotated-example"></a><p class="title"><b>Example 1. Using Pango with Cairo</b></p>
236 <div class="example-contents"><pre class="programlisting">
237 #include <math.h>
238 #include <pango/pangocairo.h>
240 draw_text (cairo_t *cr)
244 #define FONT "Sans Bold 27"
246 PangoFontDescription *desc;
248 /* Center coordinates on the middle of the region we are drawing
250 cairo_translate (cr, RADIUS, RADIUS);
251 /* Create a PangoLayout, set the font and text */
252 layout = pango_cairo_create_layout (cr);
253 pango_layout_set_text (layout, "Text", -1);
254 desc = pango_font_description_from_string (FONT);
255 pango_layout_set_font_description (layout, desc);
256 pango_font_description_free (desc);
257 /* Draw the layout N_WORDS times in a circle */
258 for (i = 0; i < N_WORDS; i++)
261 double angle = (360. * i) / N_WORDS;
264 /* Gradient from red at angle == 60 to blue at angle == 240 */
265 red = (1 + cos ((angle - 60) * G_PI / 180.)) / 2;
266 cairo_set_source_rgb (cr, red, 0, 1.0 - red);
267 cairo_rotate (cr, angle * G_PI / 180.);
268 /* Inform Pango to re-layout the text with the new transformation */
269 pango_cairo_update_layout (cr, layout);
270 pango_layout_get_size (layout, &width, &height);
271 cairo_move_to (cr, - ((double)width / PANGO_SCALE) / 2, - RADIUS);
272 pango_cairo_show_layout (cr, layout);
275 /* free the layout object */
276 g_object_unref (layout);
278 int main (int argc, char **argv)
282 cairo_status_t status;
283 cairo_surface_t *surface;
286 g_printerr ("Usage: cairosimple OUTPUT_FILENAME\n");
290 surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
291 2 * RADIUS, 2 * RADIUS);
292 cr = cairo_create (surface);
293 cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
297 status = cairo_surface_write_to_png (surface, filename);
298 cairo_surface_destroy (surface);
299 if (status != CAIRO_STATUS_SUCCESS)
301 g_printerr ("Could not save png to '%s'\n", filename);
308 <br class="example-break"><div class="figure">
309 <a name="rotated-example-output"></a><p class="title"><b>Figure 2. Output of <a class="xref" href="pango-Cairo-Rendering.html#rotated-example" title="Example 1. Using Pango with Cairo">Example 1, “Using Pango with Cairo”</a></b></p>
310 <div class="figure-contents"><div><img src="rotated-text.png" alt="Output of"></div></div>
312 <br class="figure-break">
314 <div class="refsect1" lang="en">
315 <a name="pango-Cairo-Rendering.details"></a><h2>Details</h2>
316 <div class="refsect2" lang="en">
317 <a name="PangoCairoFont-struct"></a><h3>PangoCairoFont</h3>
318 <pre class="programlisting">typedef struct _PangoCairoFont PangoCairoFont;</pre>
320 <a class="link" href="pango-Cairo-Rendering.html#PangoCairoFont"><span class="type">PangoCairoFont</span></a> is an interface exported by fonts for
321 use with Cairo. The actual type of the font will depend
322 on the particular font technology Cairo was compiled to use.</p>
325 <p class="since">Since 1.18</p>
328 <div class="refsect2" lang="en">
329 <a name="PangoCairoFontMap-struct"></a><h3>PangoCairoFontMap</h3>
330 <pre class="programlisting">typedef struct _PangoCairoFontMap PangoCairoFontMap;</pre>
332 <a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap"><span class="type">PangoCairoFontMap</span></a> is an interface exported by font maps for
333 use with Cairo. The actual type of the font map will depend
334 on the particular font technology Cairo was compiled to use.</p>
337 <p class="since">Since 1.10</p>
340 <div class="refsect2" lang="en">
341 <a name="pango-cairo-font-map-get-default"></a><h3>pango_cairo_font_map_get_default ()</h3>
342 <pre class="programlisting"><a class="link" href="pango-Fonts.html#PangoFontMap">PangoFontMap</a> * pango_cairo_font_map_get_default (void);</pre>
344 Gets a default <a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap"><span class="type">PangoCairoFontMap</span></a> to use with Cairo.
347 Note that the type of the returned object will depend
348 on the particular font backend Cairo was compiled to use;
349 You generally should only use the <a class="link" href="pango-Fonts.html#PangoFontMap"><span class="type">PangoFontMap</span></a> and
350 <a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap"><span class="type">PangoCairoFontMap</span></a> interfaces on the returned object.
353 The default Cairo fontmap can be changed by using
354 <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-font-map-set-default" title="pango_cairo_font_map_set_default ()"><code class="function">pango_cairo_font_map_set_default()</code></a>. This can be used to
355 change the Cairo font backend that the default fontmap
356 uses for example.</p>
359 <div class="variablelist"><table border="0">
360 <col align="left" valign="top">
362 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
363 <td> the default Cairo fontmap for Pango. This
364 object is owned by Pango and must not be freed.
369 <p class="since">Since 1.10</p>
372 <div class="refsect2" lang="en">
373 <a name="pango-cairo-font-map-set-default"></a><h3>pango_cairo_font_map_set_default ()</h3>
374 <pre class="programlisting">void pango_cairo_font_map_set_default (<a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap">PangoCairoFontMap</a> *fontmap);</pre>
376 Sets a default <a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap"><span class="type">PangoCairoFontMap</span></a> to use with Cairo.
379 This can be used to change the Cairo font backend that the
380 default fontmap uses for example. The old default font map
381 is unreffed and the new font map referenced.
385 href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
386 ><code class="literal">NULL</code></a> for <em class="parameter"><code>fontmap</code></em> will cause the current default
387 font map to be released and a new default font
388 map to be created on demand, using <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-font-map-new" title="pango_cairo_font_map_new ()"><code class="function">pango_cairo_font_map_new()</code></a>.</p>
391 <div class="variablelist"><table border="0">
392 <col align="left" valign="top">
394 <td><p><span class="term"><em class="parameter"><code>fontmap</code></em> :</span></p></td>
395 <td> The new default font map, or <a
396 href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
397 ><code class="literal">NULL</code></a>
401 <p class="since">Since 1.22</p>
404 <div class="refsect2" lang="en">
405 <a name="pango-cairo-font-map-new"></a><h3>pango_cairo_font_map_new ()</h3>
406 <pre class="programlisting"><a class="link" href="pango-Fonts.html#PangoFontMap">PangoFontMap</a> * pango_cairo_font_map_new (void);</pre>
408 Creates a new <a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap"><span class="type">PangoCairoFontMap</span></a> object; a fontmap is used
409 to cache information about available fonts, and holds
410 certain global parameters such as the resolution.
411 In most cases, you can use <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-font-map-get-default" title="pango_cairo_font_map_get_default ()"><code class="function">pango_cairo_font_map_get_default()</code></a>
415 Note that the type of the returned object will depend
416 on the particular font backend Cairo was compiled to use;
417 You generally should only use the <a class="link" href="pango-Fonts.html#PangoFontMap"><span class="type">PangoFontMap</span></a> and
418 <a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap"><span class="type">PangoCairoFontMap</span></a> interfaces on the returned object.</p>
421 <div class="variablelist"><table border="0">
422 <col align="left" valign="top">
424 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
425 <td> the newly allocated <a class="link" href="pango-Fonts.html#PangoFontMap"><span class="type">PangoFontMap</span></a>, which should
427 href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"
428 ><code class="function">g_object_unref()</code></a>.
433 <p class="since">Since 1.10</p>
436 <div class="refsect2" lang="en">
437 <a name="pango-cairo-font-map-new-for-font-type"></a><h3>pango_cairo_font_map_new_for_font_type ()</h3>
438 <pre class="programlisting"><a class="link" href="pango-Fonts.html#PangoFontMap">PangoFontMap</a> * pango_cairo_font_map_new_for_font_type
440 href="/usr/share/gtk-doc/html/cairo/cairo-font-face.html#cairo-font-type-t"
441 >cairo_font_type_t</a> fonttype);</pre>
443 Creates a new <a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap"><span class="type">PangoCairoFontMap</span></a> object of the type suitable
444 to be used with cairo font backend of type <em class="parameter"><code>fonttype</code></em>.
447 In most cases one should simply use @<a class="link" href="pango-Cairo-Rendering.html#pango-cairo-font-map-new" title="pango_cairo_font_map_new ()"><code class="function">pango_cairo_font_map_new()</code></a>,
448 or in fact in most of those cases, just use
449 @<a class="link" href="pango-Cairo-Rendering.html#pango-cairo-font-map-get-default" title="pango_cairo_font_map_get_default ()"><code class="function">pango_cairo_font_map_get_default()</code></a>.</p>
452 <div class="variablelist"><table border="0">
453 <col align="left" valign="top">
456 <td><p><span class="term"><em class="parameter"><code>fonttype</code></em> :</span></p></td>
458 href="/usr/share/gtk-doc/html/cairo/cairo-font-face.html#cairo-font-type-t"
459 ><span class="type">cairo_font_type_t</span></a>
463 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
464 <td> the newly allocated <a class="link" href="pango-Fonts.html#PangoFontMap"><span class="type">PangoFontMap</span></a> of suitable type
465 which should be freed with <a
466 href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"
467 ><code class="function">g_object_unref()</code></a>,
469 href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
470 ><code class="literal">NULL</code></a> if the requested cairo font backend is
471 not supported / compiled in.
477 <p class="since">Since 1.18</p>
480 <div class="refsect2" lang="en">
481 <a name="pango-cairo-font-map-get-font-type"></a><h3>pango_cairo_font_map_get_font_type ()</h3>
482 <pre class="programlisting"><a
483 href="/usr/share/gtk-doc/html/cairo/cairo-font-face.html#cairo-font-type-t"
484 >cairo_font_type_t</a> pango_cairo_font_map_get_font_type (<a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap">PangoCairoFontMap</a> *fontmap);</pre>
486 Gets the type of Cairo font backend that <em class="parameter"><code>fontmap</code></em> uses.</p>
489 <div class="variablelist"><table border="0">
490 <col align="left" valign="top">
493 <td><p><span class="term"><em class="parameter"><code>fontmap</code></em> :</span></p></td>
494 <td> a <a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap"><span class="type">PangoCairoFontMap</span></a>
498 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
500 href="/usr/share/gtk-doc/html/cairo/cairo-font-face.html#cairo-font-type-t"
501 ><span class="type">cairo_font_type_t</span></a> cairo font backend type
507 <p class="since">Since 1.18</p>
510 <div class="refsect2" lang="en">
511 <a name="pango-cairo-font-map-set-resolution"></a><h3>pango_cairo_font_map_set_resolution ()</h3>
512 <pre class="programlisting">void pango_cairo_font_map_set_resolution (<a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap">PangoCairoFontMap</a> *fontmap,
515 Sets the resolution for the fontmap. This is a scale factor between
516 points specified in a <a class="link" href="pango-Fonts.html#PangoFontDescription" title="PangoFontDescription"><span class="type">PangoFontDescription</span></a> and Cairo units. The
517 default value is 96, meaning that a 10 point font will be 13
518 units high. (10 * 96. / 72. = 13.3).</p>
521 <div class="variablelist"><table border="0">
522 <col align="left" valign="top">
525 <td><p><span class="term"><em class="parameter"><code>fontmap</code></em> :</span></p></td>
526 <td> a <a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap"><span class="type">PangoCairoFontMap</span></a>
530 <td><p><span class="term"><em class="parameter"><code>dpi</code></em> :</span></p></td>
531 <td> the resolution in "dots per inch". (Physical inches aren't actually
532 involved; the terminology is conventional.)
537 <p class="since">Since 1.10</p>
540 <div class="refsect2" lang="en">
541 <a name="pango-cairo-font-map-get-resolution"></a><h3>pango_cairo_font_map_get_resolution ()</h3>
542 <pre class="programlisting">double pango_cairo_font_map_get_resolution (<a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap">PangoCairoFontMap</a> *fontmap);</pre>
544 Gets the resolution for the fontmap. See <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-font-map-set-resolution" title="pango_cairo_font_map_set_resolution ()"><code class="function">pango_cairo_font_map_set_resolution()</code></a></p>
547 <div class="variablelist"><table border="0">
548 <col align="left" valign="top">
551 <td><p><span class="term"><em class="parameter"><code>fontmap</code></em> :</span></p></td>
552 <td> a <a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap"><span class="type">PangoCairoFontMap</span></a>
556 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
557 <td> the resolution in "dots per inch"
563 <p class="since">Since 1.10</p>
566 <div class="refsect2" lang="en">
567 <a name="pango-cairo-font-map-create-context"></a><h3>pango_cairo_font_map_create_context ()</h3>
568 <pre class="programlisting"><a class="link" href="pango-Text-Processing.html#PangoContext">PangoContext</a> * pango_cairo_font_map_create_context (<a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap">PangoCairoFontMap</a> *fontmap);</pre>
569 <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
570 <h3 class="title">Warning</h3>
571 <p><code class="literal">pango_cairo_font_map_create_context</code> has been deprecated since version 1.22 and should not be used in newly-written code. Use <a class="link" href="pango-Fonts.html#pango-font-map-create-context" title="pango_font_map_create_context ()"><code class="function">pango_font_map_create_context()</code></a> instead.</p>
574 Create a <a class="link" href="pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a> for the given fontmap.</p>
577 <div class="variablelist"><table border="0">
578 <col align="left" valign="top">
581 <td><p><span class="term"><em class="parameter"><code>fontmap</code></em> :</span></p></td>
582 <td> a <a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap"><span class="type">PangoCairoFontMap</span></a>
586 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
587 <td> the newly created context; free with <a
588 href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"
589 ><code class="function">g_object_unref()</code></a>.
595 <p class="since">Since 1.10</p>
598 <div class="refsect2" lang="en">
599 <a name="pango-cairo-font-get-scaled-font"></a><h3>pango_cairo_font_get_scaled_font ()</h3>
600 <pre class="programlisting"><a
601 href="/usr/share/gtk-doc/html/cairo/cairo-scaled-font.html#cairo-scaled-font-t"
602 >cairo_scaled_font_t</a> * pango_cairo_font_get_scaled_font (<a class="link" href="pango-Cairo-Rendering.html#PangoCairoFont">PangoCairoFont</a> *font);</pre>
605 href="/usr/share/gtk-doc/html/cairo/cairo-scaled-font.html#cairo-scaled-font-t"
606 ><span class="type">cairo_scaled_font_t</span></a> used by <em class="parameter"><code>font</code></em>.
607 The scaled font can be referenced and kept using
609 href="/usr/share/gtk-doc/html/cairo/cairo-scaled-font.html#cairo-scaled-font-reference"
610 ><code class="function">cairo_scaled_font_reference()</code></a>.</p>
613 <div class="variablelist"><table border="0">
614 <col align="left" valign="top">
617 <td><p><span class="term"><em class="parameter"><code>font</code></em> :</span></p></td>
618 <td> a <a class="link" href="pango-Fonts.html#PangoFont"><span class="type">PangoFont</span></a> from a <a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap"><span class="type">PangoCairoFontMap</span></a>
622 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
624 href="/usr/share/gtk-doc/html/cairo/cairo-scaled-font.html#cairo-scaled-font-t"
625 ><span class="type">cairo_scaled_font_t</span></a> used by <em class="parameter"><code>font</code></em>,
627 href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
628 ><code class="literal">NULL</code></a> if <em class="parameter"><code>font</code></em> is <a
629 href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
630 ><code class="literal">NULL</code></a>.
636 <p class="since">Since 1.18</p>
639 <div class="refsect2" lang="en">
640 <a name="pango-cairo-context-set-resolution"></a><h3>pango_cairo_context_set_resolution ()</h3>
641 <pre class="programlisting">void pango_cairo_context_set_resolution (<a class="link" href="pango-Text-Processing.html#PangoContext">PangoContext</a> *context,
644 Sets the resolution for the context. This is a scale factor between
645 points specified in a <a class="link" href="pango-Fonts.html#PangoFontDescription" title="PangoFontDescription"><span class="type">PangoFontDescription</span></a> and Cairo units. The
646 default value is 96, meaning that a 10 point font will be 13
647 units high. (10 * 96. / 72. = 13.3).</p>
650 <div class="variablelist"><table border="0">
651 <col align="left" valign="top">
654 <td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
655 <td> a <a class="link" href="pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a>, from a pangocairo font map
659 <td><p><span class="term"><em class="parameter"><code>dpi</code></em> :</span></p></td>
660 <td> the resolution in "dots per inch". (Physical inches aren't actually
661 involved; the terminology is conventional.) A 0 or negative value
662 means to use the resolution from the font map.
667 <p class="since">Since 1.10</p>
670 <div class="refsect2" lang="en">
671 <a name="pango-cairo-context-get-resolution"></a><h3>pango_cairo_context_get_resolution ()</h3>
672 <pre class="programlisting">double pango_cairo_context_get_resolution (<a class="link" href="pango-Text-Processing.html#PangoContext">PangoContext</a> *context);</pre>
674 Gets the resolution for the context. See <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-context-set-resolution" title="pango_cairo_context_set_resolution ()"><code class="function">pango_cairo_context_set_resolution()</code></a></p>
677 <div class="variablelist"><table border="0">
678 <col align="left" valign="top">
681 <td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
682 <td> a <a class="link" href="pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a>, from a pangocairo font map
686 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
687 <td> the resolution in "dots per inch". A negative value will
688 be returned if no resolution has previously been set.
694 <p class="since">Since 1.10</p>
697 <div class="refsect2" lang="en">
698 <a name="pango-cairo-context-set-font-options"></a><h3>pango_cairo_context_set_font_options ()</h3>
699 <pre class="programlisting">void pango_cairo_context_set_font_options
700 (<a class="link" href="pango-Text-Processing.html#PangoContext">PangoContext</a> *context,
702 href="/usr/share/gtk-doc/html/cairo/cairo-font-options.html#cairo-font-options-t"
703 >cairo_font_options_t</a> *options);</pre>
705 Sets the font options used when rendering text with this context.
706 These options override any options that <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-update-context" title="pango_cairo_update_context ()"><code class="function">pango_cairo_update_context()</code></a>
707 derives from the target surface.</p>
710 <div class="variablelist"><table border="0">
711 <col align="left" valign="top">
714 <td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
715 <td> a <a class="link" href="pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a>, from a pangocairo font map
719 <td><p><span class="term"><em class="parameter"><code>options</code></em> :</span></p></td>
721 href="/usr/share/gtk-doc/html/cairo/cairo-font-options.html#cairo-font-options-t"
722 ><span class="type">cairo_font_options_t</span></a>, or <a
723 href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
724 ><code class="literal">NULL</code></a> to unset any previously set
725 options. A copy is made.
730 <p class="since">Since 1.10</p>
733 <div class="refsect2" lang="en">
734 <a name="pango-cairo-context-get-font-options"></a><h3>pango_cairo_context_get_font_options ()</h3>
735 <pre class="programlisting">const <a
736 href="/usr/share/gtk-doc/html/cairo/cairo-font-options.html#cairo-font-options-t"
737 >cairo_font_options_t</a> * pango_cairo_context_get_font_options
738 (<a class="link" href="pango-Text-Processing.html#PangoContext">PangoContext</a> *context);</pre>
740 Retrieves any font rendering options previously set with
741 <code class="function">pango_cairo_font_map_set_font_options()</code>. This function does not report options
742 that are derived from the target surface by <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-update-context" title="pango_cairo_update_context ()"><code class="function">pango_cairo_update_context()</code></a></p>
745 <div class="variablelist"><table border="0">
746 <col align="left" valign="top">
749 <td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
750 <td> a <a class="link" href="pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a>, from a pangocairo font map
754 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
755 <td> the font options previously set on the context, or <a
756 href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
757 ><code class="literal">NULL</code></a>
758 if no options have been set. This value is owned by the context
759 and must not be modified or freed.
765 <p class="since">Since 1.10</p>
768 <div class="refsect2" lang="en">
769 <a name="PangoCairoShapeRendererFunc"></a><h3>PangoCairoShapeRendererFunc ()</h3>
770 <pre class="programlisting">void (*PangoCairoShapeRendererFunc) (<a
771 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
773 <a class="link" href="pango-Text-Attributes.html#PangoAttrShape" title="PangoAttrShape">PangoAttrShape</a> *attr,
775 href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
776 >gboolean</a> do_path,
778 href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
779 >gpointer</a> data);</pre>
781 Function type for rendering attributes of type <a class="link" href="pango-Text-Attributes.html#PANGO-ATTR-SHAPE--CAPS"><code class="literal">PANGO_ATTR_SHAPE</code></a>
782 with Pango's Cairo renderer.
784 <div class="variablelist"><table border="0">
785 <col align="left" valign="top">
788 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
789 <td>a Cairo context with current point set to where the shape should
794 <td><p><span class="term"><em class="parameter"><code>attr</code></em> :</span></p></td>
795 <td>the <a class="link" href="pango-Text-Attributes.html#PANGO-ATTR-SHAPE--CAPS"><code class="literal">PANGO_ATTR_SHAPE</code></a> to render
799 <td><p><span class="term"><em class="parameter"><code>do_path</code></em> :</span></p></td>
800 <td>whether only the shape path should be appended to current
801 path of <em class="parameter"><code>cr</code></em> and no filling/stroking done. This will be set
803 href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE--CAPS"
804 ><code class="literal">TRUE</code></a> when called from <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-layout-path" title="pango_cairo_layout_path ()"><code class="function">pango_cairo_layout_path()</code></a> and
805 <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-layout-line-path" title="pango_cairo_layout_line_path ()"><code class="function">pango_cairo_layout_line_path()</code></a> rendering functions.
809 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
810 <td>user data passed to <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-context-set-shape-renderer" title="pango_cairo_context_set_shape_renderer ()"><code class="function">pango_cairo_context_set_shape_renderer()</code></a>
817 <div class="refsect2" lang="en">
818 <a name="pango-cairo-context-set-shape-renderer"></a><h3>pango_cairo_context_set_shape_renderer ()</h3>
819 <pre class="programlisting">void pango_cairo_context_set_shape_renderer
820 (<a class="link" href="pango-Text-Processing.html#PangoContext">PangoContext</a> *context,
821 <a class="link" href="pango-Cairo-Rendering.html#PangoCairoShapeRendererFunc" title="PangoCairoShapeRendererFunc ()">PangoCairoShapeRendererFunc</a> func,
823 href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
826 href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
827 >GDestroyNotify</a> dnotify);</pre>
829 Sets callback function for context to use for rendering attributes
830 of type <a class="link" href="pango-Text-Attributes.html#PANGO-ATTR-SHAPE--CAPS"><code class="literal">PANGO_ATTR_SHAPE</code></a>. See <a class="link" href="pango-Cairo-Rendering.html#PangoCairoShapeRendererFunc" title="PangoCairoShapeRendererFunc ()"><span class="type">PangoCairoShapeRendererFunc</span></a> for
834 <div class="variablelist"><table border="0">
835 <col align="left" valign="top">
838 <td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
839 <td> a <a class="link" href="pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a>, from a pangocairo font map
843 <td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
844 <td> Callback function for rendering attributes of type
845 <a class="link" href="pango-Text-Attributes.html#PANGO-ATTR-SHAPE--CAPS"><code class="literal">PANGO_ATTR_SHAPE</code></a>, or <a
846 href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
847 ><code class="literal">NULL</code></a> to disable shape rendering.
851 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
852 <td> User data that will be passed to <em class="parameter"><code>func</code></em>.
856 <td><p><span class="term"><em class="parameter"><code>dnotify</code></em> :</span></p></td>
857 <td> Callback that will be called when the
858 context is freed to release <em class="parameter"><code>data</code></em>, or <a
859 href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
860 ><code class="literal">NULL</code></a>.
865 <p class="since">Since 1.18</p>
868 <div class="refsect2" lang="en">
869 <a name="pango-cairo-context-get-shape-renderer"></a><h3>pango_cairo_context_get_shape_renderer ()</h3>
870 <pre class="programlisting"><a class="link" href="pango-Cairo-Rendering.html#PangoCairoShapeRendererFunc" title="PangoCairoShapeRendererFunc ()">PangoCairoShapeRendererFunc</a> pango_cairo_context_get_shape_renderer
871 (<a class="link" href="pango-Text-Processing.html#PangoContext">PangoContext</a> *context,
873 href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
874 >gpointer</a> *data);</pre>
876 Sets callback function for context to use for rendering attributes
877 of type <a class="link" href="pango-Text-Attributes.html#PANGO-ATTR-SHAPE--CAPS"><code class="literal">PANGO_ATTR_SHAPE</code></a>. See <a class="link" href="pango-Cairo-Rendering.html#PangoCairoShapeRendererFunc" title="PangoCairoShapeRendererFunc ()"><span class="type">PangoCairoShapeRendererFunc</span></a> for
881 Retrieves callback function and associated user data for rendering
882 attributes of type <a class="link" href="pango-Text-Attributes.html#PANGO-ATTR-SHAPE--CAPS"><code class="literal">PANGO_ATTR_SHAPE</code></a> as set by
883 <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-context-set-shape-renderer" title="pango_cairo_context_set_shape_renderer ()"><code class="function">pango_cairo_context_set_shape_renderer()</code></a>, if any.</p>
886 <div class="variablelist"><table border="0">
887 <col align="left" valign="top">
890 <td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
891 <td> a <a class="link" href="pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a>, from a pangocairo font map
895 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
897 href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
898 ><span class="type">gpointer</span></a> to return user data
902 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
903 <td> the shape rendering callback previously set on the context, or <a
904 href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
905 ><code class="literal">NULL</code></a>
906 if no shape rendering callback have been set.
912 <p class="since">Since 1.18</p>
915 <div class="refsect2" lang="en">
916 <a name="pango-cairo-create-context"></a><h3>pango_cairo_create_context ()</h3>
917 <pre class="programlisting"><a class="link" href="pango-Text-Processing.html#PangoContext">PangoContext</a> * pango_cairo_create_context (<a
918 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
919 >cairo_t</a> *cr);</pre>
921 Creates a context object set up to match the current transformation
922 and target surface of the Cairo context. This context can then be
923 used to create a layout using <a class="link" href="pango-Layout-Objects.html#pango-layout-new" title="pango_layout_new ()"><code class="function">pango_layout_new()</code></a>.
926 This function is a convenience function that creates a context using
927 the default font map, then updates it to <em class="parameter"><code>cr</code></em>. If you just need to
928 create a layout for use with <em class="parameter"><code>cr</code></em> and do not need to access <a class="link" href="pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a>
929 directly, you can use <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-create-layout" title="pango_cairo_create_layout ()"><code class="function">pango_cairo_create_layout()</code></a> instead.</p>
932 <div class="variablelist"><table border="0">
933 <col align="left" valign="top">
936 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
941 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
942 <td> the newly created <a class="link" href="pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a>. Free with
944 href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"
945 ><code class="function">g_object_unref()</code></a>.
951 <p class="since">Since 1.22</p>
954 <div class="refsect2" lang="en">
955 <a name="pango-cairo-update-context"></a><h3>pango_cairo_update_context ()</h3>
956 <pre class="programlisting">void pango_cairo_update_context (<a
957 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
959 <a class="link" href="pango-Text-Processing.html#PangoContext">PangoContext</a> *context);</pre>
961 Updates a <a class="link" href="pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a> previously created for use with Cairo to
962 match the current transformation and target surface of a Cairo
963 context. If any layouts have been created for the context,
964 it's necessary to call <a class="link" href="pango-Layout-Objects.html#pango-layout-context-changed" title="pango_layout_context_changed ()"><code class="function">pango_layout_context_changed()</code></a> on those
968 <div class="variablelist"><table border="0">
969 <col align="left" valign="top">
972 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
977 <td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
978 <td> a <a class="link" href="pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a>, from a pangocairo font map
983 <p class="since">Since 1.10</p>
986 <div class="refsect2" lang="en">
987 <a name="pango-cairo-create-layout"></a><h3>pango_cairo_create_layout ()</h3>
988 <pre class="programlisting"><a class="link" href="pango-Layout-Objects.html#PangoLayout">PangoLayout</a> * pango_cairo_create_layout (<a
989 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
990 >cairo_t</a> *cr);</pre>
992 Creates a layout object set up to match the current transformation
993 and target surface of the Cairo context. This layout can then be
994 used for text measurement with functions like
995 <a class="link" href="pango-Layout-Objects.html#pango-layout-get-size" title="pango_layout_get_size ()"><code class="function">pango_layout_get_size()</code></a> or drawing with functions like
996 <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-show-layout" title="pango_cairo_show_layout ()"><code class="function">pango_cairo_show_layout()</code></a>. If you change the transformation
997 or target surface for <em class="parameter"><code>cr</code></em>, you need to call <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-update-layout" title="pango_cairo_update_layout ()"><code class="function">pango_cairo_update_layout()</code></a>
1000 This function is the most convenient way to use Cairo with Pango,
1001 however it is slightly inefficient since it creates a separate
1002 <a class="link" href="pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a> object for each layout. This might matter in an
1003 application that was laying out large amounts of text.</p>
1006 <div class="variablelist"><table border="0">
1007 <col align="left" valign="top">
1010 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1011 <td> a Cairo context
1015 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1016 <td> the newly created <a class="link" href="pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a>. Free with
1018 href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"
1019 ><code class="function">g_object_unref()</code></a>.
1025 <p class="since">Since 1.10</p>
1028 <div class="refsect2" lang="en">
1029 <a name="pango-cairo-update-layout"></a><h3>pango_cairo_update_layout ()</h3>
1030 <pre class="programlisting">void pango_cairo_update_layout (<a
1031 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
1033 <a class="link" href="pango-Layout-Objects.html#PangoLayout">PangoLayout</a> *layout);</pre>
1035 Updates the private <a class="link" href="pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a> of a <a class="link" href="pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a> created with
1036 <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-create-layout" title="pango_cairo_create_layout ()"><code class="function">pango_cairo_create_layout()</code></a> to match the current transformation
1037 and target surface of a Cairo context.</p>
1040 <div class="variablelist"><table border="0">
1041 <col align="left" valign="top">
1044 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1045 <td> a Cairo context
1049 <td><p><span class="term"><em class="parameter"><code>layout</code></em> :</span></p></td>
1050 <td> a <a class="link" href="pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a>, from <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-create-layout" title="pango_cairo_create_layout ()"><code class="function">pango_cairo_create_layout()</code></a>
1055 <p class="since">Since 1.10</p>
1058 <div class="refsect2" lang="en">
1059 <a name="pango-cairo-show-glyph-string"></a><h3>pango_cairo_show_glyph_string ()</h3>
1060 <pre class="programlisting">void pango_cairo_show_glyph_string (<a
1061 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
1063 <a class="link" href="pango-Fonts.html#PangoFont">PangoFont</a> *font,
1064 <a class="link" href="pango-Glyph-Storage.html#PangoGlyphString" title="PangoGlyphString">PangoGlyphString</a> *glyphs);</pre>
1066 Draws the glyphs in <em class="parameter"><code>glyphs</code></em> in the specified cairo context.
1067 The origin of the glyphs (the left edge of the baseline) will
1068 be drawn at the current point of the cairo context.</p>
1071 <div class="variablelist"><table border="0">
1072 <col align="left" valign="top">
1075 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1076 <td> a Cairo context
1080 <td><p><span class="term"><em class="parameter"><code>font</code></em> :</span></p></td>
1081 <td> a <a class="link" href="pango-Fonts.html#PangoFont"><span class="type">PangoFont</span></a> from a <a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap"><span class="type">PangoCairoFontMap</span></a>
1085 <td><p><span class="term"><em class="parameter"><code>glyphs</code></em> :</span></p></td>
1086 <td> a <a class="link" href="pango-Glyph-Storage.html#PangoGlyphString" title="PangoGlyphString"><span class="type">PangoGlyphString</span></a>
1091 <p class="since">Since 1.10</p>
1094 <div class="refsect2" lang="en">
1095 <a name="pango-cairo-show-glyph-item"></a><h3>pango_cairo_show_glyph_item ()</h3>
1096 <pre class="programlisting">void pango_cairo_show_glyph_item (<a
1097 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
1100 <a class="link" href="pango-Glyph-Storage.html#PangoGlyphItem" title="PangoGlyphItem">PangoGlyphItem</a> *glyph_item);</pre>
1102 Draws the glyphs in <em class="parameter"><code>glyph_item</code></em> in the specified cairo context,
1103 embedding the text associated with the glyphs in the output if the
1104 output format supports it (PDF for example), otherwise it acts
1105 similar to <a class="link" href="pango-Cairo-Rendering.html#pango-cairo-show-glyph-string" title="pango_cairo_show_glyph_string ()"><code class="function">pango_cairo_show_glyph_string()</code></a>.
1108 The origin of the glyphs (the left edge of the baseline) will
1109 be drawn at the current point of the cairo context.
1112 Note that <em class="parameter"><code>text</code></em> is the start of the text for layout, which is then
1113 indexed by <code class="literal"><em class="parameter"><code>glyph_item->item->offset</code></em></code>.</p>
1116 <div class="variablelist"><table border="0">
1117 <col align="left" valign="top">
1120 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1121 <td> a Cairo context
1125 <td><p><span class="term"><em class="parameter"><code>text</code></em> :</span></p></td>
1126 <td> the UTF-8 text that <em class="parameter"><code>glyph_item</code></em> refers to
1130 <td><p><span class="term"><em class="parameter"><code>glyph_item</code></em> :</span></p></td>
1131 <td> a <a class="link" href="pango-Glyph-Storage.html#PangoGlyphItem" title="PangoGlyphItem"><span class="type">PangoGlyphItem</span></a>
1136 <p class="since">Since 1.22</p>
1139 <div class="refsect2" lang="en">
1140 <a name="pango-cairo-show-layout-line"></a><h3>pango_cairo_show_layout_line ()</h3>
1141 <pre class="programlisting">void pango_cairo_show_layout_line (<a
1142 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
1144 <a class="link" href="pango-Layout-Objects.html#PangoLayoutLine" title="PangoLayoutLine">PangoLayoutLine</a> *line);</pre>
1146 Draws a <a class="link" href="pango-Layout-Objects.html#PangoLayoutLine" title="PangoLayoutLine"><span class="type">PangoLayoutLine</span></a> in the specified cairo context.
1147 The origin of the glyphs (the left edge of the line) will
1148 be drawn at the current point of the cairo context.</p>
1151 <div class="variablelist"><table border="0">
1152 <col align="left" valign="top">
1155 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1156 <td> a Cairo context
1160 <td><p><span class="term"><em class="parameter"><code>line</code></em> :</span></p></td>
1161 <td> a <a class="link" href="pango-Layout-Objects.html#PangoLayoutLine" title="PangoLayoutLine"><span class="type">PangoLayoutLine</span></a>
1166 <p class="since">Since 1.10</p>
1169 <div class="refsect2" lang="en">
1170 <a name="pango-cairo-show-layout"></a><h3>pango_cairo_show_layout ()</h3>
1171 <pre class="programlisting">void pango_cairo_show_layout (<a
1172 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
1174 <a class="link" href="pango-Layout-Objects.html#PangoLayout">PangoLayout</a> *layout);</pre>
1176 Draws a <a class="link" href="pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a> in the specified cairo context.
1177 The top-left corner of the <a class="link" href="pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a> will be drawn
1178 at the current point of the cairo context.</p>
1181 <div class="variablelist"><table border="0">
1182 <col align="left" valign="top">
1185 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1186 <td> a Cairo context
1190 <td><p><span class="term"><em class="parameter"><code>layout</code></em> :</span></p></td>
1196 <p class="since">Since 1.10</p>
1199 <div class="refsect2" lang="en">
1200 <a name="pango-cairo-show-error-underline"></a><h3>pango_cairo_show_error_underline ()</h3>
1201 <pre class="programlisting">void pango_cairo_show_error_underline (<a
1202 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
1207 double height);</pre>
1209 Draw a squiggly line in the specified cairo context that approximately
1210 covers the given rectangle in the style of an underline used to indicate a
1211 spelling error. (The width of the underline is rounded to an integer
1212 number of up/down segments and the resulting rectangle is centered in the
1213 original rectangle)</p>
1216 <div class="variablelist"><table border="0">
1217 <col align="left" valign="top">
1220 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1221 <td> a Cairo context
1225 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
1226 <td> The X coordinate of one corner of the rectangle
1230 <td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
1231 <td> The Y coordinate of one corner of the rectangle
1235 <td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
1236 <td> Non-negative width of the rectangle
1240 <td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
1241 <td> Non-negative height of the rectangle
1246 <p class="since">Since 1.14</p>
1249 <div class="refsect2" lang="en">
1250 <a name="pango-cairo-glyph-string-path"></a><h3>pango_cairo_glyph_string_path ()</h3>
1251 <pre class="programlisting">void pango_cairo_glyph_string_path (<a
1252 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
1254 <a class="link" href="pango-Fonts.html#PangoFont">PangoFont</a> *font,
1255 <a class="link" href="pango-Glyph-Storage.html#PangoGlyphString" title="PangoGlyphString">PangoGlyphString</a> *glyphs);</pre>
1257 Adds the glyphs in <em class="parameter"><code>glyphs</code></em> to the current path in the specified
1258 cairo context. The origin of the glyphs (the left edge of the baseline)
1259 will be at the current point of the cairo context.</p>
1262 <div class="variablelist"><table border="0">
1263 <col align="left" valign="top">
1266 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1267 <td> a Cairo context
1271 <td><p><span class="term"><em class="parameter"><code>font</code></em> :</span></p></td>
1272 <td> a <a class="link" href="pango-Fonts.html#PangoFont"><span class="type">PangoFont</span></a> from a <a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap"><span class="type">PangoCairoFontMap</span></a>
1276 <td><p><span class="term"><em class="parameter"><code>glyphs</code></em> :</span></p></td>
1277 <td> a <a class="link" href="pango-Glyph-Storage.html#PangoGlyphString" title="PangoGlyphString"><span class="type">PangoGlyphString</span></a>
1282 <p class="since">Since 1.10</p>
1285 <div class="refsect2" lang="en">
1286 <a name="pango-cairo-layout-line-path"></a><h3>pango_cairo_layout_line_path ()</h3>
1287 <pre class="programlisting">void pango_cairo_layout_line_path (<a
1288 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
1290 <a class="link" href="pango-Layout-Objects.html#PangoLayoutLine" title="PangoLayoutLine">PangoLayoutLine</a> *line);</pre>
1292 Adds the text in <a class="link" href="pango-Layout-Objects.html#PangoLayoutLine" title="PangoLayoutLine"><span class="type">PangoLayoutLine</span></a> to the current path in the
1293 specified cairo context. The origin of the glyphs (the left edge
1294 of the line) will be at the current point of the cairo context.</p>
1297 <div class="variablelist"><table border="0">
1298 <col align="left" valign="top">
1301 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1302 <td> a Cairo context
1306 <td><p><span class="term"><em class="parameter"><code>line</code></em> :</span></p></td>
1307 <td> a <a class="link" href="pango-Layout-Objects.html#PangoLayoutLine" title="PangoLayoutLine"><span class="type">PangoLayoutLine</span></a>
1312 <p class="since">Since 1.10</p>
1315 <div class="refsect2" lang="en">
1316 <a name="pango-cairo-layout-path"></a><h3>pango_cairo_layout_path ()</h3>
1317 <pre class="programlisting">void pango_cairo_layout_path (<a
1318 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
1320 <a class="link" href="pango-Layout-Objects.html#PangoLayout">PangoLayout</a> *layout);</pre>
1322 Adds the text in a <a class="link" href="pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a> to the current path in the
1323 specified cairo context. The top-left corner of the <a class="link" href="pango-Layout-Objects.html#PangoLayout"><span class="type">PangoLayout</span></a>
1324 will be at the current point of the cairo context.</p>
1327 <div class="variablelist"><table border="0">
1328 <col align="left" valign="top">
1331 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1332 <td> a Cairo context
1336 <td><p><span class="term"><em class="parameter"><code>layout</code></em> :</span></p></td>
1342 <p class="since">Since 1.10</p>
1345 <div class="refsect2" lang="en">
1346 <a name="pango-cairo-error-underline-path"></a><h3>pango_cairo_error_underline_path ()</h3>
1347 <pre class="programlisting">void pango_cairo_error_underline_path (<a
1348 href="/usr/share/gtk-doc/html/cairo/cairo-context.html#cairo-t"
1353 double height);</pre>
1355 Add a squiggly line to the current path in the specified cairo context that
1356 approximately covers the given rectangle in the style of an underline used
1357 to indicate a spelling error. (The width of the underline is rounded to an
1358 integer number of up/down segments and the resulting rectangle is centered
1359 in the original rectangle)</p>
1362 <div class="variablelist"><table border="0">
1363 <col align="left" valign="top">
1366 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1367 <td> a Cairo context
1371 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
1372 <td> The X coordinate of one corner of the rectangle
1376 <td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
1377 <td> The Y coordinate of one corner of the rectangle
1381 <td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
1382 <td> Non-negative width of the rectangle
1386 <td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
1387 <td> Non-negative height of the rectangle
1392 <p class="since">Since 1.14</p>
1396 <div class="footer">
1398 Generated by GTK-Doc V1.11</div>