Imported Upstream version 8.2.2
[platform/upstream/harfbuzz.git] / docs / html / harfbuzz-hb-cairo.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>hb-cairo: HarfBuzz Manual</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="index.html" title="HarfBuzz Manual">
8 <link rel="up" href="integration-api.html" title="Integration API">
9 <link rel="prev" href="harfbuzz-hb-directwrite.html" title="hb-directwrite">
10 <link rel="next" href="style-api.html" title="Style API">
11 <meta name="generator" content="GTK-Doc V1.32 (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="#harfbuzz-hb-cairo.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="integration-api.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
22 <td><a accesskey="p" href="harfbuzz-hb-directwrite.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
23 <td><a accesskey="n" href="style-api.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="harfbuzz-hb-cairo"></a><div class="titlepage"></div>
27 <div class="refnamediv"><table width="100%"><tr>
28 <td valign="top">
29 <h2><span class="refentrytitle"><a name="harfbuzz-hb-cairo.top_of_page"></a>hb-cairo</span></h2>
30 <p>hb-cairo — Cairo integration</p>
31 </td>
32 <td class="gallery_image" valign="top" align="right"></td>
33 </tr></table></div>
34 <div class="refsect1">
35 <a name="harfbuzz-hb-cairo.functions"></a><h2>Functions</h2>
36 <div class="informaltable"><table class="informaltable" width="100%" border="0">
37 <colgroup>
38 <col width="150px" class="functions_proto_type">
39 <col class="functions_proto_name">
40 </colgroup>
41 <tbody>
42 <tr>
43 <td class="function_type">
44 <span class="returnvalue">cairo_font_face_t</span> *
45 </td>
46 <td class="function_name">
47 <a class="link" href="harfbuzz-hb-cairo.html#hb-cairo-font-face-create-for-font" title="hb_cairo_font_face_create_for_font ()">hb_cairo_font_face_create_for_font</a> <span class="c_punctuation">()</span>
48 </td>
49 </tr>
50 <tr>
51 <td class="function_type">
52 <a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="returnvalue">hb_font_t</span></a> *
53 </td>
54 <td class="function_name">
55 <a class="link" href="harfbuzz-hb-cairo.html#hb-cairo-font-face-get-font" title="hb_cairo_font_face_get_font ()">hb_cairo_font_face_get_font</a> <span class="c_punctuation">()</span>
56 </td>
57 </tr>
58 <tr>
59 <td class="function_type">
60 <span class="returnvalue">cairo_font_face_t</span> *
61 </td>
62 <td class="function_name">
63 <a class="link" href="harfbuzz-hb-cairo.html#hb-cairo-font-face-create-for-face" title="hb_cairo_font_face_create_for_face ()">hb_cairo_font_face_create_for_face</a> <span class="c_punctuation">()</span>
64 </td>
65 </tr>
66 <tr>
67 <td class="function_type">
68 <a class="link" href="harfbuzz-hb-face.html#hb-face-t" title="hb_face_t"><span class="returnvalue">hb_face_t</span></a> *
69 </td>
70 <td class="function_name">
71 <a class="link" href="harfbuzz-hb-cairo.html#hb-cairo-font-face-get-face" title="hb_cairo_font_face_get_face ()">hb_cairo_font_face_get_face</a> <span class="c_punctuation">()</span>
72 </td>
73 </tr>
74 <tr>
75 <td class="function_type">
76 <a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="returnvalue">hb_font_t</span></a> *
77 </td>
78 <td class="function_name">
79 <span class="c_punctuation">(</span><a class="link" href="harfbuzz-hb-cairo.html#hb-cairo-font-init-func-t" title="hb_cairo_font_init_func_t ()">*hb_cairo_font_init_func_t</a><span class="c_punctuation">)</span> <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="harfbuzz-hb-cairo.html#hb-cairo-font-face-set-font-init-func" title="hb_cairo_font_face_set_font_init_func ()">hb_cairo_font_face_set_font_init_func</a> <span class="c_punctuation">()</span>
88 </td>
89 </tr>
90 <tr>
91 <td class="function_type">
92 <a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="returnvalue">hb_font_t</span></a> *
93 </td>
94 <td class="function_name">
95 <a class="link" href="harfbuzz-hb-cairo.html#hb-cairo-scaled-font-get-font" title="hb_cairo_scaled_font_get_font ()">hb_cairo_scaled_font_get_font</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="harfbuzz-hb-cairo.html#hb-cairo-font-face-set-scale-factor" title="hb_cairo_font_face_set_scale_factor ()">hb_cairo_font_face_set_scale_factor</a> <span class="c_punctuation">()</span>
104 </td>
105 </tr>
106 <tr>
107 <td class="function_type">unsigned <span class="returnvalue">int</span>
108 </td>
109 <td class="function_name">
110 <a class="link" href="harfbuzz-hb-cairo.html#hb-cairo-font-face-get-scale-factor" title="hb_cairo_font_face_get_scale_factor ()">hb_cairo_font_face_get_scale_factor</a> <span class="c_punctuation">()</span>
111 </td>
112 </tr>
113 <tr>
114 <td class="function_type">
115 <span class="returnvalue">void</span>
116 </td>
117 <td class="function_name">
118 <a class="link" href="harfbuzz-hb-cairo.html#hb-cairo-glyphs-from-buffer" title="hb_cairo_glyphs_from_buffer ()">hb_cairo_glyphs_from_buffer</a> <span class="c_punctuation">()</span>
119 </td>
120 </tr>
121 </tbody>
122 </table></div>
123 </div>
124 <div class="refsect1">
125 <a name="harfbuzz-hb-cairo.includes"></a><h2>Includes</h2>
126 <pre class="synopsis">#include &lt;hb-cairo.h&gt;
127 </pre>
128 </div>
129 <div class="refsect1">
130 <a name="harfbuzz-hb-cairo.description"></a><h2>Description</h2>
131 <p>Functions for using HarfBuzz with the cairo library.</p>
132 <p>HarfBuzz supports using cairo for rendering.</p>
133 </div>
134 <div class="refsect1">
135 <a name="harfbuzz-hb-cairo.functions_details"></a><h2>Functions</h2>
136 <div class="refsect2">
137 <a name="hb-cairo-font-face-create-for-font"></a><h3>hb_cairo_font_face_create_for_font ()</h3>
138 <pre class="programlisting"><span class="returnvalue">cairo_font_face_t</span> *
139 hb_cairo_font_face_create_for_font (<em class="parameter"><code><a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="type">hb_font_t</span></a> *font</code></em>);</pre>
140 <p>Creates a <span class="type">cairo_font_face_t</span> for rendering text according
141 to <em class="parameter"><code>font</code></em>
142 .</p>
143 <p>Note that the scale of <em class="parameter"><code>font</code></em>
144  does not affect the rendering,
145 but the variations and slant that are set on <em class="parameter"><code>font</code></em>
146  do.</p>
147 <div class="refsect3">
148 <a name="hb-cairo-font-face-create-for-font.parameters"></a><h4>Parameters</h4>
149 <div class="informaltable"><table class="informaltable" width="100%" border="0">
150 <colgroup>
151 <col width="150px" class="parameters_name">
152 <col class="parameters_description">
153 <col width="200px" class="parameters_annotations">
154 </colgroup>
155 <tbody><tr>
156 <td class="parameter_name"><p>font</p></td>
157 <td class="parameter_description"><p>a <a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="type">hb_font_t</span></a></p></td>
158 <td class="parameter_annotations"> </td>
159 </tr></tbody>
160 </table></div>
161 </div>
162 <div class="refsect3">
163 <a name="hb-cairo-font-face-create-for-font.returns"></a><h4>Returns</h4>
164 <p>a newly created <span class="type">cairo_font_face_t</span>. </p>
165 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
166 </div>
167 <p class="since">Since: <a class="link" href="api-index-7-0-0.html#api-index-7.0.0">7.0.0</a></p>
168 </div>
169 <hr>
170 <div class="refsect2">
171 <a name="hb-cairo-font-face-get-font"></a><h3>hb_cairo_font_face_get_font ()</h3>
172 <pre class="programlisting"><a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="returnvalue">hb_font_t</span></a> *
173 hb_cairo_font_face_get_font (<em class="parameter"><code><span class="type">cairo_font_face_t</span> *font_face</code></em>);</pre>
174 <p>Gets the <a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="type">hb_font_t</span></a> that <em class="parameter"><code>font_face</code></em>
175  was created from.</p>
176 <div class="refsect3">
177 <a name="hb-cairo-font-face-get-font.parameters"></a><h4>Parameters</h4>
178 <div class="informaltable"><table class="informaltable" width="100%" border="0">
179 <colgroup>
180 <col width="150px" class="parameters_name">
181 <col class="parameters_description">
182 <col width="200px" class="parameters_annotations">
183 </colgroup>
184 <tbody><tr>
185 <td class="parameter_name"><p>font_face</p></td>
186 <td class="parameter_description"><p>a <span class="type">cairo_font_face_t</span></p></td>
187 <td class="parameter_annotations"> </td>
188 </tr></tbody>
189 </table></div>
190 </div>
191 <div class="refsect3">
192 <a name="hb-cairo-font-face-get-font.returns"></a><h4>Returns</h4>
193 <p>the <a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="type">hb_font_t</span></a> that <em class="parameter"><code>font_face</code></em>
194 was created from. </p>
195 <p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
196 </div>
197 <p class="since">Since: <a class="link" href="api-index-7-0-0.html#api-index-7.0.0">7.0.0</a></p>
198 </div>
199 <hr>
200 <div class="refsect2">
201 <a name="hb-cairo-font-face-create-for-face"></a><h3>hb_cairo_font_face_create_for_face ()</h3>
202 <pre class="programlisting"><span class="returnvalue">cairo_font_face_t</span> *
203 hb_cairo_font_face_create_for_face (<em class="parameter"><code><a class="link" href="harfbuzz-hb-face.html#hb-face-t" title="hb_face_t"><span class="type">hb_face_t</span></a> *face</code></em>);</pre>
204 <p>Creates a <span class="type">cairo_font_face_t</span> for rendering text according
205 to <em class="parameter"><code>face</code></em>
206 .</p>
207 <div class="refsect3">
208 <a name="hb-cairo-font-face-create-for-face.parameters"></a><h4>Parameters</h4>
209 <div class="informaltable"><table class="informaltable" width="100%" border="0">
210 <colgroup>
211 <col width="150px" class="parameters_name">
212 <col class="parameters_description">
213 <col width="200px" class="parameters_annotations">
214 </colgroup>
215 <tbody><tr>
216 <td class="parameter_name"><p>face</p></td>
217 <td class="parameter_description"><p>a <a class="link" href="harfbuzz-hb-face.html#hb-face-t" title="hb_face_t"><span class="type">hb_face_t</span></a></p></td>
218 <td class="parameter_annotations"> </td>
219 </tr></tbody>
220 </table></div>
221 </div>
222 <div class="refsect3">
223 <a name="hb-cairo-font-face-create-for-face.returns"></a><h4>Returns</h4>
224 <p>a newly created <span class="type">cairo_font_face_t</span>. </p>
225 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
226 </div>
227 <p class="since">Since: <a class="link" href="api-index-7-0-0.html#api-index-7.0.0">7.0.0</a></p>
228 </div>
229 <hr>
230 <div class="refsect2">
231 <a name="hb-cairo-font-face-get-face"></a><h3>hb_cairo_font_face_get_face ()</h3>
232 <pre class="programlisting"><a class="link" href="harfbuzz-hb-face.html#hb-face-t" title="hb_face_t"><span class="returnvalue">hb_face_t</span></a> *
233 hb_cairo_font_face_get_face (<em class="parameter"><code><span class="type">cairo_font_face_t</span> *font_face</code></em>);</pre>
234 <p>Gets the <a class="link" href="harfbuzz-hb-face.html#hb-face-t" title="hb_face_t"><span class="type">hb_face_t</span></a> associated with <em class="parameter"><code>font_face</code></em>
235 .</p>
236 <div class="refsect3">
237 <a name="hb-cairo-font-face-get-face.parameters"></a><h4>Parameters</h4>
238 <div class="informaltable"><table class="informaltable" width="100%" border="0">
239 <colgroup>
240 <col width="150px" class="parameters_name">
241 <col class="parameters_description">
242 <col width="200px" class="parameters_annotations">
243 </colgroup>
244 <tbody><tr>
245 <td class="parameter_name"><p>font_face</p></td>
246 <td class="parameter_description"><p>a <span class="type">cairo_font_face_t</span></p></td>
247 <td class="parameter_annotations"> </td>
248 </tr></tbody>
249 </table></div>
250 </div>
251 <div class="refsect3">
252 <a name="hb-cairo-font-face-get-face.returns"></a><h4>Returns</h4>
253 <p>the <a class="link" href="harfbuzz-hb-face.html#hb-face-t" title="hb_face_t"><span class="type">hb_face_t</span></a> associated with <em class="parameter"><code>font_face</code></em>
254 . </p>
255 <p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
256 </div>
257 <p class="since">Since: <a class="link" href="api-index-7-0-0.html#api-index-7.0.0">7.0.0</a></p>
258 </div>
259 <hr>
260 <div class="refsect2">
261 <a name="hb-cairo-font-init-func-t"></a><h3>hb_cairo_font_init_func_t ()</h3>
262 <pre class="programlisting"><a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="returnvalue">hb_font_t</span></a> *
263 <span class="c_punctuation">(</span>*hb_cairo_font_init_func_t<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="type">hb_font_t</span></a> *font</code></em>,
264                               <em class="parameter"><code><span class="type">cairo_scaled_font_t</span> *scaled_font</code></em>,
265                               <em class="parameter"><code><span class="type">void</span> *user_data</code></em>);</pre>
266 <p>The type of a virtual method to be called when a cairo
267 face created using <a class="link" href="harfbuzz-hb-cairo.html#hb-cairo-font-face-create-for-face" title="hb_cairo_font_face_create_for_face ()"><code class="function">hb_cairo_font_face_create_for_face()</code></a>
268 creates an <a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="type">hb_font_t</span></a> for a <span class="type">cairo_scaled_font_t</span>.</p>
269 <div class="refsect3">
270 <a name="hb-cairo-font-init-func-t.parameters"></a><h4>Parameters</h4>
271 <div class="informaltable"><table class="informaltable" width="100%" border="0">
272 <colgroup>
273 <col width="150px" class="parameters_name">
274 <col class="parameters_description">
275 <col width="200px" class="parameters_annotations">
276 </colgroup>
277 <tbody>
278 <tr>
279 <td class="parameter_name"><p>font</p></td>
280 <td class="parameter_description"><p>The <a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="type">hb_font_t</span></a> being created</p></td>
281 <td class="parameter_annotations"> </td>
282 </tr>
283 <tr>
284 <td class="parameter_name"><p>scaled_font</p></td>
285 <td class="parameter_description"><p>The respective <span class="type">cairo_scaled_font_t</span></p></td>
286 <td class="parameter_annotations"> </td>
287 </tr>
288 <tr>
289 <td class="parameter_name"><p>user_data</p></td>
290 <td class="parameter_description"><p>User data accompanying this method</p></td>
291 <td class="parameter_annotations"> </td>
292 </tr>
293 </tbody>
294 </table></div>
295 </div>
296 <div class="refsect3">
297 <a name="hb-cairo-font-init-func-t.returns"></a><h4>Returns</h4>
298 <p> the <a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="type">hb_font_t</span></a> value to use; in most cases same as <em class="parameter"><code>font</code></em>
299 </p>
300 </div>
301 <p class="since">Since: <a class="link" href="api-index-7-0-0.html#api-index-7.0.0">7.0.0</a></p>
302 </div>
303 <hr>
304 <div class="refsect2">
305 <a name="hb-cairo-font-face-set-font-init-func"></a><h3>hb_cairo_font_face_set_font_init_func ()</h3>
306 <pre class="programlisting"><span class="returnvalue">void</span>
307 hb_cairo_font_face_set_font_init_func (<em class="parameter"><code><span class="type">cairo_font_face_t</span> *font_face</code></em>,
308                                        <em class="parameter"><code><a class="link" href="harfbuzz-hb-cairo.html#hb-cairo-font-init-func-t" title="hb_cairo_font_init_func_t ()"><span class="type">hb_cairo_font_init_func_t</span></a> func</code></em>,
309                                        <em class="parameter"><code><span class="type">void</span> *user_data</code></em>,
310                                        <em class="parameter"><code><a class="link" href="harfbuzz-hb-common.html#hb-destroy-func-t" title="hb_destroy_func_t ()"><span class="type">hb_destroy_func_t</span></a> destroy</code></em>);</pre>
311 <p>Set the virtual method to be called when a cairo
312 face created using <a class="link" href="harfbuzz-hb-cairo.html#hb-cairo-font-face-create-for-face" title="hb_cairo_font_face_create_for_face ()"><code class="function">hb_cairo_font_face_create_for_face()</code></a>
313 creates an <a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="type">hb_font_t</span></a> for a <span class="type">cairo_scaled_font_t</span>.</p>
314 <div class="refsect3">
315 <a name="hb-cairo-font-face-set-font-init-func.parameters"></a><h4>Parameters</h4>
316 <div class="informaltable"><table class="informaltable" width="100%" border="0">
317 <colgroup>
318 <col width="150px" class="parameters_name">
319 <col class="parameters_description">
320 <col width="200px" class="parameters_annotations">
321 </colgroup>
322 <tbody>
323 <tr>
324 <td class="parameter_name"><p>font_face</p></td>
325 <td class="parameter_description"><p>a <span class="type">cairo_font_face_t</span></p></td>
326 <td class="parameter_annotations"> </td>
327 </tr>
328 <tr>
329 <td class="parameter_name"><p>func</p></td>
330 <td class="parameter_description"><p>The virtual method to use</p></td>
331 <td class="parameter_annotations"> </td>
332 </tr>
333 <tr>
334 <td class="parameter_name"><p>user_data</p></td>
335 <td class="parameter_description"><p>user data accompanying the method</p></td>
336 <td class="parameter_annotations"> </td>
337 </tr>
338 <tr>
339 <td class="parameter_name"><p>destroy</p></td>
340 <td class="parameter_description"><p>function to call when <em class="parameter"><code>user_data</code></em>
341 is not needed anymore</p></td>
342 <td class="parameter_annotations"> </td>
343 </tr>
344 </tbody>
345 </table></div>
346 </div>
347 <p class="since">Since: <a class="link" href="api-index-7-0-0.html#api-index-7.0.0">7.0.0</a></p>
348 </div>
349 <hr>
350 <div class="refsect2">
351 <a name="hb-cairo-scaled-font-get-font"></a><h3>hb_cairo_scaled_font_get_font ()</h3>
352 <pre class="programlisting"><a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="returnvalue">hb_font_t</span></a> *
353 hb_cairo_scaled_font_get_font (<em class="parameter"><code><span class="type">cairo_scaled_font_t</span> *scaled_font</code></em>);</pre>
354 <p>Gets the <a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="type">hb_font_t</span></a> associated with <em class="parameter"><code>scaled_font</code></em>
355 .</p>
356 <div class="refsect3">
357 <a name="hb-cairo-scaled-font-get-font.parameters"></a><h4>Parameters</h4>
358 <div class="informaltable"><table class="informaltable" width="100%" border="0">
359 <colgroup>
360 <col width="150px" class="parameters_name">
361 <col class="parameters_description">
362 <col width="200px" class="parameters_annotations">
363 </colgroup>
364 <tbody><tr>
365 <td class="parameter_name"><p>scaled_font</p></td>
366 <td class="parameter_description"><p>a <span class="type">cairo_scaled_font_t</span></p></td>
367 <td class="parameter_annotations"> </td>
368 </tr></tbody>
369 </table></div>
370 </div>
371 <div class="refsect3">
372 <a name="hb-cairo-scaled-font-get-font.returns"></a><h4>Returns</h4>
373 <p>the <a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="type">hb_font_t</span></a> associated with <em class="parameter"><code>scaled_font</code></em>
374 . </p>
375 <p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
376 </div>
377 <p class="since">Since: <a class="link" href="api-index-7-0-0.html#api-index-7.0.0">7.0.0</a></p>
378 </div>
379 <hr>
380 <div class="refsect2">
381 <a name="hb-cairo-font-face-set-scale-factor"></a><h3>hb_cairo_font_face_set_scale_factor ()</h3>
382 <pre class="programlisting"><span class="returnvalue">void</span>
383 hb_cairo_font_face_set_scale_factor (<em class="parameter"><code><span class="type">cairo_font_face_t</span> *font_face</code></em>,
384                                      <em class="parameter"><code>unsigned <span class="type">int</span> scale_factor</code></em>);</pre>
385 <p>Sets the scale factor of the <em class="parameter"><code>font_face</code></em>
386 . Default scale
387 factor is zero.</p>
388 <p>When a <span class="type">cairo_font_face_t</span> is created from a <a class="link" href="harfbuzz-hb-face.html#hb-face-t" title="hb_face_t"><span class="type">hb_face_t</span></a> using
389 <a class="link" href="harfbuzz-hb-cairo.html#hb-cairo-font-face-create-for-face" title="hb_cairo_font_face_create_for_face ()"><code class="function">hb_cairo_font_face_create_for_face()</code></a>, such face will create
390 <a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="type">hb_font_t</span></a> objects during scaled-font creation.  The scale
391 factor defines how the scale set on such <a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="type">hb_font_t</span></a> objects
392 relates to the font-matrix (as such font size) of the cairo
393 scaled-font.</p>
394 <p>If the scale-factor is zero (default), then the scale of the
395 <a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="type">hb_font_t</span></a> object will be left at default, which is the UPEM
396 value of the respective <a class="link" href="harfbuzz-hb-face.html#hb-face-t" title="hb_face_t"><span class="type">hb_face_t</span></a>.</p>
397 <p>If the scale-factor is set to non-zero, then the X and Y scale
398 of the <a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="type">hb_font_t</span></a> object will be respectively set to the
399 <em class="parameter"><code>scale_factor</code></em>
400  times the xx and yy elements of the scale-matrix
401 of the cairo scaled-font being created.</p>
402 <p>When using the <a class="link" href="harfbuzz-hb-cairo.html#hb-cairo-glyphs-from-buffer" title="hb_cairo_glyphs_from_buffer ()"><code class="function">hb_cairo_glyphs_from_buffer()</code></a> API to convert the
403 HarfBuzz glyph buffer that resulted from shaping with such a <a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="type">hb_font_t</span></a>,
404 if the scale-factor was non-zero, you can pass it directly to
405 that API as both X and Y scale factors.</p>
406 <p>If the scale-factor was zero however, or the cairo face was
407 created using the alternative constructor
408 <a class="link" href="harfbuzz-hb-cairo.html#hb-cairo-font-face-create-for-font" title="hb_cairo_font_face_create_for_font ()"><code class="function">hb_cairo_font_face_create_for_font()</code></a>, you need to calculate the
409 correct X/Y scale-factors to pass to <a class="link" href="harfbuzz-hb-cairo.html#hb-cairo-glyphs-from-buffer" title="hb_cairo_glyphs_from_buffer ()"><code class="function">hb_cairo_glyphs_from_buffer()</code></a>
410 by dividing the <a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="type">hb_font_t</span></a> X/Y scale-factors by the
411 cairo scaled-font's scale-matrix XX/YY components respectively
412 and use those values.  Or if you know that relationship offhand
413 (because you set the scale of the <a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="type">hb_font_t</span></a> yourself), use
414 the conversion rate involved.</p>
415 <div class="refsect3">
416 <a name="hb-cairo-font-face-set-scale-factor.parameters"></a><h4>Parameters</h4>
417 <div class="informaltable"><table class="informaltable" width="100%" border="0">
418 <colgroup>
419 <col width="150px" class="parameters_name">
420 <col class="parameters_description">
421 <col width="200px" class="parameters_annotations">
422 </colgroup>
423 <tbody>
424 <tr>
425 <td class="parameter_name"><p>scale_factor</p></td>
426 <td class="parameter_description"><p>The scale factor to use. See below</p></td>
427 <td class="parameter_annotations"> </td>
428 </tr>
429 <tr>
430 <td class="parameter_name"><p>font_face</p></td>
431 <td class="parameter_description"><p>a <span class="type">cairo_font_face_t</span></p></td>
432 <td class="parameter_annotations"> </td>
433 </tr>
434 </tbody>
435 </table></div>
436 </div>
437 <p class="since">Since: <a class="link" href="api-index-7-0-0.html#api-index-7.0.0">7.0.0</a></p>
438 </div>
439 <hr>
440 <div class="refsect2">
441 <a name="hb-cairo-font-face-get-scale-factor"></a><h3>hb_cairo_font_face_get_scale_factor ()</h3>
442 <pre class="programlisting">unsigned <span class="returnvalue">int</span>
443 hb_cairo_font_face_get_scale_factor (<em class="parameter"><code><span class="type">cairo_font_face_t</span> *font_face</code></em>);</pre>
444 <p>Gets the scale factor set on the <em class="parameter"><code>font_face</code></em>
445 . Defaults to zero.
446 See <a class="link" href="harfbuzz-hb-cairo.html#hb-cairo-font-face-set-scale-factor" title="hb_cairo_font_face_set_scale_factor ()"><code class="function">hb_cairo_font_face_set_scale_factor()</code></a> for details.</p>
447 <div class="refsect3">
448 <a name="hb-cairo-font-face-get-scale-factor.parameters"></a><h4>Parameters</h4>
449 <div class="informaltable"><table class="informaltable" width="100%" border="0">
450 <colgroup>
451 <col width="150px" class="parameters_name">
452 <col class="parameters_description">
453 <col width="200px" class="parameters_annotations">
454 </colgroup>
455 <tbody><tr>
456 <td class="parameter_name"><p>font_face</p></td>
457 <td class="parameter_description"><p>a <span class="type">cairo_font_face_t</span></p></td>
458 <td class="parameter_annotations"> </td>
459 </tr></tbody>
460 </table></div>
461 </div>
462 <div class="refsect3">
463 <a name="hb-cairo-font-face-get-scale-factor.returns"></a><h4>Returns</h4>
464 <p> the scale factor of <em class="parameter"><code>font_face</code></em>
465 </p>
466 </div>
467 <p class="since">Since: <a class="link" href="api-index-7-0-0.html#api-index-7.0.0">7.0.0</a></p>
468 </div>
469 <hr>
470 <div class="refsect2">
471 <a name="hb-cairo-glyphs-from-buffer"></a><h3>hb_cairo_glyphs_from_buffer ()</h3>
472 <pre class="programlisting"><span class="returnvalue">void</span>
473 hb_cairo_glyphs_from_buffer (<em class="parameter"><code><a class="link" href="harfbuzz-hb-buffer.html#hb-buffer-t" title="hb_buffer_t"><span class="type">hb_buffer_t</span></a> *buffer</code></em>,
474                              <em class="parameter"><code><a class="link" href="harfbuzz-hb-common.html#hb-bool-t" title="hb_bool_t"><span class="type">hb_bool_t</span></a> utf8_clusters</code></em>,
475                              <em class="parameter"><code><span class="type">double</span> x_scale_factor</code></em>,
476                              <em class="parameter"><code><span class="type">double</span> y_scale_factor</code></em>,
477                              <em class="parameter"><code><span class="type">double</span> x</code></em>,
478                              <em class="parameter"><code><span class="type">double</span> y</code></em>,
479                              <em class="parameter"><code>const <span class="type">char</span> *utf8</code></em>,
480                              <em class="parameter"><code><span class="type">int</span> utf8_len</code></em>,
481                              <em class="parameter"><code><span class="type">cairo_glyph_t</span> **glyphs</code></em>,
482                              <em class="parameter"><code>unsigned <span class="type">int</span> *num_glyphs</code></em>,
483                              <em class="parameter"><code><span class="type">cairo_text_cluster_t</span> **clusters</code></em>,
484                              <em class="parameter"><code>unsigned <span class="type">int</span> *num_clusters</code></em>,
485                              <em class="parameter"><code><span class="type">cairo_text_cluster_flags_t</span> *cluster_flags</code></em>);</pre>
486 <p>Extracts information from <em class="parameter"><code>buffer</code></em>
487  in a form that can be
488 passed to <code class="function">cairo_show_text_glyphs()</code> or <code class="function">cairo_show_glyphs()</code>.
489 This API is modeled after <code class="function">cairo_scaled_font_text_to_glyphs()</code> and
490 cairo_user_scaled_font_text_to_glyphs_func_t.</p>
491 <p>The <em class="parameter"><code>num_glyphs</code></em>
492  argument should be preset to the number of glyph entries available
493 in the <em class="parameter"><code>glyphs</code></em>
494  buffer. If the <em class="parameter"><code>glyphs</code></em>
495  buffer is <code class="literal">NULL</code>, the value of
496 <em class="parameter"><code>num_glyphs</code></em>
497  must be zero.  If the provided glyph array is too short for
498 the conversion (or for convenience), a new glyph array may be allocated
499 using <code class="function">cairo_glyph_allocate()</code> and placed in <em class="parameter"><code>glyphs</code></em>
500 .  Upon return,
501 <em class="parameter"><code>num_glyphs</code></em>
502  should contain the number of generated glyphs.  If the value
503 <em class="parameter"><code>glyphs</code></em>
504  points at has changed after the call, the caller will free the
505 allocated glyph array using <code class="function">cairo_glyph_free()</code>.  The caller will also free
506 the original value of <em class="parameter"><code>glyphs</code></em>
507 , so this function shouldn't do so.</p>
508 <p>If <em class="parameter"><code>clusters</code></em>
509  is not <code class="literal">NULL</code>, then <em class="parameter"><code>num_clusters</code></em>
510  and <em class="parameter"><code>cluster_flags</code></em>
511
512 should not be either, and <em class="parameter"><code>utf8</code></em>
513  must be provided, and cluster
514 mapping will be computed. The semantics of how
515 cluster array allocation works is similar to the glyph array.  That is,
516 if <em class="parameter"><code>clusters</code></em>
517  initially points to a non-<code class="literal">NULL</code> value, that array may be used
518 as a cluster buffer, and <em class="parameter"><code>num_clusters</code></em>
519  points to the number of cluster
520 entries available there.  If the provided cluster array is too short for
521 the conversion (or for convenience), a new cluster array may be allocated
522 using <code class="function">cairo_text_cluster_allocate()</code> and placed in <em class="parameter"><code>clusters</code></em>
523 .  In this case,
524 the original value of <em class="parameter"><code>clusters</code></em>
525  will still be freed by the caller.  Upon
526 return, <em class="parameter"><code>num_clusters</code></em>
527  will contain the number of generated clusters.
528 If the value <em class="parameter"><code>clusters</code></em>
529  points at has changed after the call, the caller
530 will free the allocated cluster array using <code class="function">cairo_text_cluster_free()</code>.</p>
531 <p>See <a class="link" href="harfbuzz-hb-cairo.html#hb-cairo-font-face-set-scale-factor" title="hb_cairo_font_face_set_scale_factor ()"><code class="function">hb_cairo_font_face_set_scale_factor()</code></a> for the details of
532 the <em class="parameter"><code>scale_factor</code></em>
533  argument.</p>
534 <p>The returned <em class="parameter"><code>glyphs</code></em>
535  vector actually has <code class="literal">@num_glyphs + 1</code> entries in
536 it and the x,y values of the extra entry at the end add up the advance
537 x,y of all the glyphs in the <em class="parameter"><code>buffer</code></em>
538 .</p>
539 <div class="refsect3">
540 <a name="hb-cairo-glyphs-from-buffer.parameters"></a><h4>Parameters</h4>
541 <div class="informaltable"><table class="informaltable" width="100%" border="0">
542 <colgroup>
543 <col width="150px" class="parameters_name">
544 <col class="parameters_description">
545 <col width="200px" class="parameters_annotations">
546 </colgroup>
547 <tbody>
548 <tr>
549 <td class="parameter_name"><p>buffer</p></td>
550 <td class="parameter_description"><p>a <a class="link" href="harfbuzz-hb-buffer.html#hb-buffer-t" title="hb_buffer_t"><span class="type">hb_buffer_t</span></a> containing glyphs</p></td>
551 <td class="parameter_annotations"> </td>
552 </tr>
553 <tr>
554 <td class="parameter_name"><p>utf8_clusters</p></td>
555 <td class="parameter_description"><p><code class="literal">true</code> if <em class="parameter"><code>buffer</code></em>
556 clusters are in bytes, instead of characters</p></td>
557 <td class="parameter_annotations"> </td>
558 </tr>
559 <tr>
560 <td class="parameter_name"><p>x_scale_factor</p></td>
561 <td class="parameter_description"><p>scale factor to divide <a class="link" href="harfbuzz-hb-common.html#hb-position-t" title="hb_position_t"><span class="type">hb_position_t</span></a> Y values by</p></td>
562 <td class="parameter_annotations"> </td>
563 </tr>
564 <tr>
565 <td class="parameter_name"><p>y_scale_factor</p></td>
566 <td class="parameter_description"><p>scale factor to divide <a class="link" href="harfbuzz-hb-common.html#hb-position-t" title="hb_position_t"><span class="type">hb_position_t</span></a> X values by</p></td>
567 <td class="parameter_annotations"> </td>
568 </tr>
569 <tr>
570 <td class="parameter_name"><p>x</p></td>
571 <td class="parameter_description"><p>X position to place first glyph</p></td>
572 <td class="parameter_annotations"> </td>
573 </tr>
574 <tr>
575 <td class="parameter_name"><p>y</p></td>
576 <td class="parameter_description"><p>Y position to place first glyph</p></td>
577 <td class="parameter_annotations"> </td>
578 </tr>
579 <tr>
580 <td class="parameter_name"><p>utf8</p></td>
581 <td class="parameter_description"><p>the text that was shaped in <em class="parameter"><code>buffer</code></em>
582 . </p></td>
583 <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
584 </tr>
585 <tr>
586 <td class="parameter_name"><p>utf8_len</p></td>
587 <td class="parameter_description"><p>the length of <em class="parameter"><code>utf8</code></em>
588 in bytes</p></td>
589 <td class="parameter_annotations"> </td>
590 </tr>
591 <tr>
592 <td class="parameter_name"><p>glyphs</p></td>
593 <td class="parameter_description"><p>return location for an array of <span class="type">cairo_glyph_t</span>. </p></td>
594 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
595 </tr>
596 <tr>
597 <td class="parameter_name"><p>num_glyphs</p></td>
598 <td class="parameter_description"><p>return location for the length of <em class="parameter"><code>glyphs</code></em>
599 . </p></td>
600 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>]</span></td>
601 </tr>
602 <tr>
603 <td class="parameter_name"><p>clusters</p></td>
604 <td class="parameter_description"><p>return location for an array of cluster positions. </p></td>
605 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
606 </tr>
607 <tr>
608 <td class="parameter_name"><p>num_clusters</p></td>
609 <td class="parameter_description"><p>return location for the length of <em class="parameter"><code>clusters</code></em>
610 . </p></td>
611 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
612 </tr>
613 <tr>
614 <td class="parameter_name"><p>cluster_flags</p></td>
615 <td class="parameter_description"><p>return location for cluster flags. </p></td>
616 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
617 </tr>
618 </tbody>
619 </table></div>
620 </div>
621 <p class="since">Since: <a class="link" href="api-index-7-0-0.html#api-index-7.0.0">7.0.0</a></p>
622 </div>
623 </div>
624 </div>
625 <div class="footer">
626 <hr>Generated by GTK-Doc V1.32</div>
627 </body>
628 </html>