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