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-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="ch10.html" title="OpenType API">
9 <link rel="prev" href="ch10.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.29 (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-ot-color.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="ch10.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
22 <td><a accesskey="p" href="ch10.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>
25 <div class="refentry">
26 <a name="harfbuzz-hb-ot-color"></a><div class="titlepage"></div>
27 <div class="refnamediv"><table width="100%"><tr>
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>
32 <td class="gallery_image" valign="top" align="right"></td>
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">
38 <col width="150px" class="functions_return">
39 <col class="functions_name">
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>
49 <td class="define_keyword">#define</td>
50 <td class="function_name">
51 <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>
55 <td class="define_keyword">#define</td>
56 <td class="function_name">
57 <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>
61 <td class="define_keyword">#define</td>
62 <td class="function_name">
63 <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>
67 <td class="define_keyword">#define</td>
68 <td class="function_name">
69 <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>
73 <td class="function_type">unsigned <span class="returnvalue">int</span>
75 <td class="function_name">
76 <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>
80 <td class="function_type">
81 <a class="link" href="harfbuzz-hb-blob.html#hb-blob-t" title="hb_blob_t"><span class="returnvalue">hb_blob_t</span></a> *
83 <td class="function_name">
84 <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>
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> *
91 <td class="function_name">
92 <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>
96 <td class="function_type">
97 <a class="link" href="harfbuzz-hb-common.html#hb-bool-t" title="hb_bool_t"><span class="returnvalue">hb_bool_t</span></a>
99 <td class="function_name">
100 <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>
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>
107 <td class="function_name">
108 <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>
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>
115 <td class="function_name">
116 <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>
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>
123 <td class="function_name">
124 <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>
128 <td class="function_type">
129 <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>
131 <td class="function_name">
132 <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>
136 <td class="function_type">unsigned <span class="returnvalue">int</span>
138 <td class="function_name">
139 <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>
143 <td class="function_type">unsigned <span class="returnvalue">int</span>
145 <td class="function_name">
146 <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>
150 <td class="function_type">
151 <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>
153 <td class="function_name">
154 <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>
158 <td class="function_type">
159 <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>
161 <td class="function_name">
162 <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>
168 <div class="refsect1">
169 <a name="harfbuzz-hb-ot-color.other"></a><h2>Types and Values</h2>
170 <div class="informaltable"><table class="informaltable" width="100%" border="0">
172 <col width="150px" class="name">
173 <col class="description">
177 <td class="typedef_keyword">typedef</td>
178 <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>
181 <td class="datatype_keyword">enum</td>
182 <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>
187 <div class="refsect1">
188 <a name="harfbuzz-hb-ot-color.includes"></a><h2>Includes</h2>
189 <pre class="synopsis">#include <hb-ot.h>
192 <div class="refsect1">
193 <a name="harfbuzz-hb-ot-color.description"></a><h2>Description</h2>
194 <p>Functions for fetching color-font information from OpenType font faces.</p>
196 <div class="refsect1">
197 <a name="harfbuzz-hb-ot-color.functions_details"></a><h2>Functions</h2>
198 <div class="refsect2">
199 <a name="HB-COLOR:CAPS"></a><h3>HB_COLOR()</h3>
200 <pre class="programlisting">#define HB_COLOR(b,g,r,a) ((hb_color_t) HB_TAG ((b),(g),(r),(a)))
204 <div class="refsect2">
205 <a name="hb-color-get-alpha"></a><h3>hb_color_get_alpha()</h3>
206 <pre class="programlisting">#define hb_color_get_alpha(color) ((color) & 0xFF)
208 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
211 <div class="refsect2">
212 <a name="hb-color-get-blue"></a><h3>hb_color_get_blue()</h3>
213 <pre class="programlisting">#define hb_color_get_blue(color) (((color) >> 24) & 0xFF)
215 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
218 <div class="refsect2">
219 <a name="hb-color-get-green"></a><h3>hb_color_get_green()</h3>
220 <pre class="programlisting">#define hb_color_get_green(color) (((color) >> 16) & 0xFF)
222 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
225 <div class="refsect2">
226 <a name="hb-color-get-red"></a><h3>hb_color_get_red()</h3>
227 <pre class="programlisting">#define hb_color_get_red(color) (((color) >> 8) & 0xFF)
229 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
232 <div class="refsect2">
233 <a name="hb-ot-color-glyph-get-layers"></a><h3>hb_ot_color_glyph_get_layers ()</h3>
234 <pre class="programlisting">unsigned <span class="returnvalue">int</span>
235 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>,
236 <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>,
237 <em class="parameter"><code>unsigned <span class="type">int</span> start_offset</code></em>,
238 <em class="parameter"><code>unsigned <span class="type">int</span> *count</code></em>,
239 <em class="parameter"><code><span class="type">hb_ot_color_layer_t</span> *layers</code></em>);</pre>
240 <div class="refsect3">
241 <a name="hb-ot-color-glyph-get-layers.parameters"></a><h4>Parameters</h4>
242 <div class="informaltable"><table class="informaltable" width="100%" border="0">
244 <col width="150px" class="parameters_name">
245 <col class="parameters_description">
246 <col width="200px" class="parameters_annotations">
250 <td class="parameter_name"><p>face</p></td>
251 <td class="parameter_description"><p>a font face.</p></td>
252 <td class="parameter_annotations"> </td>
255 <td class="parameter_name"><p>glyph</p></td>
256 <td class="parameter_description"><p>a layered color glyph id.</p></td>
257 <td class="parameter_annotations"> </td>
260 <td class="parameter_name"><p>start_offset</p></td>
261 <td class="parameter_description"><p>starting offset of layers.</p></td>
262 <td class="parameter_annotations"> </td>
265 <td class="parameter_name"><p>count</p></td>
266 <td class="parameter_description"><p>gets number of layers available to be written on buffer
267 and returns number of written layers. </p></td>
268 <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>
271 <td class="parameter_name"><p>layers</p></td>
272 <td class="parameter_description"><p>layers buffer to buffer. </p></td>
273 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=count][<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td>
278 <div class="refsect3">
279 <a name="hb-ot-color-glyph-get-layers.returns"></a><h4>Returns</h4>
280 <p> Total number of layers a layered color glyph have.</p>
282 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
285 <div class="refsect2">
286 <a name="hb-ot-color-glyph-reference-png"></a><h3>hb_ot_color_glyph_reference_png ()</h3>
287 <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> *
288 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>,
289 <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>
290 <p>Get PNG image for a glyph.</p>
291 <div class="refsect3">
292 <a name="hb-ot-color-glyph-reference-png.parameters"></a><h4>Parameters</h4>
293 <div class="informaltable"><table class="informaltable" width="100%" border="0">
295 <col width="150px" class="parameters_name">
296 <col class="parameters_description">
297 <col width="200px" class="parameters_annotations">
301 <td class="parameter_name"><p>font</p></td>
302 <td class="parameter_description"><p>a font object, not face. upem should be set on
303 that font object if one wants to get optimal png blob, otherwise
304 return the biggest one</p></td>
305 <td class="parameter_annotations"> </td>
308 <td class="parameter_name"><p>glyph</p></td>
309 <td class="parameter_description"><p>a glyph index.</p></td>
310 <td class="parameter_annotations"> </td>
315 <div class="refsect3">
316 <a name="hb-ot-color-glyph-reference-png.returns"></a><h4>Returns</h4>
317 <p>respective PNG blob of the glyph, if available. </p>
318 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
320 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
323 <div class="refsect2">
324 <a name="hb-ot-color-glyph-reference-svg"></a><h3>hb_ot_color_glyph_reference_svg ()</h3>
325 <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> *
326 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>,
327 <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>
328 <p>Get SVG document for a glyph. The blob may be either plain text or gzip-encoded.</p>
329 <div class="refsect3">
330 <a name="hb-ot-color-glyph-reference-svg.parameters"></a><h4>Parameters</h4>
331 <div class="informaltable"><table class="informaltable" width="100%" border="0">
333 <col width="150px" class="parameters_name">
334 <col class="parameters_description">
335 <col width="200px" class="parameters_annotations">
339 <td class="parameter_name"><p>face</p></td>
340 <td class="parameter_description"><p>a font face.</p></td>
341 <td class="parameter_annotations"> </td>
344 <td class="parameter_name"><p>glyph</p></td>
345 <td class="parameter_description"><p>a svg glyph index.</p></td>
346 <td class="parameter_annotations"> </td>
351 <div class="refsect3">
352 <a name="hb-ot-color-glyph-reference-svg.returns"></a><h4>Returns</h4>
353 <p>respective svg blob of the glyph, if available. </p>
354 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
356 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
359 <div class="refsect2">
360 <a name="hb-ot-color-has-layers"></a><h3>hb_ot_color_has_layers ()</h3>
361 <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>
362 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>
363 <div class="refsect3">
364 <a name="hb-ot-color-has-layers.parameters"></a><h4>Parameters</h4>
365 <div class="informaltable"><table class="informaltable" width="100%" border="0">
367 <col width="150px" class="parameters_name">
368 <col class="parameters_description">
369 <col width="200px" class="parameters_annotations">
372 <td class="parameter_name"><p>face</p></td>
373 <td class="parameter_description"><p>a font face.</p></td>
374 <td class="parameter_annotations"> </td>
378 <div class="refsect3">
379 <a name="hb-ot-color-has-layers.returns"></a><h4>Returns</h4>
380 <p> whether COLR table is available.</p>
382 <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 class="refsect2">
386 <a name="hb-ot-color-has-palettes"></a><h3>hb_ot_color_has_palettes ()</h3>
387 <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>
388 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>
389 <div class="refsect3">
390 <a name="hb-ot-color-has-palettes.parameters"></a><h4>Parameters</h4>
391 <div class="informaltable"><table class="informaltable" width="100%" border="0">
393 <col width="150px" class="parameters_name">
394 <col class="parameters_description">
395 <col width="200px" class="parameters_annotations">
398 <td class="parameter_name"><p>face</p></td>
399 <td class="parameter_description"><p>a font face.</p></td>
400 <td class="parameter_annotations"> </td>
404 <div class="refsect3">
405 <a name="hb-ot-color-has-palettes.returns"></a><h4>Returns</h4>
406 <p> whether CPAL table is available.</p>
408 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
411 <div class="refsect2">
412 <a name="hb-ot-color-has-png"></a><h3>hb_ot_color_has_png ()</h3>
413 <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>
414 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>
415 <p>Check whether <em class="parameter"><code>face</code></em>
416 has PNG glyph images (either CBDT or sbix tables).</p>
417 <p>Returns true if available, false otherwise.</p>
418 <div class="refsect3">
419 <a name="hb-ot-color-has-png.parameters"></a><h4>Parameters</h4>
420 <div class="informaltable"><table class="informaltable" width="100%" border="0">
422 <col width="150px" class="parameters_name">
423 <col class="parameters_description">
424 <col width="200px" class="parameters_annotations">
427 <td class="parameter_name"><p>face</p></td>
428 <td class="parameter_description"><p>a font face.</p></td>
429 <td class="parameter_annotations"> </td>
433 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
436 <div class="refsect2">
437 <a name="hb-ot-color-has-svg"></a><h3>hb_ot_color_has_svg ()</h3>
438 <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>
439 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>
440 <p>Check whether <em class="parameter"><code>face</code></em>
441 has SVG glyph images.</p>
442 <p>Returns true if available, false otherwise.</p>
443 <div class="refsect3">
444 <a name="hb-ot-color-has-svg.parameters"></a><h4>Parameters</h4>
445 <div class="informaltable"><table class="informaltable" width="100%" border="0">
447 <col width="150px" class="parameters_name">
448 <col class="parameters_description">
449 <col width="200px" class="parameters_annotations">
452 <td class="parameter_name"><p>face</p></td>
453 <td class="parameter_description"><p>a font face.</p></td>
454 <td class="parameter_annotations"> </td>
458 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
461 <div class="refsect2">
462 <a name="hb-ot-color-palette-color-get-name-id"></a><h3>hb_ot_color_palette_color_get_name_id ()</h3>
463 <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>
464 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>,
465 <em class="parameter"><code>unsigned <span class="type">int</span> color_index</code></em>);</pre>
466 <div class="refsect3">
467 <a name="hb-ot-color-palette-color-get-name-id.parameters"></a><h4>Parameters</h4>
468 <div class="informaltable"><table class="informaltable" width="100%" border="0">
470 <col width="150px" class="parameters_name">
471 <col class="parameters_description">
472 <col width="200px" class="parameters_annotations">
476 <td class="parameter_name"><p>face</p></td>
477 <td class="parameter_description"><p>a font face.</p></td>
478 <td class="parameter_annotations"> </td>
481 <td class="parameter_name"><p>color_index</p></td>
482 <td class="parameter_description"><p>palette entry index.</p></td>
483 <td class="parameter_annotations"> </td>
488 <div class="refsect3">
489 <a name="hb-ot-color-palette-color-get-name-id.returns"></a><h4>Returns</h4>
490 <p> Name ID associated with a palette entry, e.g. eye color</p>
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>
495 <div class="refsect2">
496 <a name="hb-ot-color-palette-get-colors"></a><h3>hb_ot_color_palette_get_colors ()</h3>
497 <pre class="programlisting">unsigned <span class="returnvalue">int</span>
498 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>,
499 <em class="parameter"><code>unsigned <span class="type">int</span> palette_index</code></em>,
500 <em class="parameter"><code>unsigned <span class="type">int</span> start_offset</code></em>,
501 <em class="parameter"><code>unsigned <span class="type">int</span> *color_count</code></em>,
502 <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>
503 <p>Retrieves the colors in a color palette.</p>
504 <div class="refsect3">
505 <a name="hb-ot-color-palette-get-colors.parameters"></a><h4>Parameters</h4>
506 <div class="informaltable"><table class="informaltable" width="100%" border="0">
508 <col width="150px" class="parameters_name">
509 <col class="parameters_description">
510 <col width="200px" class="parameters_annotations">
514 <td class="parameter_name"><p>face</p></td>
515 <td class="parameter_description"><p>a font face.</p></td>
516 <td class="parameter_annotations"> </td>
519 <td class="parameter_name"><p>palette_index</p></td>
520 <td class="parameter_description"><p>the index of the color palette whose colors
521 are being requested.</p></td>
522 <td class="parameter_annotations"> </td>
525 <td class="parameter_name"><p>start_offset</p></td>
526 <td class="parameter_description"><p>the index of the first color being requested.</p></td>
527 <td class="parameter_annotations"> </td>
530 <td class="parameter_name"><p>color_count</p></td>
531 <td class="parameter_description"><p>on input, how many colors
532 can be maximally stored into the <em class="parameter"><code>colors</code></em>
534 on output, how many colors were actually stored. </p></td>
535 <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>
538 <td class="parameter_name"><p>colors</p></td>
539 <td class="parameter_description"><p>an 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. After calling
540 this function, <em class="parameter"><code>colors</code></em>
542 the palette colors. If <em class="parameter"><code>colors</code></em>
543 is NULL, the function
544 will just return the number of total colors
545 without storing any actual colors; this can be used
546 for allocating a buffer of suitable size before calling
547 <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></td>
548 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=color_count][<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td>
553 <div class="refsect3">
554 <a name="hb-ot-color-palette-get-colors.returns"></a><h4>Returns</h4>
555 <p> the total number of colors in the palette.</p>
557 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
560 <div class="refsect2">
561 <a name="hb-ot-color-palette-get-count"></a><h3>hb_ot_color_palette_get_count ()</h3>
562 <pre class="programlisting">unsigned <span class="returnvalue">int</span>
563 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>
564 <div class="refsect3">
565 <a name="hb-ot-color-palette-get-count.parameters"></a><h4>Parameters</h4>
566 <div class="informaltable"><table class="informaltable" width="100%" border="0">
568 <col width="150px" class="parameters_name">
569 <col class="parameters_description">
570 <col width="200px" class="parameters_annotations">
573 <td class="parameter_name"><p>face</p></td>
574 <td class="parameter_description"><p>a font face.</p></td>
575 <td class="parameter_annotations"> </td>
579 <div class="refsect3">
580 <a name="hb-ot-color-palette-get-count.returns"></a><h4>Returns</h4>
581 <p> the number of color palettes in <em class="parameter"><code>face</code></em>
582 , or zero if <em class="parameter"><code>face</code></em>
586 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
589 <div class="refsect2">
590 <a name="hb-ot-color-palette-get-flags"></a><h3>hb_ot_color_palette_get_flags ()</h3>
591 <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>
592 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>,
593 <em class="parameter"><code>unsigned <span class="type">int</span> palette_index</code></em>);</pre>
594 <div class="refsect3">
595 <a name="hb-ot-color-palette-get-flags.parameters"></a><h4>Parameters</h4>
596 <div class="informaltable"><table class="informaltable" width="100%" border="0">
598 <col width="150px" class="parameters_name">
599 <col class="parameters_description">
600 <col width="200px" class="parameters_annotations">
604 <td class="parameter_name"><p>face</p></td>
605 <td class="parameter_description"><p>a font face</p></td>
606 <td class="parameter_annotations"> </td>
609 <td class="parameter_name"><p>palette_index</p></td>
610 <td class="parameter_description"><p>the index of the color palette whose flags are being requested</p></td>
611 <td class="parameter_annotations"> </td>
616 <div class="refsect3">
617 <a name="hb-ot-color-palette-get-flags.returns"></a><h4>Returns</h4>
618 <p> the flags for the requested color palette.</p>
620 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
623 <div class="refsect2">
624 <a name="hb-ot-color-palette-get-name-id"></a><h3>hb_ot_color_palette_get_name_id ()</h3>
625 <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>
626 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>,
627 <em class="parameter"><code>unsigned <span class="type">int</span> palette_index</code></em>);</pre>
628 <p>Retrieves the name id of a color palette. For example, a color font can
629 have themed palettes like "Spring", "Summer", "Fall", and "Winter".</p>
630 <div class="refsect3">
631 <a name="hb-ot-color-palette-get-name-id.parameters"></a><h4>Parameters</h4>
632 <div class="informaltable"><table class="informaltable" width="100%" border="0">
634 <col width="150px" class="parameters_name">
635 <col class="parameters_description">
636 <col width="200px" class="parameters_annotations">
640 <td class="parameter_name"><p>face</p></td>
641 <td class="parameter_description"><p>a font face.</p></td>
642 <td class="parameter_annotations"> </td>
645 <td class="parameter_name"><p>palette_index</p></td>
646 <td class="parameter_description"><p>the index of the color palette whose name is being requested.</p></td>
647 <td class="parameter_annotations"> </td>
652 <div class="refsect3">
653 <a name="hb-ot-color-palette-get-name-id.returns"></a><h4>Returns</h4>
654 <p> an identifier within <em class="parameter"><code>face</code></em>
655 's <code class="literal">name</code> table.
656 If the requested palette has no name the result is <span class="type">HB_OT_NAME_ID_INVALID</span>.</p>
658 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
661 <div class="refsect1">
662 <a name="harfbuzz-hb-ot-color.other_details"></a><h2>Types and Values</h2>
663 <div class="refsect2">
664 <a name="hb-color-t"></a><h3>hb_color_t</h3>
665 <pre class="programlisting">typedef uint32_t hb_color_t;
667 <p>Data type for holding color values.</p>
668 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
671 <div class="refsect2">
672 <a name="hb-ot-color-palette-flags-t"></a><h3>enum hb_ot_color_palette_flags_t</h3>
673 <div class="refsect3">
674 <a name="hb-ot-color-palette-flags-t.members"></a><h4>Members</h4>
675 <div class="informaltable"><table class="informaltable" width="100%" border="0">
677 <col width="300px" class="enum_members_name">
678 <col class="enum_members_description">
679 <col width="200px" class="enum_members_annotations">
683 <td class="enum_member_name"><p><a name="HB-OT-COLOR-PALETTE-FLAG-DEFAULT:CAPS"></a>HB_OT_COLOR_PALETTE_FLAG_DEFAULT</p></td>
684 <td class="enum_member_description">
685 <p>default indicating that there is nothing special
686 to note about a color palette.</p>
688 <td class="enum_member_annotations"> </td>
691 <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>
692 <td class="enum_member_description">
693 <p>flag indicating that the color
694 palette is appropriate to use when displaying the font on a light background such as white.</p>
696 <td class="enum_member_annotations"> </td>
699 <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>
700 <td class="enum_member_description">
701 <p>flag indicating that the color
702 palette is appropriate to use when displaying the font on a dark background such as black.</p>
704 <td class="enum_member_annotations"> </td>
709 <p class="since">Since: <a class="link" href="api-index-2-1-0.html#api-index-2.1.0">2.1.0</a></p>
714 <hr>Generated by GTK-Doc V1.29</div>