annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/share/gtk-doc/html/cairo/cairo-User-Fonts.html @ 68:5028fdace37b

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 16:23:26 -0400
parents
children
rev   line source
jpayne@68 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
jpayne@68 2 <html>
jpayne@68 3 <head>
jpayne@68 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
jpayne@68 5 <title>User Fonts: Cairo: A Vector Graphics Library</title>
jpayne@68 6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
jpayne@68 7 <link rel="home" href="index.html" title="Cairo: A Vector Graphics Library">
jpayne@68 8 <link rel="up" href="cairo-fonts.html" title="Fonts">
jpayne@68 9 <link rel="prev" href="cairo-Quartz-(CGFont)-Fonts.html" title="Quartz (CGFont) Fonts">
jpayne@68 10 <link rel="next" href="cairo-surfaces.html" title="Surfaces">
jpayne@68 11 <meta name="generator" content="GTK-Doc V1.27 (XML mode)">
jpayne@68 12 <link rel="stylesheet" href="style.css" type="text/css">
jpayne@68 13 </head>
jpayne@68 14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
jpayne@68 15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
jpayne@68 16 <td width="100%" align="left" class="shortcuts">
jpayne@68 17 <a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
jpayne@68 18 <a href="#cairo-User-Fonts.description" class="shortcut">Description</a></span>
jpayne@68 19 </td>
jpayne@68 20 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
jpayne@68 21 <td><a accesskey="u" href="cairo-fonts.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
jpayne@68 22 <td><a accesskey="p" href="cairo-Quartz-(CGFont)-Fonts.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
jpayne@68 23 <td><a accesskey="n" href="cairo-surfaces.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
jpayne@68 24 </tr></table>
jpayne@68 25 <div class="refentry">
jpayne@68 26 <a name="cairo-User-Fonts"></a><div class="titlepage"></div>
jpayne@68 27 <div class="refnamediv"><table width="100%"><tr>
jpayne@68 28 <td valign="top">
jpayne@68 29 <h2><span class="refentrytitle"><a name="cairo-User-Fonts.top_of_page"></a>User Fonts</span></h2>
jpayne@68 30 <p>User Fonts — Font support with font data provided by the user</p>
jpayne@68 31 </td>
jpayne@68 32 <td class="gallery_image" valign="top" align="right"></td>
jpayne@68 33 </tr></table></div>
jpayne@68 34 <div class="refsect1">
jpayne@68 35 <a name="cairo-User-Fonts.functions"></a><h2>Functions</h2>
jpayne@68 36 <div class="informaltable"><table class="informaltable" width="100%" border="0">
jpayne@68 37 <colgroup>
jpayne@68 38 <col width="150px" class="functions_return">
jpayne@68 39 <col class="functions_name">
jpayne@68 40 </colgroup>
jpayne@68 41 <tbody>
jpayne@68 42 <tr>
jpayne@68 43 <td class="function_type">
jpayne@68 44 <a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a>
jpayne@68 45 </td>
jpayne@68 46 <td class="function_name">
jpayne@68 47 <span class="c_punctuation">(</span><a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-init-func-t" title="cairo_user_scaled_font_init_func_t ()">*cairo_user_scaled_font_init_func_t</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
jpayne@68 48 </td>
jpayne@68 49 </tr>
jpayne@68 50 <tr>
jpayne@68 51 <td class="function_type">
jpayne@68 52 <a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a>
jpayne@68 53 </td>
jpayne@68 54 <td class="function_name">
jpayne@68 55 <span class="c_punctuation">(</span><a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-render-glyph-func-t" title="cairo_user_scaled_font_render_glyph_func_t ()">*cairo_user_scaled_font_render_glyph_func_t</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
jpayne@68 56 </td>
jpayne@68 57 </tr>
jpayne@68 58 <tr>
jpayne@68 59 <td class="function_type">
jpayne@68 60 <a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a>
jpayne@68 61 </td>
jpayne@68 62 <td class="function_name">
jpayne@68 63 <span class="c_punctuation">(</span><a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-text-to-glyphs-func-t" title="cairo_user_scaled_font_text_to_glyphs_func_t ()">*cairo_user_scaled_font_text_to_glyphs_func_t</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
jpayne@68 64 </td>
jpayne@68 65 </tr>
jpayne@68 66 <tr>
jpayne@68 67 <td class="function_type">
jpayne@68 68 <a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a>
jpayne@68 69 </td>
jpayne@68 70 <td class="function_name">
jpayne@68 71 <span class="c_punctuation">(</span><a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-unicode-to-glyph-func-t" title="cairo_user_scaled_font_unicode_to_glyph_func_t ()">*cairo_user_scaled_font_unicode_to_glyph_func_t</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
jpayne@68 72 </td>
jpayne@68 73 </tr>
jpayne@68 74 <tr>
jpayne@68 75 <td class="function_type">
jpayne@68 76 <a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="returnvalue">cairo_font_face_t</span></a> *
jpayne@68 77 </td>
jpayne@68 78 <td class="function_name">
jpayne@68 79 <a class="link" href="cairo-User-Fonts.html#cairo-user-font-face-create" title="cairo_user_font_face_create ()">cairo_user_font_face_create</a> <span class="c_punctuation">()</span>
jpayne@68 80 </td>
jpayne@68 81 </tr>
jpayne@68 82 <tr>
jpayne@68 83 <td class="function_type">
jpayne@68 84 <span class="returnvalue">void</span>
jpayne@68 85 </td>
jpayne@68 86 <td class="function_name">
jpayne@68 87 <a class="link" href="cairo-User-Fonts.html#cairo-user-font-face-set-init-func" title="cairo_user_font_face_set_init_func ()">cairo_user_font_face_set_init_func</a> <span class="c_punctuation">()</span>
jpayne@68 88 </td>
jpayne@68 89 </tr>
jpayne@68 90 <tr>
jpayne@68 91 <td class="function_type">
jpayne@68 92 <a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-init-func-t" title="cairo_user_scaled_font_init_func_t ()"><span class="returnvalue">cairo_user_scaled_font_init_func_t</span></a>
jpayne@68 93 </td>
jpayne@68 94 <td class="function_name">
jpayne@68 95 <a class="link" href="cairo-User-Fonts.html#cairo-user-font-face-get-init-func" title="cairo_user_font_face_get_init_func ()">cairo_user_font_face_get_init_func</a> <span class="c_punctuation">()</span>
jpayne@68 96 </td>
jpayne@68 97 </tr>
jpayne@68 98 <tr>
jpayne@68 99 <td class="function_type">
jpayne@68 100 <span class="returnvalue">void</span>
jpayne@68 101 </td>
jpayne@68 102 <td class="function_name">
jpayne@68 103 <a class="link" href="cairo-User-Fonts.html#cairo-user-font-face-set-render-glyph-func" title="cairo_user_font_face_set_render_glyph_func ()">cairo_user_font_face_set_render_glyph_func</a> <span class="c_punctuation">()</span>
jpayne@68 104 </td>
jpayne@68 105 </tr>
jpayne@68 106 <tr>
jpayne@68 107 <td class="function_type">
jpayne@68 108 <a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-render-glyph-func-t" title="cairo_user_scaled_font_render_glyph_func_t ()"><span class="returnvalue">cairo_user_scaled_font_render_glyph_func_t</span></a>
jpayne@68 109 </td>
jpayne@68 110 <td class="function_name">
jpayne@68 111 <a class="link" href="cairo-User-Fonts.html#cairo-user-font-face-get-render-glyph-func" title="cairo_user_font_face_get_render_glyph_func ()">cairo_user_font_face_get_render_glyph_func</a> <span class="c_punctuation">()</span>
jpayne@68 112 </td>
jpayne@68 113 </tr>
jpayne@68 114 <tr>
jpayne@68 115 <td class="function_type">
jpayne@68 116 <span class="returnvalue">void</span>
jpayne@68 117 </td>
jpayne@68 118 <td class="function_name">
jpayne@68 119 <a class="link" href="cairo-User-Fonts.html#cairo-user-font-face-set-unicode-to-glyph-func" title="cairo_user_font_face_set_unicode_to_glyph_func ()">cairo_user_font_face_set_unicode_to_glyph_func</a> <span class="c_punctuation">()</span>
jpayne@68 120 </td>
jpayne@68 121 </tr>
jpayne@68 122 <tr>
jpayne@68 123 <td class="function_type">
jpayne@68 124 <a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-unicode-to-glyph-func-t" title="cairo_user_scaled_font_unicode_to_glyph_func_t ()"><span class="returnvalue">cairo_user_scaled_font_unicode_to_glyph_func_t</span></a>
jpayne@68 125 </td>
jpayne@68 126 <td class="function_name">
jpayne@68 127 <a class="link" href="cairo-User-Fonts.html#cairo-user-font-face-get-unicode-to-glyph-func" title="cairo_user_font_face_get_unicode_to_glyph_func ()">cairo_user_font_face_get_unicode_to_glyph_func</a> <span class="c_punctuation">()</span>
jpayne@68 128 </td>
jpayne@68 129 </tr>
jpayne@68 130 <tr>
jpayne@68 131 <td class="function_type">
jpayne@68 132 <span class="returnvalue">void</span>
jpayne@68 133 </td>
jpayne@68 134 <td class="function_name">
jpayne@68 135 <a class="link" href="cairo-User-Fonts.html#cairo-user-font-face-set-text-to-glyphs-func" title="cairo_user_font_face_set_text_to_glyphs_func ()">cairo_user_font_face_set_text_to_glyphs_func</a> <span class="c_punctuation">()</span>
jpayne@68 136 </td>
jpayne@68 137 </tr>
jpayne@68 138 <tr>
jpayne@68 139 <td class="function_type">
jpayne@68 140 <a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-text-to-glyphs-func-t" title="cairo_user_scaled_font_text_to_glyphs_func_t ()"><span class="returnvalue">cairo_user_scaled_font_text_to_glyphs_func_t</span></a>
jpayne@68 141 </td>
jpayne@68 142 <td class="function_name">
jpayne@68 143 <a class="link" href="cairo-User-Fonts.html#cairo-user-font-face-get-text-to-glyphs-func" title="cairo_user_font_face_get_text_to_glyphs_func ()">cairo_user_font_face_get_text_to_glyphs_func</a> <span class="c_punctuation">()</span>
jpayne@68 144 </td>
jpayne@68 145 </tr>
jpayne@68 146 </tbody>
jpayne@68 147 </table></div>
jpayne@68 148 </div>
jpayne@68 149 <div class="refsect1">
jpayne@68 150 <a name="cairo-User-Fonts.other"></a><h2>Types and Values</h2>
jpayne@68 151 <div class="informaltable"><table class="informaltable" width="100%" border="0">
jpayne@68 152 <colgroup>
jpayne@68 153 <col width="150px" class="name">
jpayne@68 154 <col class="description">
jpayne@68 155 </colgroup>
jpayne@68 156 <tbody><tr>
jpayne@68 157 <td class="define_keyword">#define</td>
jpayne@68 158 <td class="function_name"><a class="link" href="cairo-User-Fonts.html#CAIRO-HAS-USER-FONT:CAPS" title="CAIRO_HAS_USER_FONT">CAIRO_HAS_USER_FONT</a></td>
jpayne@68 159 </tr></tbody>
jpayne@68 160 </table></div>
jpayne@68 161 </div>
jpayne@68 162 <div class="refsect1">
jpayne@68 163 <a name="cairo-User-Fonts.description"></a><h2>Description</h2>
jpayne@68 164 <p>The user-font feature allows the cairo user to provide drawings for glyphs
jpayne@68 165 in a font. This is most useful in implementing fonts in non-standard
jpayne@68 166 formats, like SVG fonts and Flash fonts, but can also be used by games and
jpayne@68 167 other application to draw "funky" fonts.</p>
jpayne@68 168 </div>
jpayne@68 169 <div class="refsect1">
jpayne@68 170 <a name="cairo-User-Fonts.functions_details"></a><h2>Functions</h2>
jpayne@68 171 <div class="refsect2">
jpayne@68 172 <a name="cairo-user-scaled-font-init-func-t"></a><h3>cairo_user_scaled_font_init_func_t ()</h3>
jpayne@68 173 <pre class="programlisting"><a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a>
jpayne@68 174 <span class="c_punctuation">(</span>*cairo_user_scaled_font_init_func_t<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="cairo-cairo-scaled-font-t.html#cairo-scaled-font-t" title="cairo_scaled_font_t"><span class="type">cairo_scaled_font_t</span></a> *scaled_font</code></em>,
jpayne@68 175 <em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
jpayne@68 176 <em class="parameter"><code><a class="link" href="cairo-cairo-scaled-font-t.html#cairo-font-extents-t" title="cairo_font_extents_t"><span class="type">cairo_font_extents_t</span></a> *extents</code></em>);</pre>
jpayne@68 177 <p><a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-init-func-t" title="cairo_user_scaled_font_init_func_t ()"><span class="type">cairo_user_scaled_font_init_func_t</span></a> is the type of function which is
jpayne@68 178 called when a scaled-font needs to be created for a user font-face.</p>
jpayne@68 179 <p>The cairo context <em class="parameter"><code>cr</code></em>
jpayne@68 180 is not used by the caller, but is prepared in font
jpayne@68 181 space, similar to what the cairo contexts passed to the render_glyph
jpayne@68 182 method will look like. The callback can use this context for extents
jpayne@68 183 computation for example. After the callback is called, <em class="parameter"><code>cr</code></em>
jpayne@68 184 is checked
jpayne@68 185 for any error status.</p>
jpayne@68 186 <p>The <em class="parameter"><code>extents</code></em>
jpayne@68 187 argument is where the user font sets the font extents for
jpayne@68 188 <em class="parameter"><code>scaled_font</code></em>
jpayne@68 189 . It is in font space, which means that for most cases its
jpayne@68 190 ascent and descent members should add to 1.0. <em class="parameter"><code>extents</code></em>
jpayne@68 191 is preset to
jpayne@68 192 hold a value of 1.0 for ascent, height, and max_x_advance, and 0.0 for
jpayne@68 193 descent and max_y_advance members.</p>
jpayne@68 194 <p>The callback is optional. If not set, default font extents as described
jpayne@68 195 in the previous paragraph will be used.</p>
jpayne@68 196 <p>Note that <em class="parameter"><code>scaled_font</code></em>
jpayne@68 197 is not fully initialized at this
jpayne@68 198 point and trying to use it for text operations in the callback will result
jpayne@68 199 in deadlock.</p>
jpayne@68 200 <div class="refsect3">
jpayne@68 201 <a name="cairo-user-scaled-font-init-func-t.parameters"></a><h4>Parameters</h4>
jpayne@68 202 <div class="informaltable"><table class="informaltable" width="100%" border="0">
jpayne@68 203 <colgroup>
jpayne@68 204 <col width="150px" class="parameters_name">
jpayne@68 205 <col class="parameters_description">
jpayne@68 206 <col width="200px" class="parameters_annotations">
jpayne@68 207 </colgroup>
jpayne@68 208 <tbody>
jpayne@68 209 <tr>
jpayne@68 210 <td class="parameter_name"><p>scaled_font</p></td>
jpayne@68 211 <td class="parameter_description"><p>the scaled-font being created</p></td>
jpayne@68 212 <td class="parameter_annotations"> </td>
jpayne@68 213 </tr>
jpayne@68 214 <tr>
jpayne@68 215 <td class="parameter_name"><p>cr</p></td>
jpayne@68 216 <td class="parameter_description"><p>a cairo context, in font space</p></td>
jpayne@68 217 <td class="parameter_annotations"> </td>
jpayne@68 218 </tr>
jpayne@68 219 <tr>
jpayne@68 220 <td class="parameter_name"><p>extents</p></td>
jpayne@68 221 <td class="parameter_description"><p>font extents to fill in, in font space</p></td>
jpayne@68 222 <td class="parameter_annotations"> </td>
jpayne@68 223 </tr>
jpayne@68 224 </tbody>
jpayne@68 225 </table></div>
jpayne@68 226 </div>
jpayne@68 227 <div class="refsect3">
jpayne@68 228 <a name="cairo-user-scaled-font-init-func-t.returns"></a><h4>Returns</h4>
jpayne@68 229 <p> <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-SUCCESS:CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a> upon success, or an error status on error.</p>
jpayne@68 230 </div>
jpayne@68 231 <p class="since">Since: 1.8</p>
jpayne@68 232 </div>
jpayne@68 233 <hr>
jpayne@68 234 <div class="refsect2">
jpayne@68 235 <a name="cairo-user-scaled-font-render-glyph-func-t"></a><h3>cairo_user_scaled_font_render_glyph_func_t ()</h3>
jpayne@68 236 <pre class="programlisting"><a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a>
jpayne@68 237 <span class="c_punctuation">(</span>*cairo_user_scaled_font_render_glyph_func_t<span class="c_punctuation">)</span>
jpayne@68 238 (<em class="parameter"><code><a class="link" href="cairo-cairo-scaled-font-t.html#cairo-scaled-font-t" title="cairo_scaled_font_t"><span class="type">cairo_scaled_font_t</span></a> *scaled_font</code></em>,
jpayne@68 239 <em class="parameter"><code><span class="type">unsigned long </span> glyph</code></em>,
jpayne@68 240 <em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
jpayne@68 241 <em class="parameter"><code><a class="link" href="cairo-cairo-scaled-font-t.html#cairo-text-extents-t" title="cairo_text_extents_t"><span class="type">cairo_text_extents_t</span></a> *extents</code></em>);</pre>
jpayne@68 242 <p><a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-render-glyph-func-t" title="cairo_user_scaled_font_render_glyph_func_t ()"><span class="type">cairo_user_scaled_font_render_glyph_func_t</span></a> is the type of function which
jpayne@68 243 is called when a user scaled-font needs to render a glyph.</p>
jpayne@68 244 <p>The callback is mandatory, and expected to draw the glyph with code <em class="parameter"><code>glyph</code></em>
jpayne@68 245 to
jpayne@68 246 the cairo context <em class="parameter"><code>cr</code></em>
jpayne@68 247 . <em class="parameter"><code>cr</code></em>
jpayne@68 248 is prepared such that the glyph drawing is done in
jpayne@68 249 font space. That is, the matrix set on <em class="parameter"><code>cr</code></em>
jpayne@68 250 is the scale matrix of <em class="parameter"><code>scaled_font</code></em>
jpayne@68 251 ,
jpayne@68 252 The <em class="parameter"><code>extents</code></em>
jpayne@68 253 argument is where the user font sets the font extents for
jpayne@68 254 <em class="parameter"><code>scaled_font</code></em>
jpayne@68 255 . However, if user prefers to draw in user space, they can
jpayne@68 256 achieve that by changing the matrix on <em class="parameter"><code>cr</code></em>
jpayne@68 257 . All cairo rendering operations
jpayne@68 258 to <em class="parameter"><code>cr</code></em>
jpayne@68 259 are permitted, however, the result is undefined if any source other
jpayne@68 260 than the default source on <em class="parameter"><code>cr</code></em>
jpayne@68 261 is used. That means, glyph bitmaps should
jpayne@68 262 be rendered using <a class="link" href="cairo-cairo-t.html#cairo-mask" title="cairo_mask ()"><code class="function">cairo_mask()</code></a> instead of <a class="link" href="cairo-cairo-t.html#cairo-paint" title="cairo_paint ()"><code class="function">cairo_paint()</code></a>.</p>
jpayne@68 263 <p>Other non-default settings on <em class="parameter"><code>cr</code></em>
jpayne@68 264 include a font size of 1.0 (given that
jpayne@68 265 it is set up to be in font space), and font options corresponding to
jpayne@68 266 <em class="parameter"><code>scaled_font</code></em>
jpayne@68 267 .</p>
jpayne@68 268 <p>The <em class="parameter"><code>extents</code></em>
jpayne@68 269 argument is preset to have <code class="literal">x_bearing</code>,
jpayne@68 270 <code class="literal">width</code>, and <code class="literal">y_advance</code> of zero,
jpayne@68 271 <code class="literal">y_bearing</code> set to <code class="literal">-font_extents.ascent</code>,
jpayne@68 272 <code class="literal">height</code> to <code class="literal">font_extents.ascent+font_extents.descent</code>,
jpayne@68 273 and <code class="literal">x_advance</code> to <code class="literal">font_extents.max_x_advance</code>.
jpayne@68 274 The only field user needs to set in majority of cases is
jpayne@68 275 <code class="literal">x_advance</code>.
jpayne@68 276 If the <code class="literal">width</code> field is zero upon the callback returning
jpayne@68 277 (which is its preset value), the glyph extents are automatically computed
jpayne@68 278 based on the drawings done to <em class="parameter"><code>cr</code></em>
jpayne@68 279 . This is in most cases exactly what the
jpayne@68 280 desired behavior is. However, if for any reason the callback sets the
jpayne@68 281 extents, it must be ink extents, and include the extents of all drawing
jpayne@68 282 done to <em class="parameter"><code>cr</code></em>
jpayne@68 283 in the callback.</p>
jpayne@68 284 <div class="refsect3">
jpayne@68 285 <a name="cairo-user-scaled-font-render-glyph-func-t.parameters"></a><h4>Parameters</h4>
jpayne@68 286 <div class="informaltable"><table class="informaltable" width="100%" border="0">
jpayne@68 287 <colgroup>
jpayne@68 288 <col width="150px" class="parameters_name">
jpayne@68 289 <col class="parameters_description">
jpayne@68 290 <col width="200px" class="parameters_annotations">
jpayne@68 291 </colgroup>
jpayne@68 292 <tbody>
jpayne@68 293 <tr>
jpayne@68 294 <td class="parameter_name"><p>scaled_font</p></td>
jpayne@68 295 <td class="parameter_description"><p>user scaled-font</p></td>
jpayne@68 296 <td class="parameter_annotations"> </td>
jpayne@68 297 </tr>
jpayne@68 298 <tr>
jpayne@68 299 <td class="parameter_name"><p>glyph</p></td>
jpayne@68 300 <td class="parameter_description"><p>glyph code to render</p></td>
jpayne@68 301 <td class="parameter_annotations"> </td>
jpayne@68 302 </tr>
jpayne@68 303 <tr>
jpayne@68 304 <td class="parameter_name"><p>cr</p></td>
jpayne@68 305 <td class="parameter_description"><p>cairo context to draw to, in font space</p></td>
jpayne@68 306 <td class="parameter_annotations"> </td>
jpayne@68 307 </tr>
jpayne@68 308 <tr>
jpayne@68 309 <td class="parameter_name"><p>extents</p></td>
jpayne@68 310 <td class="parameter_description"><p>glyph extents to fill in, in font space</p></td>
jpayne@68 311 <td class="parameter_annotations"> </td>
jpayne@68 312 </tr>
jpayne@68 313 </tbody>
jpayne@68 314 </table></div>
jpayne@68 315 </div>
jpayne@68 316 <div class="refsect3">
jpayne@68 317 <a name="cairo-user-scaled-font-render-glyph-func-t.returns"></a><h4>Returns</h4>
jpayne@68 318 <p> <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-SUCCESS:CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a> upon success, or
jpayne@68 319 <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-USER-FONT-ERROR:CAPS"><code class="literal">CAIRO_STATUS_USER_FONT_ERROR</code></a> or any other error status on error.</p>
jpayne@68 320 </div>
jpayne@68 321 <p class="since">Since: 1.8</p>
jpayne@68 322 </div>
jpayne@68 323 <hr>
jpayne@68 324 <div class="refsect2">
jpayne@68 325 <a name="cairo-user-scaled-font-text-to-glyphs-func-t"></a><h3>cairo_user_scaled_font_text_to_glyphs_func_t ()</h3>
jpayne@68 326 <pre class="programlisting"><a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a>
jpayne@68 327 <span class="c_punctuation">(</span>*cairo_user_scaled_font_text_to_glyphs_func_t<span class="c_punctuation">)</span>
jpayne@68 328 (<em class="parameter"><code><a class="link" href="cairo-cairo-scaled-font-t.html#cairo-scaled-font-t" title="cairo_scaled_font_t"><span class="type">cairo_scaled_font_t</span></a> *scaled_font</code></em>,
jpayne@68 329 <em class="parameter"><code>const <span class="type">char</span> *utf8</code></em>,
jpayne@68 330 <em class="parameter"><code><span class="type">int</span> utf8_len</code></em>,
jpayne@68 331 <em class="parameter"><code><a class="link" href="cairo-text.html#cairo-glyph-t" title="cairo_glyph_t"><span class="type">cairo_glyph_t</span></a> **glyphs</code></em>,
jpayne@68 332 <em class="parameter"><code><span class="type">int</span> *num_glyphs</code></em>,
jpayne@68 333 <em class="parameter"><code><a class="link" href="cairo-text.html#cairo-text-cluster-t" title="cairo_text_cluster_t"><span class="type">cairo_text_cluster_t</span></a> **clusters</code></em>,
jpayne@68 334 <em class="parameter"><code><span class="type">int</span> *num_clusters</code></em>,
jpayne@68 335 <em class="parameter"><code><a class="link" href="cairo-text.html#cairo-text-cluster-flags-t" title="enum cairo_text_cluster_flags_t"><span class="type">cairo_text_cluster_flags_t</span></a> *cluster_flags</code></em>);</pre>
jpayne@68 336 <p><a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-text-to-glyphs-func-t" title="cairo_user_scaled_font_text_to_glyphs_func_t ()"><span class="type">cairo_user_scaled_font_text_to_glyphs_func_t</span></a> is the type of function which
jpayne@68 337 is called to convert input text to an array of glyphs. This is used by the
jpayne@68 338 <a class="link" href="cairo-text.html#cairo-show-text" title="cairo_show_text ()"><code class="function">cairo_show_text()</code></a> operation.</p>
jpayne@68 339 <p>Using this callback the user-font has full control on glyphs and their
jpayne@68 340 positions. That means, it allows for features like ligatures and kerning,
jpayne@68 341 as well as complex <em class="firstterm">shaping</em> required for scripts like
jpayne@68 342 Arabic and Indic.</p>
jpayne@68 343 <p>The <em class="parameter"><code>num_glyphs</code></em>
jpayne@68 344 argument is preset to the number of glyph entries available
jpayne@68 345 in the <em class="parameter"><code>glyphs</code></em>
jpayne@68 346 buffer. If the <em class="parameter"><code>glyphs</code></em>
jpayne@68 347 buffer is <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, the value of
jpayne@68 348 <em class="parameter"><code>num_glyphs</code></em>
jpayne@68 349 will be zero. If the provided glyph array is too short for
jpayne@68 350 the conversion (or for convenience), a new glyph array may be allocated
jpayne@68 351 using <a class="link" href="cairo-text.html#cairo-glyph-allocate" title="cairo_glyph_allocate ()"><code class="function">cairo_glyph_allocate()</code></a> and placed in <em class="parameter"><code>glyphs</code></em>
jpayne@68 352 . Upon return,
jpayne@68 353 <em class="parameter"><code>num_glyphs</code></em>
jpayne@68 354 should contain the number of generated glyphs. If the value
jpayne@68 355 <em class="parameter"><code>glyphs</code></em>
jpayne@68 356 points at has changed after the call, the caller will free the
jpayne@68 357 allocated glyph array using <a class="link" href="cairo-text.html#cairo-glyph-free" title="cairo_glyph_free ()"><code class="function">cairo_glyph_free()</code></a>. The caller will also free
jpayne@68 358 the original value of <em class="parameter"><code>glyphs</code></em>
jpayne@68 359 , so the callback shouldn't do so.
jpayne@68 360 The callback should populate the glyph indices and positions (in font space)
jpayne@68 361 assuming that the text is to be shown at the origin.</p>
jpayne@68 362 <p>If <em class="parameter"><code>clusters</code></em>
jpayne@68 363 is not <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, <em class="parameter"><code>num_clusters</code></em>
jpayne@68 364 and <em class="parameter"><code>cluster_flags</code></em>
jpayne@68 365 are also
jpayne@68 366 non-<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, and cluster mapping should be computed. The semantics of how
jpayne@68 367 cluster array allocation works is similar to the glyph array. That is,
jpayne@68 368 if <em class="parameter"><code>clusters</code></em>
jpayne@68 369 initially points to a non-<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> value, that array may be used
jpayne@68 370 as a cluster buffer, and <em class="parameter"><code>num_clusters</code></em>
jpayne@68 371 points to the number of cluster
jpayne@68 372 entries available there. If the provided cluster array is too short for
jpayne@68 373 the conversion (or for convenience), a new cluster array may be allocated
jpayne@68 374 using <a class="link" href="cairo-text.html#cairo-text-cluster-allocate" title="cairo_text_cluster_allocate ()"><code class="function">cairo_text_cluster_allocate()</code></a> and placed in <em class="parameter"><code>clusters</code></em>
jpayne@68 375 . In this case,
jpayne@68 376 the original value of <em class="parameter"><code>clusters</code></em>
jpayne@68 377 will still be freed by the caller. Upon
jpayne@68 378 return, <em class="parameter"><code>num_clusters</code></em>
jpayne@68 379 should contain the number of generated clusters.
jpayne@68 380 If the value <em class="parameter"><code>clusters</code></em>
jpayne@68 381 points at has changed after the call, the caller
jpayne@68 382 will free the allocated cluster array using <a class="link" href="cairo-text.html#cairo-text-cluster-free" title="cairo_text_cluster_free ()"><code class="function">cairo_text_cluster_free()</code></a>.</p>
jpayne@68 383 <p>The callback is optional. If <em class="parameter"><code>num_glyphs</code></em>
jpayne@68 384 is negative upon
jpayne@68 385 the callback returning or if the return value
jpayne@68 386 is <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-USER-FONT-NOT-IMPLEMENTED:CAPS"><code class="literal">CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED</code></a>, the unicode_to_glyph callback
jpayne@68 387 is tried. See <a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-unicode-to-glyph-func-t" title="cairo_user_scaled_font_unicode_to_glyph_func_t ()"><span class="type">cairo_user_scaled_font_unicode_to_glyph_func_t</span></a>.</p>
jpayne@68 388 <p>Note: While cairo does not impose any limitation on glyph indices,
jpayne@68 389 some applications may assume that a glyph index fits in a 16-bit
jpayne@68 390 unsigned integer. As such, it is advised that user-fonts keep their
jpayne@68 391 glyphs in the 0 to 65535 range. Furthermore, some applications may
jpayne@68 392 assume that glyph 0 is a special glyph-not-found glyph. User-fonts
jpayne@68 393 are advised to use glyph 0 for such purposes and do not use that
jpayne@68 394 glyph value for other purposes.</p>
jpayne@68 395 <div class="refsect3">
jpayne@68 396 <a name="cairo-user-scaled-font-text-to-glyphs-func-t.parameters"></a><h4>Parameters</h4>
jpayne@68 397 <div class="informaltable"><table class="informaltable" width="100%" border="0">
jpayne@68 398 <colgroup>
jpayne@68 399 <col width="150px" class="parameters_name">
jpayne@68 400 <col class="parameters_description">
jpayne@68 401 <col width="200px" class="parameters_annotations">
jpayne@68 402 </colgroup>
jpayne@68 403 <tbody>
jpayne@68 404 <tr>
jpayne@68 405 <td class="parameter_name"><p>scaled_font</p></td>
jpayne@68 406 <td class="parameter_description"><p>the scaled-font being created</p></td>
jpayne@68 407 <td class="parameter_annotations"> </td>
jpayne@68 408 </tr>
jpayne@68 409 <tr>
jpayne@68 410 <td class="parameter_name"><p>utf8</p></td>
jpayne@68 411 <td class="parameter_description"><p>a string of text encoded in UTF-8</p></td>
jpayne@68 412 <td class="parameter_annotations"> </td>
jpayne@68 413 </tr>
jpayne@68 414 <tr>
jpayne@68 415 <td class="parameter_name"><p>utf8_len</p></td>
jpayne@68 416 <td class="parameter_description"><p>length of <em class="parameter"><code>utf8</code></em>
jpayne@68 417 in bytes</p></td>
jpayne@68 418 <td class="parameter_annotations"> </td>
jpayne@68 419 </tr>
jpayne@68 420 <tr>
jpayne@68 421 <td class="parameter_name"><p>glyphs</p></td>
jpayne@68 422 <td class="parameter_description"><p>pointer to array of glyphs to fill, in font space</p></td>
jpayne@68 423 <td class="parameter_annotations"> </td>
jpayne@68 424 </tr>
jpayne@68 425 <tr>
jpayne@68 426 <td class="parameter_name"><p>num_glyphs</p></td>
jpayne@68 427 <td class="parameter_description"><p>pointer to number of glyphs</p></td>
jpayne@68 428 <td class="parameter_annotations"> </td>
jpayne@68 429 </tr>
jpayne@68 430 <tr>
jpayne@68 431 <td class="parameter_name"><p>clusters</p></td>
jpayne@68 432 <td class="parameter_description"><p>pointer to array of cluster mapping information to fill, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
jpayne@68 433 <td class="parameter_annotations"> </td>
jpayne@68 434 </tr>
jpayne@68 435 <tr>
jpayne@68 436 <td class="parameter_name"><p>num_clusters</p></td>
jpayne@68 437 <td class="parameter_description"><p>pointer to number of clusters</p></td>
jpayne@68 438 <td class="parameter_annotations"> </td>
jpayne@68 439 </tr>
jpayne@68 440 <tr>
jpayne@68 441 <td class="parameter_name"><p>cluster_flags</p></td>
jpayne@68 442 <td class="parameter_description"><p>pointer to location to store cluster flags corresponding to the
jpayne@68 443 output <em class="parameter"><code>clusters</code></em>
jpayne@68 444 </p></td>
jpayne@68 445 <td class="parameter_annotations"> </td>
jpayne@68 446 </tr>
jpayne@68 447 </tbody>
jpayne@68 448 </table></div>
jpayne@68 449 </div>
jpayne@68 450 <div class="refsect3">
jpayne@68 451 <a name="cairo-user-scaled-font-text-to-glyphs-func-t.returns"></a><h4>Returns</h4>
jpayne@68 452 <p> <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-SUCCESS:CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a> upon success,
jpayne@68 453 <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-USER-FONT-NOT-IMPLEMENTED:CAPS"><code class="literal">CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED</code></a> if fallback options should be tried,
jpayne@68 454 or <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-USER-FONT-ERROR:CAPS"><code class="literal">CAIRO_STATUS_USER_FONT_ERROR</code></a> or any other error status on error.</p>
jpayne@68 455 </div>
jpayne@68 456 <p class="since">Since: 1.8</p>
jpayne@68 457 </div>
jpayne@68 458 <hr>
jpayne@68 459 <div class="refsect2">
jpayne@68 460 <a name="cairo-user-scaled-font-unicode-to-glyph-func-t"></a><h3>cairo_user_scaled_font_unicode_to_glyph_func_t ()</h3>
jpayne@68 461 <pre class="programlisting"><a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a>
jpayne@68 462 <span class="c_punctuation">(</span>*cairo_user_scaled_font_unicode_to_glyph_func_t<span class="c_punctuation">)</span>
jpayne@68 463 (<em class="parameter"><code><a class="link" href="cairo-cairo-scaled-font-t.html#cairo-scaled-font-t" title="cairo_scaled_font_t"><span class="type">cairo_scaled_font_t</span></a> *scaled_font</code></em>,
jpayne@68 464 <em class="parameter"><code><span class="type">unsigned long </span> unicode</code></em>,
jpayne@68 465 <em class="parameter"><code>unsigned <span class="type">long</span> *glyph_index</code></em>);</pre>
jpayne@68 466 <p><a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-unicode-to-glyph-func-t" title="cairo_user_scaled_font_unicode_to_glyph_func_t ()"><span class="type">cairo_user_scaled_font_unicode_to_glyph_func_t</span></a> is the type of function which
jpayne@68 467 is called to convert an input Unicode character to a single glyph.
jpayne@68 468 This is used by the <a class="link" href="cairo-text.html#cairo-show-text" title="cairo_show_text ()"><code class="function">cairo_show_text()</code></a> operation.</p>
jpayne@68 469 <p>This callback is used to provide the same functionality as the
jpayne@68 470 text_to_glyphs callback does (see <a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-text-to-glyphs-func-t" title="cairo_user_scaled_font_text_to_glyphs_func_t ()"><span class="type">cairo_user_scaled_font_text_to_glyphs_func_t</span></a>)
jpayne@68 471 but has much less control on the output,
jpayne@68 472 in exchange for increased ease of use. The inherent assumption to using
jpayne@68 473 this callback is that each character maps to one glyph, and that the
jpayne@68 474 mapping is context independent. It also assumes that glyphs are positioned
jpayne@68 475 according to their advance width. These mean no ligatures, kerning, or
jpayne@68 476 complex scripts can be implemented using this callback.</p>
jpayne@68 477 <p>The callback is optional, and only used if text_to_glyphs callback is not
jpayne@68 478 set or fails to return glyphs. If this callback is not set or if it returns
jpayne@68 479 <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-USER-FONT-NOT-IMPLEMENTED:CAPS"><code class="literal">CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED</code></a>, an identity mapping from Unicode
jpayne@68 480 code-points to glyph indices is assumed.</p>
jpayne@68 481 <p>Note: While cairo does not impose any limitation on glyph indices,
jpayne@68 482 some applications may assume that a glyph index fits in a 16-bit
jpayne@68 483 unsigned integer. As such, it is advised that user-fonts keep their
jpayne@68 484 glyphs in the 0 to 65535 range. Furthermore, some applications may
jpayne@68 485 assume that glyph 0 is a special glyph-not-found glyph. User-fonts
jpayne@68 486 are advised to use glyph 0 for such purposes and do not use that
jpayne@68 487 glyph value for other purposes.</p>
jpayne@68 488 <div class="refsect3">
jpayne@68 489 <a name="cairo-user-scaled-font-unicode-to-glyph-func-t.parameters"></a><h4>Parameters</h4>
jpayne@68 490 <div class="informaltable"><table class="informaltable" width="100%" border="0">
jpayne@68 491 <colgroup>
jpayne@68 492 <col width="150px" class="parameters_name">
jpayne@68 493 <col class="parameters_description">
jpayne@68 494 <col width="200px" class="parameters_annotations">
jpayne@68 495 </colgroup>
jpayne@68 496 <tbody>
jpayne@68 497 <tr>
jpayne@68 498 <td class="parameter_name"><p>scaled_font</p></td>
jpayne@68 499 <td class="parameter_description"><p>the scaled-font being created</p></td>
jpayne@68 500 <td class="parameter_annotations"> </td>
jpayne@68 501 </tr>
jpayne@68 502 <tr>
jpayne@68 503 <td class="parameter_name"><p>unicode</p></td>
jpayne@68 504 <td class="parameter_description"><p>input unicode character code-point</p></td>
jpayne@68 505 <td class="parameter_annotations"> </td>
jpayne@68 506 </tr>
jpayne@68 507 <tr>
jpayne@68 508 <td class="parameter_name"><p>glyph_index</p></td>
jpayne@68 509 <td class="parameter_description"><p>output glyph index</p></td>
jpayne@68 510 <td class="parameter_annotations"> </td>
jpayne@68 511 </tr>
jpayne@68 512 </tbody>
jpayne@68 513 </table></div>
jpayne@68 514 </div>
jpayne@68 515 <div class="refsect3">
jpayne@68 516 <a name="cairo-user-scaled-font-unicode-to-glyph-func-t.returns"></a><h4>Returns</h4>
jpayne@68 517 <p> <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-SUCCESS:CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a> upon success,
jpayne@68 518 <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-USER-FONT-NOT-IMPLEMENTED:CAPS"><code class="literal">CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED</code></a> if fallback options should be tried,
jpayne@68 519 or <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-USER-FONT-ERROR:CAPS"><code class="literal">CAIRO_STATUS_USER_FONT_ERROR</code></a> or any other error status on error.</p>
jpayne@68 520 </div>
jpayne@68 521 <p class="since">Since: 1.8</p>
jpayne@68 522 </div>
jpayne@68 523 <hr>
jpayne@68 524 <div class="refsect2">
jpayne@68 525 <a name="cairo-user-font-face-create"></a><h3>cairo_user_font_face_create ()</h3>
jpayne@68 526 <pre class="programlisting"><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="returnvalue">cairo_font_face_t</span></a> *
jpayne@68 527 cairo_user_font_face_create (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
jpayne@68 528 <p>Creates a new user font-face.</p>
jpayne@68 529 <p>Use the setter functions to associate callbacks with the returned
jpayne@68 530 user font. The only mandatory callback is render_glyph.</p>
jpayne@68 531 <p>After the font-face is created, the user can attach arbitrary data
jpayne@68 532 (the actual font data) to it using <a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-set-user-data" title="cairo_font_face_set_user_data ()"><code class="function">cairo_font_face_set_user_data()</code></a>
jpayne@68 533 and access it from the user-font callbacks by using
jpayne@68 534 <a class="link" href="cairo-cairo-scaled-font-t.html#cairo-scaled-font-get-font-face" title="cairo_scaled_font_get_font_face ()"><code class="function">cairo_scaled_font_get_font_face()</code></a> followed by
jpayne@68 535 <a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-get-user-data" title="cairo_font_face_get_user_data ()"><code class="function">cairo_font_face_get_user_data()</code></a>.</p>
jpayne@68 536 <div class="refsect3">
jpayne@68 537 <a name="cairo-user-font-face-create.returns"></a><h4>Returns</h4>
jpayne@68 538 <p> a newly created <a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a>. Free with
jpayne@68 539 <a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-destroy" title="cairo_font_face_destroy ()"><code class="function">cairo_font_face_destroy()</code></a> when you are done using it.</p>
jpayne@68 540 </div>
jpayne@68 541 <p class="since">Since: 1.8</p>
jpayne@68 542 </div>
jpayne@68 543 <hr>
jpayne@68 544 <div class="refsect2">
jpayne@68 545 <a name="cairo-user-font-face-set-init-func"></a><h3>cairo_user_font_face_set_init_func ()</h3>
jpayne@68 546 <pre class="programlisting"><span class="returnvalue">void</span>
jpayne@68 547 cairo_user_font_face_set_init_func (<em class="parameter"><code><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a> *font_face</code></em>,
jpayne@68 548 <em class="parameter"><code><a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-init-func-t" title="cairo_user_scaled_font_init_func_t ()"><span class="type">cairo_user_scaled_font_init_func_t</span></a> init_func</code></em>);</pre>
jpayne@68 549 <p>Sets the scaled-font initialization function of a user-font.
jpayne@68 550 See <a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-init-func-t" title="cairo_user_scaled_font_init_func_t ()"><span class="type">cairo_user_scaled_font_init_func_t</span></a> for details of how the callback
jpayne@68 551 works.</p>
jpayne@68 552 <p>The font-face should not be immutable or a <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-USER-FONT-IMMUTABLE:CAPS"><code class="literal">CAIRO_STATUS_USER_FONT_IMMUTABLE</code></a>
jpayne@68 553 error will occur. A user font-face is immutable as soon as a scaled-font
jpayne@68 554 is created from it.</p>
jpayne@68 555 <div class="refsect3">
jpayne@68 556 <a name="cairo-user-font-face-set-init-func.parameters"></a><h4>Parameters</h4>
jpayne@68 557 <div class="informaltable"><table class="informaltable" width="100%" border="0">
jpayne@68 558 <colgroup>
jpayne@68 559 <col width="150px" class="parameters_name">
jpayne@68 560 <col class="parameters_description">
jpayne@68 561 <col width="200px" class="parameters_annotations">
jpayne@68 562 </colgroup>
jpayne@68 563 <tbody>
jpayne@68 564 <tr>
jpayne@68 565 <td class="parameter_name"><p>font_face</p></td>
jpayne@68 566 <td class="parameter_description"><p>A user font face</p></td>
jpayne@68 567 <td class="parameter_annotations"> </td>
jpayne@68 568 </tr>
jpayne@68 569 <tr>
jpayne@68 570 <td class="parameter_name"><p>init_func</p></td>
jpayne@68 571 <td class="parameter_description"><p>The init callback, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
jpayne@68 572 <td class="parameter_annotations"> </td>
jpayne@68 573 </tr>
jpayne@68 574 </tbody>
jpayne@68 575 </table></div>
jpayne@68 576 </div>
jpayne@68 577 <p class="since">Since: 1.8</p>
jpayne@68 578 </div>
jpayne@68 579 <hr>
jpayne@68 580 <div class="refsect2">
jpayne@68 581 <a name="cairo-user-font-face-get-init-func"></a><h3>cairo_user_font_face_get_init_func ()</h3>
jpayne@68 582 <pre class="programlisting"><a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-init-func-t" title="cairo_user_scaled_font_init_func_t ()"><span class="returnvalue">cairo_user_scaled_font_init_func_t</span></a>
jpayne@68 583 cairo_user_font_face_get_init_func (<em class="parameter"><code><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a> *font_face</code></em>);</pre>
jpayne@68 584 <p>Gets the scaled-font initialization function of a user-font.</p>
jpayne@68 585 <div class="refsect3">
jpayne@68 586 <a name="cairo-user-font-face-get-init-func.parameters"></a><h4>Parameters</h4>
jpayne@68 587 <div class="informaltable"><table class="informaltable" width="100%" border="0">
jpayne@68 588 <colgroup>
jpayne@68 589 <col width="150px" class="parameters_name">
jpayne@68 590 <col class="parameters_description">
jpayne@68 591 <col width="200px" class="parameters_annotations">
jpayne@68 592 </colgroup>
jpayne@68 593 <tbody><tr>
jpayne@68 594 <td class="parameter_name"><p>font_face</p></td>
jpayne@68 595 <td class="parameter_description"><p>A user font face</p></td>
jpayne@68 596 <td class="parameter_annotations"> </td>
jpayne@68 597 </tr></tbody>
jpayne@68 598 </table></div>
jpayne@68 599 </div>
jpayne@68 600 <div class="refsect3">
jpayne@68 601 <a name="cairo-user-font-face-get-init-func.returns"></a><h4>Returns</h4>
jpayne@68 602 <p> The init callback of <em class="parameter"><code>font_face</code></em>
jpayne@68 603 or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if none set or an error has occurred.</p>
jpayne@68 604 </div>
jpayne@68 605 <p class="since">Since: 1.8</p>
jpayne@68 606 </div>
jpayne@68 607 <hr>
jpayne@68 608 <div class="refsect2">
jpayne@68 609 <a name="cairo-user-font-face-set-render-glyph-func"></a><h3>cairo_user_font_face_set_render_glyph_func ()</h3>
jpayne@68 610 <pre class="programlisting"><span class="returnvalue">void</span>
jpayne@68 611 cairo_user_font_face_set_render_glyph_func
jpayne@68 612 (<em class="parameter"><code><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a> *font_face</code></em>,
jpayne@68 613 <em class="parameter"><code><a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-render-glyph-func-t" title="cairo_user_scaled_font_render_glyph_func_t ()"><span class="type">cairo_user_scaled_font_render_glyph_func_t</span></a> render_glyph_func</code></em>);</pre>
jpayne@68 614 <p>Sets the glyph rendering function of a user-font.
jpayne@68 615 See <a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-render-glyph-func-t" title="cairo_user_scaled_font_render_glyph_func_t ()"><span class="type">cairo_user_scaled_font_render_glyph_func_t</span></a> for details of how the callback
jpayne@68 616 works.</p>
jpayne@68 617 <p>The font-face should not be immutable or a <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-USER-FONT-IMMUTABLE:CAPS"><code class="literal">CAIRO_STATUS_USER_FONT_IMMUTABLE</code></a>
jpayne@68 618 error will occur. A user font-face is immutable as soon as a scaled-font
jpayne@68 619 is created from it.</p>
jpayne@68 620 <p>The render_glyph callback is the only mandatory callback of a user-font.
jpayne@68 621 If the callback is <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> and a glyph is tried to be rendered using
jpayne@68 622 <em class="parameter"><code>font_face</code></em>
jpayne@68 623 , a <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-USER-FONT-ERROR:CAPS"><code class="literal">CAIRO_STATUS_USER_FONT_ERROR</code></a> will occur.</p>
jpayne@68 624 <div class="refsect3">
jpayne@68 625 <a name="cairo-user-font-face-set-render-glyph-func.parameters"></a><h4>Parameters</h4>
jpayne@68 626 <div class="informaltable"><table class="informaltable" width="100%" border="0">
jpayne@68 627 <colgroup>
jpayne@68 628 <col width="150px" class="parameters_name">
jpayne@68 629 <col class="parameters_description">
jpayne@68 630 <col width="200px" class="parameters_annotations">
jpayne@68 631 </colgroup>
jpayne@68 632 <tbody>
jpayne@68 633 <tr>
jpayne@68 634 <td class="parameter_name"><p>font_face</p></td>
jpayne@68 635 <td class="parameter_description"><p>A user font face</p></td>
jpayne@68 636 <td class="parameter_annotations"> </td>
jpayne@68 637 </tr>
jpayne@68 638 <tr>
jpayne@68 639 <td class="parameter_name"><p>render_glyph_func</p></td>
jpayne@68 640 <td class="parameter_description"><p>The render_glyph callback, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
jpayne@68 641 <td class="parameter_annotations"> </td>
jpayne@68 642 </tr>
jpayne@68 643 </tbody>
jpayne@68 644 </table></div>
jpayne@68 645 </div>
jpayne@68 646 <p class="since">Since: 1.8</p>
jpayne@68 647 </div>
jpayne@68 648 <hr>
jpayne@68 649 <div class="refsect2">
jpayne@68 650 <a name="cairo-user-font-face-get-render-glyph-func"></a><h3>cairo_user_font_face_get_render_glyph_func ()</h3>
jpayne@68 651 <pre class="programlisting"><a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-render-glyph-func-t" title="cairo_user_scaled_font_render_glyph_func_t ()"><span class="returnvalue">cairo_user_scaled_font_render_glyph_func_t</span></a>
jpayne@68 652 cairo_user_font_face_get_render_glyph_func
jpayne@68 653 (<em class="parameter"><code><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a> *font_face</code></em>);</pre>
jpayne@68 654 <p>Gets the glyph rendering function of a user-font.</p>
jpayne@68 655 <div class="refsect3">
jpayne@68 656 <a name="cairo-user-font-face-get-render-glyph-func.parameters"></a><h4>Parameters</h4>
jpayne@68 657 <div class="informaltable"><table class="informaltable" width="100%" border="0">
jpayne@68 658 <colgroup>
jpayne@68 659 <col width="150px" class="parameters_name">
jpayne@68 660 <col class="parameters_description">
jpayne@68 661 <col width="200px" class="parameters_annotations">
jpayne@68 662 </colgroup>
jpayne@68 663 <tbody><tr>
jpayne@68 664 <td class="parameter_name"><p>font_face</p></td>
jpayne@68 665 <td class="parameter_description"><p>A user font face</p></td>
jpayne@68 666 <td class="parameter_annotations"> </td>
jpayne@68 667 </tr></tbody>
jpayne@68 668 </table></div>
jpayne@68 669 </div>
jpayne@68 670 <div class="refsect3">
jpayne@68 671 <a name="cairo-user-font-face-get-render-glyph-func.returns"></a><h4>Returns</h4>
jpayne@68 672 <p> The render_glyph callback of <em class="parameter"><code>font_face</code></em>
jpayne@68 673 or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if none set or an error has occurred.</p>
jpayne@68 674 </div>
jpayne@68 675 <p class="since">Since: 1.8</p>
jpayne@68 676 </div>
jpayne@68 677 <hr>
jpayne@68 678 <div class="refsect2">
jpayne@68 679 <a name="cairo-user-font-face-set-unicode-to-glyph-func"></a><h3>cairo_user_font_face_set_unicode_to_glyph_func ()</h3>
jpayne@68 680 <pre class="programlisting"><span class="returnvalue">void</span>
jpayne@68 681 cairo_user_font_face_set_unicode_to_glyph_func
jpayne@68 682 (<em class="parameter"><code><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a> *font_face</code></em>,
jpayne@68 683 <em class="parameter"><code><a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-unicode-to-glyph-func-t" title="cairo_user_scaled_font_unicode_to_glyph_func_t ()"><span class="type">cairo_user_scaled_font_unicode_to_glyph_func_t</span></a> unicode_to_glyph_func</code></em>);</pre>
jpayne@68 684 <p>Sets the unicode-to-glyph conversion function of a user-font.
jpayne@68 685 See <a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-unicode-to-glyph-func-t" title="cairo_user_scaled_font_unicode_to_glyph_func_t ()"><span class="type">cairo_user_scaled_font_unicode_to_glyph_func_t</span></a> for details of how the callback
jpayne@68 686 works.</p>
jpayne@68 687 <p>The font-face should not be immutable or a <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-USER-FONT-IMMUTABLE:CAPS"><code class="literal">CAIRO_STATUS_USER_FONT_IMMUTABLE</code></a>
jpayne@68 688 error will occur. A user font-face is immutable as soon as a scaled-font
jpayne@68 689 is created from it.</p>
jpayne@68 690 <div class="refsect3">
jpayne@68 691 <a name="cairo-user-font-face-set-unicode-to-glyph-func.parameters"></a><h4>Parameters</h4>
jpayne@68 692 <div class="informaltable"><table class="informaltable" width="100%" border="0">
jpayne@68 693 <colgroup>
jpayne@68 694 <col width="150px" class="parameters_name">
jpayne@68 695 <col class="parameters_description">
jpayne@68 696 <col width="200px" class="parameters_annotations">
jpayne@68 697 </colgroup>
jpayne@68 698 <tbody>
jpayne@68 699 <tr>
jpayne@68 700 <td class="parameter_name"><p>font_face</p></td>
jpayne@68 701 <td class="parameter_description"><p>A user font face</p></td>
jpayne@68 702 <td class="parameter_annotations"> </td>
jpayne@68 703 </tr>
jpayne@68 704 <tr>
jpayne@68 705 <td class="parameter_name"><p>unicode_to_glyph_func</p></td>
jpayne@68 706 <td class="parameter_description"><p>The unicode_to_glyph callback, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
jpayne@68 707 <td class="parameter_annotations"> </td>
jpayne@68 708 </tr>
jpayne@68 709 </tbody>
jpayne@68 710 </table></div>
jpayne@68 711 </div>
jpayne@68 712 <p class="since">Since: 1.8</p>
jpayne@68 713 </div>
jpayne@68 714 <hr>
jpayne@68 715 <div class="refsect2">
jpayne@68 716 <a name="cairo-user-font-face-get-unicode-to-glyph-func"></a><h3>cairo_user_font_face_get_unicode_to_glyph_func ()</h3>
jpayne@68 717 <pre class="programlisting"><a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-unicode-to-glyph-func-t" title="cairo_user_scaled_font_unicode_to_glyph_func_t ()"><span class="returnvalue">cairo_user_scaled_font_unicode_to_glyph_func_t</span></a>
jpayne@68 718 cairo_user_font_face_get_unicode_to_glyph_func
jpayne@68 719 (<em class="parameter"><code><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a> *font_face</code></em>);</pre>
jpayne@68 720 <p>Gets the unicode-to-glyph conversion function of a user-font.</p>
jpayne@68 721 <div class="refsect3">
jpayne@68 722 <a name="cairo-user-font-face-get-unicode-to-glyph-func.parameters"></a><h4>Parameters</h4>
jpayne@68 723 <div class="informaltable"><table class="informaltable" width="100%" border="0">
jpayne@68 724 <colgroup>
jpayne@68 725 <col width="150px" class="parameters_name">
jpayne@68 726 <col class="parameters_description">
jpayne@68 727 <col width="200px" class="parameters_annotations">
jpayne@68 728 </colgroup>
jpayne@68 729 <tbody><tr>
jpayne@68 730 <td class="parameter_name"><p>font_face</p></td>
jpayne@68 731 <td class="parameter_description"><p>A user font face</p></td>
jpayne@68 732 <td class="parameter_annotations"> </td>
jpayne@68 733 </tr></tbody>
jpayne@68 734 </table></div>
jpayne@68 735 </div>
jpayne@68 736 <div class="refsect3">
jpayne@68 737 <a name="cairo-user-font-face-get-unicode-to-glyph-func.returns"></a><h4>Returns</h4>
jpayne@68 738 <p> The unicode_to_glyph callback of <em class="parameter"><code>font_face</code></em>
jpayne@68 739 or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if none set or an error occurred.</p>
jpayne@68 740 </div>
jpayne@68 741 <p class="since">Since: 1.8</p>
jpayne@68 742 </div>
jpayne@68 743 <hr>
jpayne@68 744 <div class="refsect2">
jpayne@68 745 <a name="cairo-user-font-face-set-text-to-glyphs-func"></a><h3>cairo_user_font_face_set_text_to_glyphs_func ()</h3>
jpayne@68 746 <pre class="programlisting"><span class="returnvalue">void</span>
jpayne@68 747 cairo_user_font_face_set_text_to_glyphs_func
jpayne@68 748 (<em class="parameter"><code><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a> *font_face</code></em>,
jpayne@68 749 <em class="parameter"><code><a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-text-to-glyphs-func-t" title="cairo_user_scaled_font_text_to_glyphs_func_t ()"><span class="type">cairo_user_scaled_font_text_to_glyphs_func_t</span></a> text_to_glyphs_func</code></em>);</pre>
jpayne@68 750 <p>Sets th text-to-glyphs conversion function of a user-font.
jpayne@68 751 See <a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-text-to-glyphs-func-t" title="cairo_user_scaled_font_text_to_glyphs_func_t ()"><span class="type">cairo_user_scaled_font_text_to_glyphs_func_t</span></a> for details of how the callback
jpayne@68 752 works.</p>
jpayne@68 753 <p>The font-face should not be immutable or a <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-USER-FONT-IMMUTABLE:CAPS"><code class="literal">CAIRO_STATUS_USER_FONT_IMMUTABLE</code></a>
jpayne@68 754 error will occur. A user font-face is immutable as soon as a scaled-font
jpayne@68 755 is created from it.</p>
jpayne@68 756 <div class="refsect3">
jpayne@68 757 <a name="cairo-user-font-face-set-text-to-glyphs-func.parameters"></a><h4>Parameters</h4>
jpayne@68 758 <div class="informaltable"><table class="informaltable" width="100%" border="0">
jpayne@68 759 <colgroup>
jpayne@68 760 <col width="150px" class="parameters_name">
jpayne@68 761 <col class="parameters_description">
jpayne@68 762 <col width="200px" class="parameters_annotations">
jpayne@68 763 </colgroup>
jpayne@68 764 <tbody>
jpayne@68 765 <tr>
jpayne@68 766 <td class="parameter_name"><p>font_face</p></td>
jpayne@68 767 <td class="parameter_description"><p>A user font face</p></td>
jpayne@68 768 <td class="parameter_annotations"> </td>
jpayne@68 769 </tr>
jpayne@68 770 <tr>
jpayne@68 771 <td class="parameter_name"><p>text_to_glyphs_func</p></td>
jpayne@68 772 <td class="parameter_description"><p>The text_to_glyphs callback, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
jpayne@68 773 <td class="parameter_annotations"> </td>
jpayne@68 774 </tr>
jpayne@68 775 </tbody>
jpayne@68 776 </table></div>
jpayne@68 777 </div>
jpayne@68 778 <p class="since">Since: 1.8</p>
jpayne@68 779 </div>
jpayne@68 780 <hr>
jpayne@68 781 <div class="refsect2">
jpayne@68 782 <a name="cairo-user-font-face-get-text-to-glyphs-func"></a><h3>cairo_user_font_face_get_text_to_glyphs_func ()</h3>
jpayne@68 783 <pre class="programlisting"><a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-text-to-glyphs-func-t" title="cairo_user_scaled_font_text_to_glyphs_func_t ()"><span class="returnvalue">cairo_user_scaled_font_text_to_glyphs_func_t</span></a>
jpayne@68 784 cairo_user_font_face_get_text_to_glyphs_func
jpayne@68 785 (<em class="parameter"><code><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a> *font_face</code></em>);</pre>
jpayne@68 786 <p>Gets the text-to-glyphs conversion function of a user-font.</p>
jpayne@68 787 <div class="refsect3">
jpayne@68 788 <a name="cairo-user-font-face-get-text-to-glyphs-func.parameters"></a><h4>Parameters</h4>
jpayne@68 789 <div class="informaltable"><table class="informaltable" width="100%" border="0">
jpayne@68 790 <colgroup>
jpayne@68 791 <col width="150px" class="parameters_name">
jpayne@68 792 <col class="parameters_description">
jpayne@68 793 <col width="200px" class="parameters_annotations">
jpayne@68 794 </colgroup>
jpayne@68 795 <tbody><tr>
jpayne@68 796 <td class="parameter_name"><p>font_face</p></td>
jpayne@68 797 <td class="parameter_description"><p>A user font face</p></td>
jpayne@68 798 <td class="parameter_annotations"> </td>
jpayne@68 799 </tr></tbody>
jpayne@68 800 </table></div>
jpayne@68 801 </div>
jpayne@68 802 <div class="refsect3">
jpayne@68 803 <a name="cairo-user-font-face-get-text-to-glyphs-func.returns"></a><h4>Returns</h4>
jpayne@68 804 <p> The text_to_glyphs callback of <em class="parameter"><code>font_face</code></em>
jpayne@68 805 or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if none set or an error occurred.</p>
jpayne@68 806 </div>
jpayne@68 807 <p class="since">Since: 1.8</p>
jpayne@68 808 </div>
jpayne@68 809 </div>
jpayne@68 810 <div class="refsect1">
jpayne@68 811 <a name="cairo-User-Fonts.other_details"></a><h2>Types and Values</h2>
jpayne@68 812 <div class="refsect2">
jpayne@68 813 <a name="CAIRO-HAS-USER-FONT:CAPS"></a><h3>CAIRO_HAS_USER_FONT</h3>
jpayne@68 814 <pre class="programlisting">#define CAIRO_HAS_USER_FONT 1
jpayne@68 815 </pre>
jpayne@68 816 <p>Defined if the user font backend is available.
jpayne@68 817 This macro can be used to conditionally compile backend-specific code.
jpayne@68 818 The user font backend is always built in versions of cairo that support
jpayne@68 819 this feature (1.8 and later).</p>
jpayne@68 820 <p class="since">Since: 1.8</p>
jpayne@68 821 </div>
jpayne@68 822 </div>
jpayne@68 823 </div>
jpayne@68 824 <div class="footer">
jpayne@68 825 <hr>Generated by GTK-Doc V1.27</div>
jpayne@68 826 </body>
jpayne@68 827 </html>