blob: 2a390b7a73597ebce12e411a2cb83f8364473aee [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<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="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.25 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="clusters.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<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="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 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>
<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>
<p>
as the final cluster sequence.
</p>
<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.25</div>
</body>
</html>