<title>Reordering in levels 0 and 1: HarfBuzz Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="HarfBuzz Manual">
-<link rel="up" href="clusters.html" title="">
+<link rel="up" href="clusters.html" title="Clusters">
<link rel="prev" href="a-clustering-example-for-levels-0-and-1.html" title="A clustering example for levels 0 and 1">
<link rel="next" href="the-distinction-between-levels-0-and-1.html" title="The distinction between levels 0 and 1">
-<meta name="generator" content="GTK-Doc V1.27.1 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.25 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<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>
<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>
</tr></table>
-<div class="sect1">
+<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="reordering-in-levels-0-and-1"></a>Reordering in levels 0 and 1</h2></div></div></div>
<p>
- Another common operation in the more complex shapers is when things
- reorder. In those cases, to maintain monotone clusters, HB merges
- the clusters of everything in the reordering sequence. For example,
- let's again start with the character sequence:
- </p>
+ Another common operation in the more complex shapers is glyph
+ reordering. In order to maintain a monotonic cluster sequence
+ when glyph reordering takes place, HarfBuzz merges the clusters
+ of everything in the reordering sequence.
+ </p>
+<p>
+ For example, let us again start with the character sequence (top
+ row) and initial cluster values (bottom row):
+ </p>
<pre class="programlisting">
- A,B,C,D,E
- 0,1,2,3,4
-</pre>
+ A,B,C,D,E
+ 0,1,2,3,4
+ </pre>
<p>
- If <code class="literal">D</code> is reordered before <code class="literal">B</code>,
- then the <code class="literal">B</code>, <code class="literal">C</code>, and
- <code class="literal">D</code> clusters merge, and we get:
- </p>
+ If <code class="literal">D</code> is reordered to the position immediately
+ before <code class="literal">B</code>, then HarfBuzz merges the
+ <code class="literal">B</code>, <code class="literal">C</code>, and
+ <code class="literal">D</code> clusters — all the clusters between
+ the final position of the reordered glyph and its original
+ position. This means that we get:
+ </p>
<pre class="programlisting">
- A,D,B,C,E
- 0,1,1,1,4
-</pre>
+ A,D,B,C,E
+ 0,1,1,1,4
+ </pre>
+<p>
+ as the final cluster sequence.
+ </p>
<p>
- This is clearly not ideal, but it is the only sensible way to
- maintain monotone indices and retain the true relationship between
- glyphs and characters.
- </p>
+ Merging this many clusters is not ideal, but it is the only
+ sensible way for HarfBuzz to maintain the guarantee that the
+ sequence of cluster values remains monotonic and to retain the
+ true relationship between glyphs and characters.
+ </p>
</div>
<div class="footer">
-<hr>Generated by GTK-Doc V1.27.1</div>
+<hr>Generated by GTK-Doc V1.25</div>
</body>
</html>
\ No newline at end of file