Imported Upstream version 2.4.0
[platform/upstream/harfbuzz.git] / docs / html / reordering-in-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>Reordering in levels 0 and 1: 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="clusters.html" title="Clusters">
9 <link rel="prev" href="a-clustering-example-for-levels-0-and-1.html" title="A clustering example for levels 0 and 1">
10 <link rel="next" href="the-distinction-between-levels-0-and-1.html" title="The distinction between levels 0 and 1">
11 <meta name="generator" content="GTK-Doc V1.29 (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="a-clustering-example-for-levels-0-and-1.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
20 <td><a accesskey="n" href="the-distinction-between-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="section">
23 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
24 <a name="reordering-in-levels-0-and-1"></a>Reordering in levels 0 and 1</h2></div></div></div>
25 <p>
26       Another common operation in the more complex shapers is glyph
27       reordering. In order to maintain a monotonic cluster sequence
28       when glyph reordering takes place, HarfBuzz merges the clusters
29       of everything in the reordering sequence.
30     </p>
31 <p>
32       For example, let us again start with the character sequence (top
33       row) and initial cluster values (bottom row):
34     </p>
35 <pre class="programlisting">
36       A,B,C,D,E
37       0,1,2,3,4
38     </pre>
39 <p>
40       If <code class="literal">D</code> is reordered to the position immediately
41       before <code class="literal">B</code>, then HarfBuzz merges the
42       <code class="literal">B</code>, <code class="literal">C</code>, and
43       <code class="literal">D</code> clusters — all the clusters between
44       the final position of the reordered glyph and its original
45       position. This means that we get:
46     </p>
47 <pre class="programlisting">
48       A,D,B,C,E
49       0,1,1,1,4
50     </pre>
51 <p>
52       as the final cluster sequence.
53     </p>
54 <p>
55       Merging this many clusters is not ideal, but it is the only
56       sensible way for HarfBuzz to maintain the guarantee that the
57       sequence of cluster values remains monotonic and to retain the
58       true relationship between glyphs and characters.
59     </p>
60 </div>
61 <div class="footer">
62 <hr>Generated by GTK-Doc V1.29</div>
63 </body>
64 </html>