Imported Upstream version 2.6.7
[platform/upstream/harfbuzz.git] / docs / html / integration-icu.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>ICU integration: 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="integration.html" title="Platform Integration Guide">
9 <link rel="prev" href="integration-coretext.html" title="Core Text integration">
10 <link rel="next" href="integration-python.html" title="Python bindings">
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="integration.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
19 <td><a accesskey="p" href="integration-coretext.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
20 <td><a accesskey="n" href="integration-python.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="integration-icu"></a>ICU integration</h2></div></div></div>
25 <p>
26       Although HarfBuzz includes its own Unicode-data functions, it
27       also provides integration APIs for using the International
28       Components for Unicode (ICU) library as a source of Unicode data
29       on any supported platform.
30     </p>
31 <p>
32       The principal integration point with ICU is the
33       <span class="type">hb_unicode_funcs_t</span> Unicode-functions structure
34       attached to a buffer. This structure holds the virtual methods
35       used for retrieving Unicode character properties, such as
36       General Category, Script, Combining Class, decomposition
37       mappings, and mirroring information.
38     </p>
39 <p>
40       To use ICU in your client program, you need to call
41       <code class="function">hb_icu_get_unicode_funcs()</code>, which creates a
42       Unicode-functions structure populated with the ICU function for
43       each included method. Subsequently, you can attach the
44       Unicode-functions structure to your buffer:
45     </p>
46 <pre class="programlisting">
47       hb_unicode_funcs_t *icufunctions;
48       icufunctions = hb_icu_get_unicode_funcs();
49       hb_buffer_set_unicode_funcs(buf, icufunctions);
50     </pre>
51 <p>
52       and ICU will be used for Unicode-data access.
53     </p>
54 <p>
55       HarfBuzz also supplies a pair of functions
56       (<code class="function">hb_icu_script_from_script()</code> and
57       <code class="function">hb_icu_script_to_script()</code>) for converting
58       between ICU's and HarfBuzz's internal enumerations of Unicode
59       scripts. The <code class="function">hb_icu_script_from_script()</code>
60       function converts from a HarfBuzz <span class="type">hb_script_t</span> to an
61       ICU <span class="type">UScriptCode</span>. The
62       <code class="function">hb_icu_script_to_script()</code> function does the
63       reverse: converting from a <span class="type">UScriptCode</span> identifier
64       to a <span class="type">hb_script_t</span>.
65     </p>
66 <p>
67       By default, HarfBuzz's ICU support is built as a separate shared
68       library (<code class="filename">libharfbuzz-icu.so</code>)
69       when compiling HarfBuzz from source. This allows client programs
70       that do not need ICU to link against HarfBuzz without unnecessarily
71       adding ICU as a dependency. You can also build HarfBuzz with ICU
72       support built directly into the main HarfBuzz shared library
73       (<code class="filename">libharfbuzz.so</code>),
74       by specifying the <code class="literal">--with-icu=builtin</code>
75       compile-time option.
76     </p>
77 </div>
78 <div class="footer">
79 <hr>Generated by GTK-Doc V1.32.1</div>
80 </body>
81 </html>