2d953d31dd9b149b34c1afbda3ce0aabece0ca9a
[platform/upstream/harfbuzz.git] / docs / html / a-clustering-example-for-levels-0-and-1.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>A clustering example for levels 0 and 1: 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="clusters.html" title="">
9 <link rel="prev" href="clusters.html" title="">
10 <link rel="next" href="reordering-in-levels-0-and-1.html" title="Reordering in levels 0 and 1">
11 <meta name="generator" content="GTK-Doc V1.27.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="clusters.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
19 <td><a accesskey="p" href="clusters.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
20 <td><a accesskey="n" href="reordering-in-levels-0-and-1.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
21 </tr></table>
22 <div class="sect1">
23 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
24 <a name="a-clustering-example-for-levels-0-and-1"></a>A clustering example for levels 0 and 1</h2></div></div></div>
25 <p>
26     Let's say we start with the following character sequence and cluster
27     values:
28   </p>
29 <pre class="programlisting">
30    A,B,C,D,E
31    0,1,2,3,4
32 </pre>
33 <p>
34     We then map the characters to glyphs. For simplicity, let's assume
35     that each character maps to the corresponding, identical-looking
36     glyph:
37   </p>
38 <pre class="programlisting">
39    A,B,C,D,E
40    0,1,2,3,4
41 </pre>
42 <p>
43     Now if, for example, <code class="literal">B</code> and <code class="literal">C</code>
44     ligate, then the clusters to which they belong "merge".
45     This merged cluster takes for its cluster number the minimum of all
46     the cluster numbers of the clusters that went in. In this case, we
47     get:
48   </p>
49 <pre class="programlisting">
50    A,BC,D,E
51    0,1 ,3,4
52 </pre>
53 <p>
54     Now let's assume that the <code class="literal">BC</code> glyph decomposes
55     into three components, and <code class="literal">D</code> also decomposes into
56     two. The components each inherit the cluster value of their parent:
57   </p>
58 <pre class="programlisting">
59    A,BC0,BC1,BC2,D0,D1,E
60    0,1  ,1  ,1  ,3 ,3 ,4
61 </pre>
62 <p>
63     Now if <code class="literal">BC2</code> and <code class="literal">D0</code> ligate, then
64     their clusters (numbers 1 and 3) merge into
65     <code class="literal">min(1,3) = 1</code>:
66   </p>
67 <pre class="programlisting">
68    A,BC0,BC1,BC2D0,D1,E
69    0,1  ,1  ,1    ,1 ,4
70 </pre>
71 <p>
72     At this point, cluster 1 means: the character sequence
73     <code class="literal">BCD</code> is represented by glyphs
74     <code class="literal">BC0,BC1,BC2D0,D1</code> and cannot be broken down any
75     further.
76   </p>
77 </div>
78 <div class="footer">
79 <hr>Generated by GTK-Doc V1.27.1</div>
80 </body>
81 </html>