Imported Upstream version 2.6.7
[platform/upstream/harfbuzz.git] / docs / html / utilities-common-types-apis.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>Common data types and APIs: 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="utilities.html" title="Utilities">
9 <link rel="prev" href="utilities.html" title="Utilities">
10 <link rel="next" href="utilities-ucdn.html" title="UCDN">
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"></td>
17 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
18 <td><a accesskey="u" href="utilities.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
19 <td><a accesskey="p" href="utilities.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
20 <td><a accesskey="n" href="utilities-ucdn.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
21 </tr></table>
22 <div class="section">
23 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
24 <a name="utilities-common-types-apis"></a>Common data types and APIs</h2></div></div></div>
25 <p>
26       HarfBuzz includes several APIs for working with general-purpose
27       data that you may find convenient to leverage in your own
28       software. They include set operations and integer-to-integer
29       mapping operations.
30     </p>
31 <p>
32       HarfBuzz uses set operations for internal bookkeeping, such as
33       when it collects all of the glyph IDs covered by a particular
34       font feature. You can also use the set API to build sets, add
35       and remove elements, test whether or not sets contain particular
36       elements, or compute the unions, intersections, or differences
37       between sets.
38     </p>
39 <p>
40       All set elements are integers (specifically,
41       <span class="type">hb_codepoint_t</span> 32-bit unsigned ints), and there are
42       functions for fetching the minimum and maximum element from a
43       set. The set API also includes some functions that might not 
44       be part of a generic set facility, such as the ability to add a
45       contiguous range of integer elements to a set in bulk, and the
46       ability to fetch the next-smallest or next-largest element.
47     </p>
48 <p>
49       The HarfBuzz set API includes some conveniences as well. All
50       sets are lifecycle-managed, just like other HarfBuzz
51       objects. You increase the reference count on a set with
52       <code class="function">hb_set_reference()</code> and decrease it with
53       <code class="function">hb_set_destroy()</code>. You can also attach
54       user data to a set, just like you can to blobs, buffers, faces,
55       fonts, and other objects, and set destroy callbacks.
56     </p>
57 <p>
58       HarfBuzz also provides an API for keeping track of
59       integer-to-integer mappings. As with the set API, each integer is
60       stored as an unsigned 32-bit <span class="type">hb_codepoint_t</span>
61       element. Maps, like other objects, are reference counted with
62       reference and destroy functions, and you can attach user data to
63       them. The mapping operations include adding and deleting
64       integer-to-integer key:value pairs to the map, testing for the
65       presence of a key, fetching the population of the map, and so on.
66     </p>
67 <p>
68       There are several other internal HarfBuzz facilities that are
69       exposed publicly and which you may want to take advantage of
70       while processing text. HarfBuzz uses a common
71       <span class="type">hb_tag_t</span> for a variety of OpenType tag identifiers (for
72       scripts, languages, font features, table names, variation-axis
73       names, and more), and provides functions for converting strings
74       to tags and vice-versa. 
75     </p>
76 <p>
77       Finally, HarfBuzz also includes data type for Booleans, bit
78       masks, and other simple types.
79     </p>
80 </div>
81 <div class="footer">
82 <hr>Generated by GTK-Doc V1.32.1</div>
83 </body>
84 </html>