1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
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 V1.79.1">
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.32 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
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>
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>
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.
32 For example, let us again start with the character sequence (top
33 row) and initial cluster values (bottom row):
35 <pre class="programlisting">
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:
47 <pre class="programlisting">
52 as the final cluster sequence.
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.
62 <hr>Generated by GTK-Doc V1.32</div>