Fixed broken patch
[platform/upstream/harfbuzz.git] / docs / html / harfbuzz-hb-ot-color.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-ot-color: HarfBuzz Manual</title>
6 <meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
7 <link rel="home" href="index.html" title="HarfBuzz Manual">
8 <link rel="up" href="ch13.html" title="OpenType API">
9 <link rel="prev" href="ch13.html" title="OpenType API">
10 <link rel="next" href="harfbuzz-hb-ot-font.html" title="hb-ot-font">
11 <meta name="generator" content="GTK-Doc V1.32.1 (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-ot-color.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="ch13.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
22 <td><a accesskey="p" href="ch13.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
23 <td><a accesskey="n" href="harfbuzz-hb-ot-font.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-ot-color"></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-ot-color.top_of_page"></a>hb-ot-color</span></h2>
30 <p>hb-ot-color — OpenType Color Fonts</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-ot-color.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="define_keyword">#define</td>
44 <td class="function_name">
45 <a class="link" href="harfbuzz-hb-ot-color.html#HB-COLOR:CAPS" title="HB_COLOR()">HB_COLOR</a><span class="c_punctuation">()</span>
46 </td>
47 </tr>
48 <tr>
49 <td class="function_type">
50 <span class="returnvalue">uint8_t</span>
51 </td>
52 <td class="function_name">
53 <a class="link" href="harfbuzz-hb-ot-color.html#hb-color-get-alpha" title="hb_color_get_alpha ()">hb_color_get_alpha</a> <span class="c_punctuation">()</span>
54 </td>
55 </tr>
56 <tr>
57 <td class="function_type">
58 <span class="returnvalue">uint8_t</span>
59 </td>
60 <td class="function_name">
61 <a class="link" href="harfbuzz-hb-ot-color.html#hb-color-get-blue" title="hb_color_get_blue ()">hb_color_get_blue</a> <span class="c_punctuation">()</span>
62 </td>
63 </tr>
64 <tr>
65 <td class="function_type">
66 <span class="returnvalue">uint8_t</span>
67 </td>
68 <td class="function_name">
69 <a class="link" href="harfbuzz-hb-ot-color.html#hb-color-get-green" title="hb_color_get_green ()">hb_color_get_green</a> <span class="c_punctuation">()</span>
70 </td>
71 </tr>
72 <tr>
73 <td class="function_type">
74 <span class="returnvalue">uint8_t</span>
75 </td>
76 <td class="function_name">
77 <a class="link" href="harfbuzz-hb-ot-color.html#hb-color-get-red" title="hb_color_get_red ()">hb_color_get_red</a> <span class="c_punctuation">()</span>
78 </td>
79 </tr>
80 <tr>
81 <td class="function_type">unsigned <span class="returnvalue">int</span>
82 </td>
83 <td class="function_name">
84 <a class="link" href="harfbuzz-hb-ot-color.html#hb-ot-color-glyph-get-layers" title="hb_ot_color_glyph_get_layers ()">hb_ot_color_glyph_get_layers</a> <span class="c_punctuation">()</span>
85 </td>
86 </tr>
87 <tr>
88 <td class="function_type">
89 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-t" title="hb_blob_t"><span class="returnvalue">hb_blob_t</span></a> *
90 </td>
91 <td class="function_name">
92 <a class="link" href="harfbuzz-hb-ot-color.html#hb-ot-color-glyph-reference-png" title="hb_ot_color_glyph_reference_png ()">hb_ot_color_glyph_reference_png</a> <span class="c_punctuation">()</span>
93 </td>
94 </tr>
95 <tr>
96 <td class="function_type">
97 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-t" title="hb_blob_t"><span class="returnvalue">hb_blob_t</span></a> *
98 </td>
99 <td class="function_name">
100 <a class="link" href="harfbuzz-hb-ot-color.html#hb-ot-color-glyph-reference-svg" title="hb_ot_color_glyph_reference_svg ()">hb_ot_color_glyph_reference_svg</a> <span class="c_punctuation">()</span>
101 </td>
102 </tr>
103 <tr>
104 <td class="function_type">
105 <a class="link" href="harfbuzz-hb-common.html#hb-bool-t" title="hb_bool_t"><span class="returnvalue">hb_bool_t</span></a>
106 </td>
107 <td class="function_name">
108 <a class="link" href="harfbuzz-hb-ot-color.html#hb-ot-color-has-layers" title="hb_ot_color_has_layers ()">hb_ot_color_has_layers</a> <span class="c_punctuation">()</span>
109 </td>
110 </tr>
111 <tr>
112 <td class="function_type">
113 <a class="link" href="harfbuzz-hb-common.html#hb-bool-t" title="hb_bool_t"><span class="returnvalue">hb_bool_t</span></a>
114 </td>
115 <td class="function_name">
116 <a class="link" href="harfbuzz-hb-ot-color.html#hb-ot-color-has-palettes" title="hb_ot_color_has_palettes ()">hb_ot_color_has_palettes</a> <span class="c_punctuation">()</span>
117 </td>
118 </tr>
119 <tr>
120 <td class="function_type">
121 <a class="link" href="harfbuzz-hb-common.html#hb-bool-t" title="hb_bool_t"><span class="returnvalue">hb_bool_t</span></a>
122 </td>
123 <td class="function_name">
124 <a class="link" href="harfbuzz-hb-ot-color.html#hb-ot-color-has-png" title="hb_ot_color_has_png ()">hb_ot_color_has_png</a> <span class="c_punctuation">()</span>
125 </td>
126 </tr>
127 <tr>
128 <td class="function_type">
129 <a class="link" href="harfbuzz-hb-common.html#hb-bool-t" title="hb_bool_t"><span class="returnvalue">hb_bool_t</span></a>
130 </td>
131 <td class="function_name">
132 <a class="link" href="harfbuzz-hb-ot-color.html#hb-ot-color-has-svg" title="hb_ot_color_has_svg ()">hb_ot_color_has_svg</a> <span class="c_punctuation">()</span>
133 </td>
134 </tr>
135 <tr>
136 <td class="function_type">
137 <a class="link" href="harfbuzz-hb-ot-name.html#hb-ot-name-id-t" title="hb_ot_name_id_t"><span class="returnvalue">hb_ot_name_id_t</span></a>
138 </td>
139 <td class="function_name">
140 <a class="link" href="harfbuzz-hb-ot-color.html#hb-ot-color-palette-color-get-name-id" title="hb_ot_color_palette_color_get_name_id ()">hb_ot_color_palette_color_get_name_id</a> <span class="c_punctuation">()</span>
141 </td>
142 </tr>
143 <tr>
144 <td class="function_type">unsigned <span class="returnvalue">int</span>
145 </td>
146 <td class="function_name">
147 <a class="link" href="harfbuzz-hb-ot-color.html#hb-ot-color-palette-get-colors" title="hb_ot_color_palette_get_colors ()">hb_ot_color_palette_get_colors</a> <span class="c_punctuation">()</span>
148 </td>
149 </tr>
150 <tr>
151 <td class="function_type">unsigned <span class="returnvalue">int</span>
152 </td>
153 <td class="function_name">
154 <a class="link" href="harfbuzz-hb-ot-color.html#hb-ot-color-palette-get-count" title="hb_ot_color_palette_get_count ()">hb_ot_color_palette_get_count</a> <span class="c_punctuation">()</span>
155 </td>
156 </tr>
157 <tr>
158 <td class="function_type">
159 <a class="link" href="harfbuzz-hb-ot-color.html#hb-ot-color-palette-flags-t" title="enum hb_ot_color_palette_flags_t"><span class="returnvalue">hb_ot_color_palette_flags_t</span></a>
160 </td>
161 <td class="function_name">
162 <a class="link" href="harfbuzz-hb-ot-color.html#hb-ot-color-palette-get-flags" title="hb_ot_color_palette_get_flags ()">hb_ot_color_palette_get_flags</a> <span class="c_punctuation">()</span>
163 </td>
164 </tr>
165 <tr>
166 <td class="function_type">
167 <a class="link" href="harfbuzz-hb-ot-name.html#hb-ot-name-id-t" title="hb_ot_name_id_t"><span class="returnvalue">hb_ot_name_id_t</span></a>
168 </td>
169 <td class="function_name">
170 <a class="link" href="harfbuzz-hb-ot-color.html#hb-ot-color-palette-get-name-id" title="hb_ot_color_palette_get_name_id ()">hb_ot_color_palette_get_name_id</a> <span class="c_punctuation">()</span>
171 </td>
172 </tr>
173 </tbody>
174 </table></div>
175 </div>
176 <div class="refsect1">
177 <a name="harfbuzz-hb-ot-color.other"></a><h2>Types and Values</h2>
178 <div class="informaltable"><table class="informaltable" width="100%" border="0">
179 <colgroup>
180 <col width="150px" class="other_proto_type">
181 <col class="other_proto_name">
182 </colgroup>
183 <tbody>
184 <tr>
185 <td class="typedef_keyword">typedef</td>
186 <td class="function_name"><a class="link" href="harfbuzz-hb-ot-color.html#hb-color-t" title="hb_color_t">hb_color_t</a></td>
187 </tr>
188 <tr>
189 <td class="datatype_keyword">enum</td>
190 <td class="function_name"><a class="link" href="harfbuzz-hb-ot-color.html#hb-ot-color-palette-flags-t" title="enum hb_ot_color_palette_flags_t">hb_ot_color_palette_flags_t</a></td>
191 </tr>
192 </tbody>
193 </table></div>
194 </div>
195 <div class="refsect1">
196 <a name="harfbuzz-hb-ot-color.includes"></a><h2>Includes</h2>
197 <pre class="synopsis">#include &lt;hb-ot.h&gt;
198 </pre>
199 </div>
200 <div class="refsect1">
201 <a name="harfbuzz-hb-ot-color.description"></a><h2>Description</h2>
202 <p>Functions for fetching color-font information from OpenType font faces.</p>
203 <p>HarfBuzz supports <code class="literal">COLR</code>/<code class="literal">CPAL</code>, <code class="literal">sbix</code>, <code class="literal">CBDT</code>, and <code class="literal">SVG</code> color fonts.</p>
204 </div>
205 <div class="refsect1">
206 <a name="harfbuzz-hb-ot-color.functions_details"></a><h2>Functions</h2>
207 <div class="refsect2">
208 <a name="HB-COLOR:CAPS"></a><h3>HB_COLOR()</h3>
209 <pre class="programlisting">#define HB_COLOR(b,g,r,a) ((hb_color_t) HB_TAG ((b),(g),(r),(a)))
210 </pre>
211 </div>
212 <hr>
213 <div class="refsect2">
214 <a name="hb-color-get-alpha"></a><h3>hb_color_get_alpha ()</h3>
215 <pre class="programlisting"><span class="returnvalue">uint8_t</span>
216 hb_color_get_alpha (<em class="parameter"><code><a class="link" href="harfbuzz-hb-ot-color.html#hb-color-t" title="hb_color_t"><span class="type">hb_color_t</span></a> color</code></em>);</pre>
217 <div class="refsect3">
218 <a name="hb-color-get-alpha.returns"></a><h4>Returns</h4>
219 <p> Alpha channel value of the given color</p>
220 </div>
221 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
222 </div>
223 <hr>
224 <div class="refsect2">
225 <a name="hb-color-get-blue"></a><h3>hb_color_get_blue ()</h3>
226 <pre class="programlisting"><span class="returnvalue">uint8_t</span>
227 hb_color_get_blue (<em class="parameter"><code><a class="link" href="harfbuzz-hb-ot-color.html#hb-color-t" title="hb_color_t"><span class="type">hb_color_t</span></a> color</code></em>);</pre>
228 <div class="refsect3">
229 <a name="hb-color-get-blue.returns"></a><h4>Returns</h4>
230 <p> Blue channel value of the given color</p>
231 </div>
232 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
233 </div>
234 <hr>
235 <div class="refsect2">
236 <a name="hb-color-get-green"></a><h3>hb_color_get_green ()</h3>
237 <pre class="programlisting"><span class="returnvalue">uint8_t</span>
238 hb_color_get_green (<em class="parameter"><code><a class="link" href="harfbuzz-hb-ot-color.html#hb-color-t" title="hb_color_t"><span class="type">hb_color_t</span></a> color</code></em>);</pre>
239 <div class="refsect3">
240 <a name="hb-color-get-green.returns"></a><h4>Returns</h4>
241 <p> Green channel value of the given color</p>
242 </div>
243 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
244 </div>
245 <hr>
246 <div class="refsect2">
247 <a name="hb-color-get-red"></a><h3>hb_color_get_red ()</h3>
248 <pre class="programlisting"><span class="returnvalue">uint8_t</span>
249 hb_color_get_red (<em class="parameter"><code><a class="link" href="harfbuzz-hb-ot-color.html#hb-color-t" title="hb_color_t"><span class="type">hb_color_t</span></a> color</code></em>);</pre>
250 <div class="refsect3">
251 <a name="hb-color-get-red.returns"></a><h4>Returns</h4>
252 <p> Red channel value of the given color</p>
253 </div>
254 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
255 </div>
256 <hr>
257 <div class="refsect2">
258 <a name="hb-ot-color-glyph-get-layers"></a><h3>hb_ot_color_glyph_get_layers ()</h3>
259 <pre class="programlisting">unsigned <span class="returnvalue">int</span>
260 hb_ot_color_glyph_get_layers (<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>,
261                               <em class="parameter"><code><a class="link" href="harfbuzz-hb-common.html#hb-codepoint-t" title="hb_codepoint_t"><span class="type">hb_codepoint_t</span></a> glyph</code></em>,
262                               <em class="parameter"><code>unsigned <span class="type">int</span> start_offset</code></em>,
263                               <em class="parameter"><code>unsigned <span class="type">int</span> *layer_count</code></em>,
264                               <em class="parameter"><code><span class="type">hb_ot_color_layer_t</span> *layers</code></em>);</pre>
265 <p>Fetches a list of all color layers for the specified glyph index in the specified
266 face. The list returned will begin at the offset provided.</p>
267 <div class="refsect3">
268 <a name="hb-ot-color-glyph-get-layers.parameters"></a><h4>Parameters</h4>
269 <div class="informaltable"><table class="informaltable" width="100%" border="0">
270 <colgroup>
271 <col width="150px" class="parameters_name">
272 <col class="parameters_description">
273 <col width="200px" class="parameters_annotations">
274 </colgroup>
275 <tbody>
276 <tr>
277 <td class="parameter_name"><p>face</p></td>
278 <td class="parameter_description"><p><a class="link" href="harfbuzz-hb-face.html#hb-face-t" title="hb_face_t"><span class="type">hb_face_t</span></a> to work upon</p></td>
279 <td class="parameter_annotations"> </td>
280 </tr>
281 <tr>
282 <td class="parameter_name"><p>glyph</p></td>
283 <td class="parameter_description"><p>The glyph index to query</p></td>
284 <td class="parameter_annotations"> </td>
285 </tr>
286 <tr>
287 <td class="parameter_name"><p>start_offset</p></td>
288 <td class="parameter_description"><p>offset of the first layer to retrieve</p></td>
289 <td class="parameter_annotations"> </td>
290 </tr>
291 <tr>
292 <td class="parameter_name"><p>layer_count</p></td>
293 <td class="parameter_description"><p>Input = the maximum number of layers to return;
294 Output = the actual number of layers returned (may be zero). </p></td>
295 <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 instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td>
296 </tr>
297 <tr>
298 <td class="parameter_name"><p>layers</p></td>
299 <td class="parameter_description"><p>The array of layers found. </p></td>
300 <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="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=layer_count][<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>
301 </tr>
302 </tbody>
303 </table></div>
304 </div>
305 <div class="refsect3">
306 <a name="hb-ot-color-glyph-get-layers.returns"></a><h4>Returns</h4>
307 <p> Total number of layers available for the glyph index queried</p>
308 </div>
309 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
310 </div>
311 <hr>
312 <div class="refsect2">
313 <a name="hb-ot-color-glyph-reference-png"></a><h3>hb_ot_color_glyph_reference_png ()</h3>
314 <pre class="programlisting"><a class="link" href="harfbuzz-hb-blob.html#hb-blob-t" title="hb_blob_t"><span class="returnvalue">hb_blob_t</span></a> *
315 hb_ot_color_glyph_reference_png (<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>,
316                                  <em class="parameter"><code><a class="link" href="harfbuzz-hb-common.html#hb-codepoint-t" title="hb_codepoint_t"><span class="type">hb_codepoint_t</span></a> glyph</code></em>);</pre>
317 <p>Fetches the PNG image for a glyph. This function takes a font object, not a face object,
318 as input. To get an optimally sized PNG blob, the UPEM value must be set on the <em class="parameter"><code>font</code></em>
319
320 object. If UPEM is unset, the blob returned will be the largest PNG available.</p>
321 <div class="refsect3">
322 <a name="hb-ot-color-glyph-reference-png.parameters"></a><h4>Parameters</h4>
323 <div class="informaltable"><table class="informaltable" width="100%" border="0">
324 <colgroup>
325 <col width="150px" class="parameters_name">
326 <col class="parameters_description">
327 <col width="200px" class="parameters_annotations">
328 </colgroup>
329 <tbody>
330 <tr>
331 <td class="parameter_name"><p>font</p></td>
332 <td class="parameter_description"><p><a class="link" href="harfbuzz-hb-font.html#hb-font-t" title="hb_font_t"><span class="type">hb_font_t</span></a> to work upon</p></td>
333 <td class="parameter_annotations"> </td>
334 </tr>
335 <tr>
336 <td class="parameter_name"><p>glyph</p></td>
337 <td class="parameter_description"><p>a glyph index</p></td>
338 <td class="parameter_annotations"> </td>
339 </tr>
340 </tbody>
341 </table></div>
342 </div>
343 <div class="refsect3">
344 <a name="hb-ot-color-glyph-reference-png.returns"></a><h4>Returns</h4>
345 <p>An <a class="link" href="harfbuzz-hb-blob.html#hb-blob-t" title="hb_blob_t"><span class="type">hb_blob_t</span></a> containing the PNG image for the glyph, if available. </p>
346 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
347 </div>
348 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
349 </div>
350 <hr>
351 <div class="refsect2">
352 <a name="hb-ot-color-glyph-reference-svg"></a><h3>hb_ot_color_glyph_reference_svg ()</h3>
353 <pre class="programlisting"><a class="link" href="harfbuzz-hb-blob.html#hb-blob-t" title="hb_blob_t"><span class="returnvalue">hb_blob_t</span></a> *
354 hb_ot_color_glyph_reference_svg (<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>,
355                                  <em class="parameter"><code><a class="link" href="harfbuzz-hb-common.html#hb-codepoint-t" title="hb_codepoint_t"><span class="type">hb_codepoint_t</span></a> glyph</code></em>);</pre>
356 <p>Fetches the SVG document for a glyph. The blob may be either plain text or gzip-encoded.</p>
357 <div class="refsect3">
358 <a name="hb-ot-color-glyph-reference-svg.parameters"></a><h4>Parameters</h4>
359 <div class="informaltable"><table class="informaltable" width="100%" border="0">
360 <colgroup>
361 <col width="150px" class="parameters_name">
362 <col class="parameters_description">
363 <col width="200px" class="parameters_annotations">
364 </colgroup>
365 <tbody>
366 <tr>
367 <td class="parameter_name"><p>face</p></td>
368 <td class="parameter_description"><p><a class="link" href="harfbuzz-hb-face.html#hb-face-t" title="hb_face_t"><span class="type">hb_face_t</span></a> to work upon</p></td>
369 <td class="parameter_annotations"> </td>
370 </tr>
371 <tr>
372 <td class="parameter_name"><p>glyph</p></td>
373 <td class="parameter_description"><p>a svg glyph index</p></td>
374 <td class="parameter_annotations"> </td>
375 </tr>
376 </tbody>
377 </table></div>
378 </div>
379 <div class="refsect3">
380 <a name="hb-ot-color-glyph-reference-svg.returns"></a><h4>Returns</h4>
381 <p>An <a class="link" href="harfbuzz-hb-blob.html#hb-blob-t" title="hb_blob_t"><span class="type">hb_blob_t</span></a> containing the SVG document of the glyph, if available. </p>
382 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
383 </div>
384 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
385 </div>
386 <hr>
387 <div class="refsect2">
388 <a name="hb-ot-color-has-layers"></a><h3>hb_ot_color_has_layers ()</h3>
389 <pre class="programlisting"><a class="link" href="harfbuzz-hb-common.html#hb-bool-t" title="hb_bool_t"><span class="returnvalue">hb_bool_t</span></a>
390 hb_ot_color_has_layers (<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>
391 <p>Tests whether a face includes any <code class="literal">COLR</code> color layers.</p>
392 <div class="refsect3">
393 <a name="hb-ot-color-has-layers.parameters"></a><h4>Parameters</h4>
394 <div class="informaltable"><table class="informaltable" width="100%" border="0">
395 <colgroup>
396 <col width="150px" class="parameters_name">
397 <col class="parameters_description">
398 <col width="200px" class="parameters_annotations">
399 </colgroup>
400 <tbody><tr>
401 <td class="parameter_name"><p>face</p></td>
402 <td class="parameter_description"><p><a class="link" href="harfbuzz-hb-face.html#hb-face-t" title="hb_face_t"><span class="type">hb_face_t</span></a> to work upon</p></td>
403 <td class="parameter_annotations"> </td>
404 </tr></tbody>
405 </table></div>
406 </div>
407 <div class="refsect3">
408 <a name="hb-ot-color-has-layers.returns"></a><h4>Returns</h4>
409 <p> true if data found, false otherwise</p>
410 </div>
411 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
412 </div>
413 <hr>
414 <div class="refsect2">
415 <a name="hb-ot-color-has-palettes"></a><h3>hb_ot_color_has_palettes ()</h3>
416 <pre class="programlisting"><a class="link" href="harfbuzz-hb-common.html#hb-bool-t" title="hb_bool_t"><span class="returnvalue">hb_bool_t</span></a>
417 hb_ot_color_has_palettes (<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>
418 <p>Tests whether a face includes a <code class="literal">CPAL</code> color-palette table.</p>
419 <div class="refsect3">
420 <a name="hb-ot-color-has-palettes.parameters"></a><h4>Parameters</h4>
421 <div class="informaltable"><table class="informaltable" width="100%" border="0">
422 <colgroup>
423 <col width="150px" class="parameters_name">
424 <col class="parameters_description">
425 <col width="200px" class="parameters_annotations">
426 </colgroup>
427 <tbody><tr>
428 <td class="parameter_name"><p>face</p></td>
429 <td class="parameter_description"><p><a class="link" href="harfbuzz-hb-face.html#hb-face-t" title="hb_face_t"><span class="type">hb_face_t</span></a> to work upon</p></td>
430 <td class="parameter_annotations"> </td>
431 </tr></tbody>
432 </table></div>
433 </div>
434 <div class="refsect3">
435 <a name="hb-ot-color-has-palettes.returns"></a><h4>Returns</h4>
436 <p> true if data found, false otherwise</p>
437 </div>
438 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
439 </div>
440 <hr>
441 <div class="refsect2">
442 <a name="hb-ot-color-has-png"></a><h3>hb_ot_color_has_png ()</h3>
443 <pre class="programlisting"><a class="link" href="harfbuzz-hb-common.html#hb-bool-t" title="hb_bool_t"><span class="returnvalue">hb_bool_t</span></a>
444 hb_ot_color_has_png (<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>
445 <p>Tests whether a face has PNG glyph images (either in <code class="literal">CBDT</code> or <code class="literal">sbix</code> tables).</p>
446 <div class="refsect3">
447 <a name="hb-ot-color-has-png.parameters"></a><h4>Parameters</h4>
448 <div class="informaltable"><table class="informaltable" width="100%" border="0">
449 <colgroup>
450 <col width="150px" class="parameters_name">
451 <col class="parameters_description">
452 <col width="200px" class="parameters_annotations">
453 </colgroup>
454 <tbody><tr>
455 <td class="parameter_name"><p>face</p></td>
456 <td class="parameter_description"><p><a class="link" href="harfbuzz-hb-face.html#hb-face-t" title="hb_face_t"><span class="type">hb_face_t</span></a> to work upon</p></td>
457 <td class="parameter_annotations"> </td>
458 </tr></tbody>
459 </table></div>
460 </div>
461 <div class="refsect3">
462 <a name="hb-ot-color-has-png.returns"></a><h4>Returns</h4>
463 <p> true if data found, false otherwise</p>
464 </div>
465 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
466 </div>
467 <hr>
468 <div class="refsect2">
469 <a name="hb-ot-color-has-svg"></a><h3>hb_ot_color_has_svg ()</h3>
470 <pre class="programlisting"><a class="link" href="harfbuzz-hb-common.html#hb-bool-t" title="hb_bool_t"><span class="returnvalue">hb_bool_t</span></a>
471 hb_ot_color_has_svg (<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>
472 <p>Tests whether a face includes any <code class="literal">SVG</code> glyph images.</p>
473 <div class="refsect3">
474 <a name="hb-ot-color-has-svg.parameters"></a><h4>Parameters</h4>
475 <div class="informaltable"><table class="informaltable" width="100%" border="0">
476 <colgroup>
477 <col width="150px" class="parameters_name">
478 <col class="parameters_description">
479 <col width="200px" class="parameters_annotations">
480 </colgroup>
481 <tbody><tr>
482 <td class="parameter_name"><p>face</p></td>
483 <td class="parameter_description"><p><a class="link" href="harfbuzz-hb-face.html#hb-face-t" title="hb_face_t"><span class="type">hb_face_t</span></a> to work upon.</p></td>
484 <td class="parameter_annotations"> </td>
485 </tr></tbody>
486 </table></div>
487 </div>
488 <div class="refsect3">
489 <a name="hb-ot-color-has-svg.returns"></a><h4>Returns</h4>
490 <p> true if data found, false otherwise.</p>
491 </div>
492 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
493 </div>
494 <hr>
495 <div class="refsect2">
496 <a name="hb-ot-color-palette-color-get-name-id"></a><h3>hb_ot_color_palette_color_get_name_id ()</h3>
497 <pre class="programlisting"><a class="link" href="harfbuzz-hb-ot-name.html#hb-ot-name-id-t" title="hb_ot_name_id_t"><span class="returnvalue">hb_ot_name_id_t</span></a>
498 hb_ot_color_palette_color_get_name_id (<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>,
499                                        <em class="parameter"><code>unsigned <span class="type">int</span> color_index</code></em>);</pre>
500 <p>Fetches the <code class="literal">name</code> table Name ID that provides display names for
501 the specificed color in a face's <code class="literal">CPAL</code> color palette. </p>
502 <p>Display names can be generic (e.g., "Background") or specific
503 (e.g., "Eye color").</p>
504 <div class="refsect3">
505 <a name="hb-ot-color-palette-color-get-name-id.parameters"></a><h4>Parameters</h4>
506 <div class="informaltable"><table class="informaltable" width="100%" border="0">
507 <colgroup>
508 <col width="150px" class="parameters_name">
509 <col class="parameters_description">
510 <col width="200px" class="parameters_annotations">
511 </colgroup>
512 <tbody>
513 <tr>
514 <td class="parameter_name"><p>face</p></td>
515 <td class="parameter_description"><p><a class="link" href="harfbuzz-hb-face.html#hb-face-t" title="hb_face_t"><span class="type">hb_face_t</span></a> to work upon</p></td>
516 <td class="parameter_annotations"> </td>
517 </tr>
518 <tr>
519 <td class="parameter_name"><p>color_index</p></td>
520 <td class="parameter_description"><p>The index of the color</p></td>
521 <td class="parameter_annotations"> </td>
522 </tr>
523 </tbody>
524 </table></div>
525 </div>
526 <div class="refsect3">
527 <a name="hb-ot-color-palette-color-get-name-id.returns"></a><h4>Returns</h4>
528 <p> the Name ID found for the color.</p>
529 </div>
530 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
531 </div>
532 <hr>
533 <div class="refsect2">
534 <a name="hb-ot-color-palette-get-colors"></a><h3>hb_ot_color_palette_get_colors ()</h3>
535 <pre class="programlisting">unsigned <span class="returnvalue">int</span>
536 hb_ot_color_palette_get_colors (<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>,
537                                 <em class="parameter"><code>unsigned <span class="type">int</span> palette_index</code></em>,
538                                 <em class="parameter"><code>unsigned <span class="type">int</span> start_offset</code></em>,
539                                 <em class="parameter"><code>unsigned <span class="type">int</span> *color_count</code></em>,
540                                 <em class="parameter"><code><a class="link" href="harfbuzz-hb-ot-color.html#hb-color-t" title="hb_color_t"><span class="type">hb_color_t</span></a> *colors</code></em>);</pre>
541 <p>Fetches a list of the colors in a color palette.</p>
542 <p>After calling this function, <em class="parameter"><code>colors</code></em>
543  will be filled with the palette
544 colors. If <em class="parameter"><code>colors</code></em>
545  is NULL, the function will just return the number
546 of total colors without storing any actual colors; this can be used
547 for allocating a buffer of suitable size before calling
548 <a class="link" href="harfbuzz-hb-ot-color.html#hb-ot-color-palette-get-colors" title="hb_ot_color_palette_get_colors ()"><code class="function">hb_ot_color_palette_get_colors()</code></a> a second time.</p>
549 <div class="refsect3">
550 <a name="hb-ot-color-palette-get-colors.parameters"></a><h4>Parameters</h4>
551 <div class="informaltable"><table class="informaltable" width="100%" border="0">
552 <colgroup>
553 <col width="150px" class="parameters_name">
554 <col class="parameters_description">
555 <col width="200px" class="parameters_annotations">
556 </colgroup>
557 <tbody>
558 <tr>
559 <td class="parameter_name"><p>face</p></td>
560 <td class="parameter_description"><p><a class="link" href="harfbuzz-hb-face.html#hb-face-t" title="hb_face_t"><span class="type">hb_face_t</span></a> to work upon</p></td>
561 <td class="parameter_annotations"> </td>
562 </tr>
563 <tr>
564 <td class="parameter_name"><p>palette_index</p></td>
565 <td class="parameter_description"><p>the index of the color palette to query</p></td>
566 <td class="parameter_annotations"> </td>
567 </tr>
568 <tr>
569 <td class="parameter_name"><p>start_offset</p></td>
570 <td class="parameter_description"><p>offset of the first color to retrieve</p></td>
571 <td class="parameter_annotations"> </td>
572 </tr>
573 <tr>
574 <td class="parameter_name"><p>color_count</p></td>
575 <td class="parameter_description"><p>Input = the maximum number of colors to return;
576 Output = the actual number of colors returned (may be zero). </p></td>
577 <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 instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td>
578 </tr>
579 <tr>
580 <td class="parameter_name"><p>colors</p></td>
581 <td class="parameter_description"><p>The array of <a class="link" href="harfbuzz-hb-ot-color.html#hb-color-t" title="hb_color_t"><span class="type">hb_color_t</span></a> records found. </p></td>
582 <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="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=color_count][<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>
583 </tr>
584 </tbody>
585 </table></div>
586 </div>
587 <div class="refsect3">
588 <a name="hb-ot-color-palette-get-colors.returns"></a><h4>Returns</h4>
589 <p> the total number of colors in the palette</p>
590 </div>
591 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
592 </div>
593 <hr>
594 <div class="refsect2">
595 <a name="hb-ot-color-palette-get-count"></a><h3>hb_ot_color_palette_get_count ()</h3>
596 <pre class="programlisting">unsigned <span class="returnvalue">int</span>
597 hb_ot_color_palette_get_count (<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>
598 <p>Fetches the number of color palettes in a face.</p>
599 <div class="refsect3">
600 <a name="hb-ot-color-palette-get-count.parameters"></a><h4>Parameters</h4>
601 <div class="informaltable"><table class="informaltable" width="100%" border="0">
602 <colgroup>
603 <col width="150px" class="parameters_name">
604 <col class="parameters_description">
605 <col width="200px" class="parameters_annotations">
606 </colgroup>
607 <tbody><tr>
608 <td class="parameter_name"><p>face</p></td>
609 <td class="parameter_description"><p><a class="link" href="harfbuzz-hb-face.html#hb-face-t" title="hb_face_t"><span class="type">hb_face_t</span></a> to work upon</p></td>
610 <td class="parameter_annotations"> </td>
611 </tr></tbody>
612 </table></div>
613 </div>
614 <div class="refsect3">
615 <a name="hb-ot-color-palette-get-count.returns"></a><h4>Returns</h4>
616 <p> the number of palettes found</p>
617 </div>
618 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
619 </div>
620 <hr>
621 <div class="refsect2">
622 <a name="hb-ot-color-palette-get-flags"></a><h3>hb_ot_color_palette_get_flags ()</h3>
623 <pre class="programlisting"><a class="link" href="harfbuzz-hb-ot-color.html#hb-ot-color-palette-flags-t" title="enum hb_ot_color_palette_flags_t"><span class="returnvalue">hb_ot_color_palette_flags_t</span></a>
624 hb_ot_color_palette_get_flags (<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>,
625                                <em class="parameter"><code>unsigned <span class="type">int</span> palette_index</code></em>);</pre>
626 <p>Fetches the flags defined for a color palette.</p>
627 <div class="refsect3">
628 <a name="hb-ot-color-palette-get-flags.parameters"></a><h4>Parameters</h4>
629 <div class="informaltable"><table class="informaltable" width="100%" border="0">
630 <colgroup>
631 <col width="150px" class="parameters_name">
632 <col class="parameters_description">
633 <col width="200px" class="parameters_annotations">
634 </colgroup>
635 <tbody>
636 <tr>
637 <td class="parameter_name"><p>face</p></td>
638 <td class="parameter_description"><p><a class="link" href="harfbuzz-hb-face.html#hb-face-t" title="hb_face_t"><span class="type">hb_face_t</span></a> to work upon</p></td>
639 <td class="parameter_annotations"> </td>
640 </tr>
641 <tr>
642 <td class="parameter_name"><p>palette_index</p></td>
643 <td class="parameter_description"><p>The index of the color palette</p></td>
644 <td class="parameter_annotations"> </td>
645 </tr>
646 </tbody>
647 </table></div>
648 </div>
649 <div class="refsect3">
650 <a name="hb-ot-color-palette-get-flags.returns"></a><h4>Returns</h4>
651 <p> the <a class="link" href="harfbuzz-hb-ot-color.html#hb-ot-color-palette-flags-t" title="enum hb_ot_color_palette_flags_t"><span class="type">hb_ot_color_palette_flags_t</span></a> of the requested color palette</p>
652 </div>
653 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
654 </div>
655 <hr>
656 <div class="refsect2">
657 <a name="hb-ot-color-palette-get-name-id"></a><h3>hb_ot_color_palette_get_name_id ()</h3>
658 <pre class="programlisting"><a class="link" href="harfbuzz-hb-ot-name.html#hb-ot-name-id-t" title="hb_ot_name_id_t"><span class="returnvalue">hb_ot_name_id_t</span></a>
659 hb_ot_color_palette_get_name_id (<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>,
660                                  <em class="parameter"><code>unsigned <span class="type">int</span> palette_index</code></em>);</pre>
661 <p>Fetches the <code class="literal">name</code> table Name ID that provides display names for
662 a <code class="literal">CPAL</code> color palette. </p>
663 <p>Palette display names can be generic (e.g., "Default") or provide
664 specific, themed names (e.g., "Spring", "Summer", "Fall", and "Winter").</p>
665 <div class="refsect3">
666 <a name="hb-ot-color-palette-get-name-id.parameters"></a><h4>Parameters</h4>
667 <div class="informaltable"><table class="informaltable" width="100%" border="0">
668 <colgroup>
669 <col width="150px" class="parameters_name">
670 <col class="parameters_description">
671 <col width="200px" class="parameters_annotations">
672 </colgroup>
673 <tbody>
674 <tr>
675 <td class="parameter_name"><p>face</p></td>
676 <td class="parameter_description"><p><a class="link" href="harfbuzz-hb-face.html#hb-face-t" title="hb_face_t"><span class="type">hb_face_t</span></a> to work upon</p></td>
677 <td class="parameter_annotations"> </td>
678 </tr>
679 <tr>
680 <td class="parameter_name"><p>palette_index</p></td>
681 <td class="parameter_description"><p>The index of the color palette </p></td>
682 <td class="parameter_annotations"> </td>
683 </tr>
684 </tbody>
685 </table></div>
686 </div>
687 <div class="refsect3">
688 <a name="hb-ot-color-palette-get-name-id.returns"></a><h4>Returns</h4>
689 <p> the Named ID found for the palette.
690 If the requested palette has no name the result is <span class="type">HB_OT_NAME_ID_INVALID</span>.</p>
691 </div>
692 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
693 </div>
694 </div>
695 <div class="refsect1">
696 <a name="harfbuzz-hb-ot-color.other_details"></a><h2>Types and Values</h2>
697 <div class="refsect2">
698 <a name="hb-color-t"></a><h3>hb_color_t</h3>
699 <pre class="programlisting">typedef uint32_t hb_color_t;
700 </pre>
701 <p>Data type for holding color values.</p>
702 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
703 </div>
704 <hr>
705 <div class="refsect2">
706 <a name="hb-ot-color-palette-flags-t"></a><h3>enum hb_ot_color_palette_flags_t</h3>
707 <div class="refsect3">
708 <a name="hb-ot-color-palette-flags-t.members"></a><h4>Members</h4>
709 <div class="informaltable"><table class="informaltable" width="100%" border="0">
710 <colgroup>
711 <col width="300px" class="enum_members_name">
712 <col class="enum_members_description">
713 <col width="200px" class="enum_members_annotations">
714 </colgroup>
715 <tbody>
716 <tr>
717 <td class="enum_member_name"><p><a name="HB-OT-COLOR-PALETTE-FLAG-DEFAULT:CAPS"></a>HB_OT_COLOR_PALETTE_FLAG_DEFAULT</p></td>
718 <td class="enum_member_description">
719 <p>Default indicating that there is nothing special
720 to note about a color palette.</p>
721 </td>
722 <td class="enum_member_annotations"> </td>
723 </tr>
724 <tr>
725 <td class="enum_member_name"><p><a name="HB-OT-COLOR-PALETTE-FLAG-USABLE-WITH-LIGHT-BACKGROUND:CAPS"></a>HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_LIGHT_BACKGROUND</p></td>
726 <td class="enum_member_description">
727 <p>Flag indicating that the color
728 palette is appropriate to use when displaying the font on a light background such as white.</p>
729 </td>
730 <td class="enum_member_annotations"> </td>
731 </tr>
732 <tr>
733 <td class="enum_member_name"><p><a name="HB-OT-COLOR-PALETTE-FLAG-USABLE-WITH-DARK-BACKGROUND:CAPS"></a>HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_DARK_BACKGROUND</p></td>
734 <td class="enum_member_description">
735 <p>Flag indicating that the color
736 palette is appropriate to use when displaying the font on a dark background such as black.</p>
737 </td>
738 <td class="enum_member_annotations"> </td>
739 </tr>
740 </tbody>
741 </table></div>
742 </div>
743 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
744 </div>
745 </div>
746 </div>
747 <div class="footer">
748 <hr>Generated by GTK-Doc V1.32.1</div>
749 </body>
750 </html>