1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>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">
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>
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>
25 <div class="refentry">
26 <a name="harfbuzz-hb-cairo"></a><div class="titlepage"></div>
27 <div class="refnamediv"><table width="100%"><tr>
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>
32 <td class="gallery_image" valign="top" align="right"></td>
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">
38 <col width="150px" class="functions_proto_type">
39 <col class="functions_proto_name">
43 <td class="function_type">
44 <span class="returnvalue">cairo_font_face_t</span> *
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>
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> *
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>
59 <td class="function_type">
60 <span class="returnvalue">cairo_font_face_t</span> *
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>
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> *
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>
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> *
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>
83 <td class="function_type">
84 <span class="returnvalue">void</span>
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>
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> *
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>
99 <td class="function_type">
100 <span class="returnvalue">void</span>
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>
107 <td class="function_type">unsigned <span class="returnvalue">int</span>
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>
114 <td class="function_type">
115 <span class="returnvalue">void</span>
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>
124 <div class="refsect1">
125 <a name="harfbuzz-hb-cairo.includes"></a><h2>Includes</h2>
126 <pre class="synopsis">#include <hb-cairo.h>
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>
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>
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>
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">
151 <col width="150px" class="parameters_name">
152 <col class="parameters_description">
153 <col width="200px" class="parameters_annotations">
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>
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>
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>
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">
180 <col width="150px" class="parameters_name">
181 <col class="parameters_description">
182 <col width="200px" class="parameters_annotations">
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>
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>
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>
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>
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">
211 <col width="150px" class="parameters_name">
212 <col class="parameters_description">
213 <col width="200px" class="parameters_annotations">
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>
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>
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>
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>
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">
240 <col width="150px" class="parameters_name">
241 <col class="parameters_description">
242 <col width="200px" class="parameters_annotations">
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>
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>
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>
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>
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">
273 <col width="150px" class="parameters_name">
274 <col class="parameters_description">
275 <col width="200px" class="parameters_annotations">
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>
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>
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>
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>
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>
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">
318 <col width="150px" class="parameters_name">
319 <col class="parameters_description">
320 <col width="200px" class="parameters_annotations">
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>
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>
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>
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>
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>
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>
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">
360 <col width="150px" class="parameters_name">
361 <col class="parameters_description">
362 <col width="200px" class="parameters_annotations">
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>
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>
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>
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>
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>
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
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">
419 <col width="150px" class="parameters_name">
420 <col class="parameters_description">
421 <col width="200px" class="parameters_annotations">
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>
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>
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>
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>
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">
451 <col width="150px" class="parameters_name">
452 <col class="parameters_description">
453 <col width="200px" class="parameters_annotations">
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>
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>
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>
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>
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>
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>
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>
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>
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">
543 <col width="150px" class="parameters_name">
544 <col class="parameters_description">
545 <col width="200px" class="parameters_annotations">
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>
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>
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>
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>
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>
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>
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>
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>
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>
589 <td class="parameter_annotations"> </td>
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>
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>
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>
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>
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>
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>
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>
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>
626 <hr>Generated by GTK-Doc V1.32</div>