Git init
[external/pango1.0.git] / docs / html / pango-Cairo-Rendering.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
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">
33 </head>
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">
36 <tr valign="middle">
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>
42 </tr>
43 <tr><td colspan="5" class="shortcuts">
44 <a href="#pango-Cairo-Rendering.synopsis" class="shortcut">Top</a>
45                  | 
46                 <a href="#pango-Cairo-Rendering.description" class="shortcut">Description</a>
47                  | 
48                 <a href="#pango-Cairo-Rendering.object-hierarchy" class="shortcut">Object Hierarchy</a>
49                  | 
50                 <a href="#pango-Cairo-Rendering.prerequisites" class="shortcut">Prerequisites</a>
51 </td></tr>
52 </table>
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>
56 <td valign="top">
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>
59 </td>
60 <td valign="top" align="right"></td>
61 </tr></table></div>
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>
71                                                         (<a
72 href="/usr/share/gtk-doc/html/cairo/cairo-font-face.html#cairo-font-type-t"
73 >cairo_font_type_t</a> fonttype);
74 <a
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,
78                                                          double dpi);
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);
81 <a
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,
85                                                          double dpi);
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,
89                                                          const <a
90 href="/usr/share/gtk-doc/html/cairo/cairo-font-options.html#cairo-font-options-t"
91 >cairo_font_options_t</a> *options);
92 const <a
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"
98 >cairo_t</a> *cr,
99                                                          <a class="link" href="pango-Text-Attributes.html#PangoAttrShape" title="PangoAttrShape">PangoAttrShape</a> *attr,
100                                                          <a
101 href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
102 >gboolean</a> do_path,
103                                                          <a
104 href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
105 >gpointer</a> data);
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,
109                                                          <a
110 href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
111 >gpointer</a> data,
112                                                          <a
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,
117                                                          <a
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"
122 >cairo_t</a> *cr);
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"
125 >cairo_t</a> *cr,
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"
129 >cairo_t</a> *cr);
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"
132 >cairo_t</a> *cr,
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"
136 >cairo_t</a> *cr,
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"
141 >cairo_t</a> *cr,
142                                                          const char *text,
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"
146 >cairo_t</a> *cr,
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"
150 >cairo_t</a> *cr,
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"
154 >cairo_t</a> *cr,
155                                                          double x,
156                                                          double y,
157                                                          double width,
158                                                          double height);
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"
161 >cairo_t</a> *cr,
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"
166 >cairo_t</a> *cr,
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"
170 >cairo_t</a> *cr,
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"
174 >cairo_t</a> *cr,
175                                                          double x,
176                                                          double y,
177                                                          double width,
178                                                          double height);
179 </pre>
180 </div>
181 <div class="refsect1" lang="en">
182 <a name="pango-Cairo-Rendering.object-hierarchy"></a><h2>Object Hierarchy</h2>
183 <pre class="synopsis">
184   GInterface
185    +----PangoCairoFont
186 </pre>
187 <pre class="synopsis">
188   GInterface
189    +----PangoCairoFontMap
190 </pre>
191 </div>
192 <div class="refsect1" lang="en">
193 <a name="pango-Cairo-Rendering.prerequisites"></a><h2>Prerequisites</h2>
194 <p>
195 PangoCairoFont requires
196  <a class="link" href="pango-Fonts.html#PangoFont">PangoFont</a>.</p>
197 <p>
198 PangoCairoFontMap requires
199  <a class="link" href="pango-Fonts.html#PangoFontMap">PangoFontMap</a>.</p>
200 </div>
201 <div class="refsect1" lang="en">
202 <a name="pango-Cairo-Rendering.description"></a><h2>Description</h2>
203 <p>
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.
211 </p>
212 <p>
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>.
221 </p>
222 <p>
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>.
233 </p>
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 &lt;math.h&gt;
238 #include &lt;pango/pangocairo.h&gt;
239 static void
240 draw_text (cairo_t *cr)
241 {
242 #define RADIUS 150
243 #define N_WORDS 10
244 #define FONT "Sans Bold 27"
245   PangoLayout *layout;
246   PangoFontDescription *desc;
247   int i;
248   /* Center coordinates on the middle of the region we are drawing
249    */
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 &lt; N_WORDS; i++)
259     {
260       int width, height;
261       double angle = (360. * i) / N_WORDS;
262       double red;
263       cairo_save (cr);
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, &amp;width, &amp;height);
271       cairo_move_to (cr, - ((double)width / PANGO_SCALE) / 2, - RADIUS);
272       pango_cairo_show_layout (cr, layout);
273       cairo_restore (cr);
274     }
275   /* free the layout object */
276   g_object_unref (layout);
277 }
278 int main (int argc, char **argv)
279 {
280   cairo_t *cr;
281   char *filename;
282   cairo_status_t status;
283   cairo_surface_t *surface;
284   if (argc != 2)
285     {
286       g_printerr ("Usage: cairosimple OUTPUT_FILENAME\n");
287       return 1;
288     }
289   filename = argv[1];
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);
294   cairo_paint (cr);
295   draw_text (cr);
296   cairo_destroy (cr);
297   status = cairo_surface_write_to_png (surface, filename);
298   cairo_surface_destroy (surface);
299   if (status != CAIRO_STATUS_SUCCESS)
300     {
301       g_printerr ("Could not save png to '%s'\n", filename);
302       return 1;
303     }
304   return 0;
305 }
306 </pre></div>
307 </div>
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>
311 </div>
312 <br class="figure-break">
313 </div>
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>
319 <p>
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>
323 <p>
324 </p>
325 <p class="since">Since 1.18</p>
326 </div>
327 <hr>
328 <div class="refsect2" lang="en">
329 <a name="PangoCairoFontMap-struct"></a><h3>PangoCairoFontMap</h3>
330 <pre class="programlisting">typedef struct _PangoCairoFontMap PangoCairoFontMap;</pre>
331 <p>
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>
335 <p>
336 </p>
337 <p class="since">Since 1.10</p>
338 </div>
339 <hr>
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>
343 <p>
344 Gets a default <a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap"><span class="type">PangoCairoFontMap</span></a> to use with Cairo.
345 </p>
346 <p>
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.
351 </p>
352 <p>
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>
357 <p>
358 </p>
359 <div class="variablelist"><table border="0">
360 <col align="left" valign="top">
361 <tbody><tr>
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.
365
366 </td>
367 </tr></tbody>
368 </table></div>
369 <p class="since">Since 1.10</p>
370 </div>
371 <hr>
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>
375 <p>
376 Sets a default <a class="link" href="pango-Cairo-Rendering.html#PangoCairoFontMap"><span class="type">PangoCairoFontMap</span></a> to use with Cairo.
377 </p>
378 <p>
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.
382 </p>
383 <p>
384 A value of <a
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>
389 <p>
390 </p>
391 <div class="variablelist"><table border="0">
392 <col align="left" valign="top">
393 <tbody><tr>
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>
398 </td>
399 </tr></tbody>
400 </table></div>
401 <p class="since">Since 1.22</p>
402 </div>
403 <hr>
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>
407 <p>
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>
412 instead.
413 </p>
414 <p>
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>
419 <p>
420 </p>
421 <div class="variablelist"><table border="0">
422 <col align="left" valign="top">
423 <tbody><tr>
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
426               be freed with <a
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>.
429
430 </td>
431 </tr></tbody>
432 </table></div>
433 <p class="since">Since 1.10</p>
434 </div>
435 <hr>
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
439                                                         (<a
440 href="/usr/share/gtk-doc/html/cairo/cairo-font-face.html#cairo-font-type-t"
441 >cairo_font_type_t</a> fonttype);</pre>
442 <p>
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>.
445 </p>
446 <p>
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>
450 <p>
451 </p>
452 <div class="variablelist"><table border="0">
453 <col align="left" valign="top">
454 <tbody>
455 <tr>
456 <td><p><span class="term"><em class="parameter"><code>fonttype</code></em> :</span></p></td>
457 <td> desired <a
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>
460 </td>
461 </tr>
462 <tr>
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>,
468               or <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.
472
473 </td>
474 </tr>
475 </tbody>
476 </table></div>
477 <p class="since">Since 1.18</p>
478 </div>
479 <hr>
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>
485 <p>
486 Gets the type of Cairo font backend that <em class="parameter"><code>fontmap</code></em> uses.</p>
487 <p>
488 </p>
489 <div class="variablelist"><table border="0">
490 <col align="left" valign="top">
491 <tbody>
492 <tr>
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>
495 </td>
496 </tr>
497 <tr>
498 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
499 <td> the <a
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
502
503 </td>
504 </tr>
505 </tbody>
506 </table></div>
507 <p class="since">Since 1.18</p>
508 </div>
509 <hr>
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,
513                                                          double dpi);</pre>
514 <p>
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>
519 <p>
520 </p>
521 <div class="variablelist"><table border="0">
522 <col align="left" valign="top">
523 <tbody>
524 <tr>
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>
527 </td>
528 </tr>
529 <tr>
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.)
533 </td>
534 </tr>
535 </tbody>
536 </table></div>
537 <p class="since">Since 1.10</p>
538 </div>
539 <hr>
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>
543 <p>
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>
545 <p>
546 </p>
547 <div class="variablelist"><table border="0">
548 <col align="left" valign="top">
549 <tbody>
550 <tr>
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>
553 </td>
554 </tr>
555 <tr>
556 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
557 <td> the resolution in "dots per inch"
558
559 </td>
560 </tr>
561 </tbody>
562 </table></div>
563 <p class="since">Since 1.10</p>
564 </div>
565 <hr>
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>
572 </div>
573 <p>
574 Create a <a class="link" href="pango-Text-Processing.html#PangoContext"><span class="type">PangoContext</span></a> for the given fontmap.</p>
575 <p>
576 </p>
577 <div class="variablelist"><table border="0">
578 <col align="left" valign="top">
579 <tbody>
580 <tr>
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>
583 </td>
584 </tr>
585 <tr>
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>.
590
591 </td>
592 </tr>
593 </tbody>
594 </table></div>
595 <p class="since">Since 1.10</p>
596 </div>
597 <hr>
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>
603 <p>
604 Gets the <a
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
608 <a
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>
611 <p>
612 </p>
613 <div class="variablelist"><table border="0">
614 <col align="left" valign="top">
615 <tbody>
616 <tr>
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>
619 </td>
620 </tr>
621 <tr>
622 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
623 <td> the <a
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>,
626               or <a
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>.
631
632 </td>
633 </tr>
634 </tbody>
635 </table></div>
636 <p class="since">Since 1.18</p>
637 </div>
638 <hr>
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,
642                                                          double dpi);</pre>
643 <p>
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>
648 <p>
649 </p>
650 <div class="variablelist"><table border="0">
651 <col align="left" valign="top">
652 <tbody>
653 <tr>
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
656 </td>
657 </tr>
658 <tr>
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.
663 </td>
664 </tr>
665 </tbody>
666 </table></div>
667 <p class="since">Since 1.10</p>
668 </div>
669 <hr>
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>
673 <p>
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>
675 <p>
676 </p>
677 <div class="variablelist"><table border="0">
678 <col align="left" valign="top">
679 <tbody>
680 <tr>
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
683 </td>
684 </tr>
685 <tr>
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.
689
690 </td>
691 </tr>
692 </tbody>
693 </table></div>
694 <p class="since">Since 1.10</p>
695 </div>
696 <hr>
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,
701                                                          const <a
702 href="/usr/share/gtk-doc/html/cairo/cairo-font-options.html#cairo-font-options-t"
703 >cairo_font_options_t</a> *options);</pre>
704 <p>
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>
708 <p>
709 </p>
710 <div class="variablelist"><table border="0">
711 <col align="left" valign="top">
712 <tbody>
713 <tr>
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
716 </td>
717 </tr>
718 <tr>
719 <td><p><span class="term"><em class="parameter"><code>options</code></em> :</span></p></td>
720 <td> a <a
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.
726 </td>
727 </tr>
728 </tbody>
729 </table></div>
730 <p class="since">Since 1.10</p>
731 </div>
732 <hr>
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>
739 <p>
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>
743 <p>
744 </p>
745 <div class="variablelist"><table border="0">
746 <col align="left" valign="top">
747 <tbody>
748 <tr>
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
751 </td>
752 </tr>
753 <tr>
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.
760
761 </td>
762 </tr>
763 </tbody>
764 </table></div>
765 <p class="since">Since 1.10</p>
766 </div>
767 <hr>
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"
772 >cairo_t</a> *cr,
773                                                          <a class="link" href="pango-Text-Attributes.html#PangoAttrShape" title="PangoAttrShape">PangoAttrShape</a> *attr,
774                                                          <a
775 href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
776 >gboolean</a> do_path,
777                                                          <a
778 href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
779 >gpointer</a> data);</pre>
780 <p>
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.
783 </p>
784 <div class="variablelist"><table border="0">
785 <col align="left" valign="top">
786 <tbody>
787 <tr>
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
790      be rendered
791 </td>
792 </tr>
793 <tr>
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
796 </td>
797 </tr>
798 <tr>
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
802           to <a
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.
806 </td>
807 </tr>
808 <tr>
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>
811 </td>
812 </tr>
813 </tbody>
814 </table></div>
815 </div>
816 <hr>
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,
822                                                          <a
823 href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
824 >gpointer</a> data,
825                                                          <a
826 href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
827 >GDestroyNotify</a> dnotify);</pre>
828 <p>
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
831 details.</p>
832 <p>
833 </p>
834 <div class="variablelist"><table border="0">
835 <col align="left" valign="top">
836 <tbody>
837 <tr>
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
840 </td>
841 </tr>
842 <tr>
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.
848 </td>
849 </tr>
850 <tr>
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>.
853 </td>
854 </tr>
855 <tr>
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>.
861 </td>
862 </tr>
863 </tbody>
864 </table></div>
865 <p class="since">Since 1.18</p>
866 </div>
867 <hr>
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,
872                                                          <a
873 href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
874 >gpointer</a> *data);</pre>
875 <p>
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
878 details.
879 </p>
880 <p>
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>
884 <p>
885 </p>
886 <div class="variablelist"><table border="0">
887 <col align="left" valign="top">
888 <tbody>
889 <tr>
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
892 </td>
893 </tr>
894 <tr>
895 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
896 <td> Pointer to <a
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
899 </td>
900 </tr>
901 <tr>
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.
907
908 </td>
909 </tr>
910 </tbody>
911 </table></div>
912 <p class="since">Since 1.18</p>
913 </div>
914 <hr>
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>
920 <p>
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>.
924 </p>
925 <p>
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>
930 <p>
931 </p>
932 <div class="variablelist"><table border="0">
933 <col align="left" valign="top">
934 <tbody>
935 <tr>
936 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
937 <td> a Cairo context
938 </td>
939 </tr>
940 <tr>
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
943   <a
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>.
946
947 </td>
948 </tr>
949 </tbody>
950 </table></div>
951 <p class="since">Since 1.22</p>
952 </div>
953 <hr>
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"
958 >cairo_t</a> *cr,
959                                                          <a class="link" href="pango-Text-Processing.html#PangoContext">PangoContext</a> *context);</pre>
960 <p>
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
965 layouts.</p>
966 <p>
967 </p>
968 <div class="variablelist"><table border="0">
969 <col align="left" valign="top">
970 <tbody>
971 <tr>
972 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
973 <td> a Cairo context
974 </td>
975 </tr>
976 <tr>
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
979 </td>
980 </tr>
981 </tbody>
982 </table></div>
983 <p class="since">Since 1.10</p>
984 </div>
985 <hr>
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>
991 <p>
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>
998 </p>
999 <p>
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>
1004 <p>
1005 </p>
1006 <div class="variablelist"><table border="0">
1007 <col align="left" valign="top">
1008 <tbody>
1009 <tr>
1010 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1011 <td> a Cairo context
1012 </td>
1013 </tr>
1014 <tr>
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
1017   <a
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>.
1020
1021 </td>
1022 </tr>
1023 </tbody>
1024 </table></div>
1025 <p class="since">Since 1.10</p>
1026 </div>
1027 <hr>
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"
1032 >cairo_t</a> *cr,
1033                                                          <a class="link" href="pango-Layout-Objects.html#PangoLayout">PangoLayout</a> *layout);</pre>
1034 <p>
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>
1038 <p>
1039 </p>
1040 <div class="variablelist"><table border="0">
1041 <col align="left" valign="top">
1042 <tbody>
1043 <tr>
1044 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1045 <td> a Cairo context
1046 </td>
1047 </tr>
1048 <tr>
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>
1051 </td>
1052 </tr>
1053 </tbody>
1054 </table></div>
1055 <p class="since">Since 1.10</p>
1056 </div>
1057 <hr>
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"
1062 >cairo_t</a> *cr,
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>
1065 <p>
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>
1069 <p>
1070 </p>
1071 <div class="variablelist"><table border="0">
1072 <col align="left" valign="top">
1073 <tbody>
1074 <tr>
1075 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1076 <td> a Cairo context
1077 </td>
1078 </tr>
1079 <tr>
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>
1082 </td>
1083 </tr>
1084 <tr>
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>
1087 </td>
1088 </tr>
1089 </tbody>
1090 </table></div>
1091 <p class="since">Since 1.10</p>
1092 </div>
1093 <hr>
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"
1098 >cairo_t</a> *cr,
1099                                                          const char *text,
1100                                                          <a class="link" href="pango-Glyph-Storage.html#PangoGlyphItem" title="PangoGlyphItem">PangoGlyphItem</a> *glyph_item);</pre>
1101 <p>
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>.
1106 </p>
1107 <p>
1108 The origin of the glyphs (the left edge of the baseline) will
1109 be drawn at the current point of the cairo context.
1110 </p>
1111 <p>
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-&gt;item-&gt;offset</code></em></code>.</p>
1114 <p>
1115 </p>
1116 <div class="variablelist"><table border="0">
1117 <col align="left" valign="top">
1118 <tbody>
1119 <tr>
1120 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1121 <td> a Cairo context
1122 </td>
1123 </tr>
1124 <tr>
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
1127 </td>
1128 </tr>
1129 <tr>
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>
1132 </td>
1133 </tr>
1134 </tbody>
1135 </table></div>
1136 <p class="since">Since 1.22</p>
1137 </div>
1138 <hr>
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"
1143 >cairo_t</a> *cr,
1144                                                          <a class="link" href="pango-Layout-Objects.html#PangoLayoutLine" title="PangoLayoutLine">PangoLayoutLine</a> *line);</pre>
1145 <p>
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>
1149 <p>
1150 </p>
1151 <div class="variablelist"><table border="0">
1152 <col align="left" valign="top">
1153 <tbody>
1154 <tr>
1155 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1156 <td> a Cairo context
1157 </td>
1158 </tr>
1159 <tr>
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>
1162 </td>
1163 </tr>
1164 </tbody>
1165 </table></div>
1166 <p class="since">Since 1.10</p>
1167 </div>
1168 <hr>
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"
1173 >cairo_t</a> *cr,
1174                                                          <a class="link" href="pango-Layout-Objects.html#PangoLayout">PangoLayout</a> *layout);</pre>
1175 <p>
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>
1179 <p>
1180 </p>
1181 <div class="variablelist"><table border="0">
1182 <col align="left" valign="top">
1183 <tbody>
1184 <tr>
1185 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1186 <td> a Cairo context
1187 </td>
1188 </tr>
1189 <tr>
1190 <td><p><span class="term"><em class="parameter"><code>layout</code></em> :</span></p></td>
1191 <td> a Pango layout
1192 </td>
1193 </tr>
1194 </tbody>
1195 </table></div>
1196 <p class="since">Since 1.10</p>
1197 </div>
1198 <hr>
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"
1203 >cairo_t</a> *cr,
1204                                                          double x,
1205                                                          double y,
1206                                                          double width,
1207                                                          double height);</pre>
1208 <p>
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>
1214 <p>
1215 </p>
1216 <div class="variablelist"><table border="0">
1217 <col align="left" valign="top">
1218 <tbody>
1219 <tr>
1220 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1221 <td> a Cairo context
1222 </td>
1223 </tr>
1224 <tr>
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
1227 </td>
1228 </tr>
1229 <tr>
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
1232 </td>
1233 </tr>
1234 <tr>
1235 <td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
1236 <td> Non-negative width of the rectangle
1237 </td>
1238 </tr>
1239 <tr>
1240 <td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
1241 <td> Non-negative height of the rectangle
1242 </td>
1243 </tr>
1244 </tbody>
1245 </table></div>
1246 <p class="since">Since 1.14</p>
1247 </div>
1248 <hr>
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"
1253 >cairo_t</a> *cr,
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>
1256 <p>
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>
1260 <p>
1261 </p>
1262 <div class="variablelist"><table border="0">
1263 <col align="left" valign="top">
1264 <tbody>
1265 <tr>
1266 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1267 <td> a Cairo context
1268 </td>
1269 </tr>
1270 <tr>
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>
1273 </td>
1274 </tr>
1275 <tr>
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>
1278 </td>
1279 </tr>
1280 </tbody>
1281 </table></div>
1282 <p class="since">Since 1.10</p>
1283 </div>
1284 <hr>
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"
1289 >cairo_t</a> *cr,
1290                                                          <a class="link" href="pango-Layout-Objects.html#PangoLayoutLine" title="PangoLayoutLine">PangoLayoutLine</a> *line);</pre>
1291 <p>
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>
1295 <p>
1296 </p>
1297 <div class="variablelist"><table border="0">
1298 <col align="left" valign="top">
1299 <tbody>
1300 <tr>
1301 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1302 <td> a Cairo context
1303 </td>
1304 </tr>
1305 <tr>
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>
1308 </td>
1309 </tr>
1310 </tbody>
1311 </table></div>
1312 <p class="since">Since 1.10</p>
1313 </div>
1314 <hr>
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"
1319 >cairo_t</a> *cr,
1320                                                          <a class="link" href="pango-Layout-Objects.html#PangoLayout">PangoLayout</a> *layout);</pre>
1321 <p>
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>
1325 <p>
1326 </p>
1327 <div class="variablelist"><table border="0">
1328 <col align="left" valign="top">
1329 <tbody>
1330 <tr>
1331 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1332 <td> a Cairo context
1333 </td>
1334 </tr>
1335 <tr>
1336 <td><p><span class="term"><em class="parameter"><code>layout</code></em> :</span></p></td>
1337 <td> a Pango layout
1338 </td>
1339 </tr>
1340 </tbody>
1341 </table></div>
1342 <p class="since">Since 1.10</p>
1343 </div>
1344 <hr>
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"
1349 >cairo_t</a> *cr,
1350                                                          double x,
1351                                                          double y,
1352                                                          double width,
1353                                                          double height);</pre>
1354 <p>
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>
1360 <p>
1361 </p>
1362 <div class="variablelist"><table border="0">
1363 <col align="left" valign="top">
1364 <tbody>
1365 <tr>
1366 <td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
1367 <td> a Cairo context
1368 </td>
1369 </tr>
1370 <tr>
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
1373 </td>
1374 </tr>
1375 <tr>
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
1378 </td>
1379 </tr>
1380 <tr>
1381 <td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
1382 <td> Non-negative width of the rectangle
1383 </td>
1384 </tr>
1385 <tr>
1386 <td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
1387 <td> Non-negative height of the rectangle
1388 </td>
1389 </tr>
1390 </tbody>
1391 </table></div>
1392 <p class="since">Since 1.14</p>
1393 </div>
1394 </div>
1395 </div>
1396 <div class="footer">
1397 <hr>
1398           Generated by GTK-Doc V1.11</div>
1399 </body>
1400 </html>