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>Level 2: 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="the-distinction-between-levels-0-and-1.html" title="The distinction between levels 0 and 1">
10 <link rel="next" href="shaping-and-shape-plans.html" title="Shaping and shape plans">
11 <meta name="generator" content="GTK-Doc V1.27.1 (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="the-distinction-between-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="shaping-and-shape-plans.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="level-2"></a>Level 2</h2></div></div></div>
26 Level 2 is a different beast from levels 0 and 1. It is simple to
27 describe, but hard to make sense of. It simply doesn't do any
28 cluster merging whatsoever. When things ligate or otherwise multiple
29 glyphs turn into one, the cluster value of the first glyph is
33 Here are a few examples of why processing cluster values produced at
34 this level might be tricky:
37 <div class="titlepage"><div><div><h3 class="title">
38 <a name="ligatures-with-combining-marks"></a>Ligatures with combining marks</h3></div></div></div>
40 Imagine capital letters are bases and lower case letters are
41 combining marks. With an input sequence like this:
43 <pre class="programlisting">
48 if <code class="literal">A,B,C</code> ligate, then here are the cluster
49 values one would get under the various levels:
54 <pre class="programlisting">
61 <pre class="programlisting">
68 <pre class="programlisting">
73 Making sense of the last example is the hardest for a client,
74 because there is nothing in the cluster values to suggest that
75 <code class="literal">B</code> and <code class="literal">C</code> ligated with
76 <code class="literal">A</code>.
80 <div class="titlepage"><div><div><h3 class="title">
81 <a name="reordering"></a>Reordering</h3></div></div></div>
83 Another tricky case is when things reorder. Under level 2:
85 <pre class="programlisting">
90 Now imagine <code class="literal">D</code> moves before
91 <code class="literal">B</code>:
93 <pre class="programlisting">
98 Now, if <code class="literal">D</code> ligates with <code class="literal">B</code>, we
101 <pre class="programlisting">
106 In a different scenario, <code class="literal">A</code> and
107 <code class="literal">B</code> could have ligated
108 <span class="emphasis"><em>before</em></span> <code class="literal">D</code> reordered; that
109 would have resulted in:
111 <pre class="programlisting">
116 There's no way to differentiate between these two scenarios based
117 on the cluster numbers alone.
120 Another problem happens with ligatures under level 2 if the
121 direction of the text is forced to opposite of its natural
122 direction (e.g. left-to-right Arabic). But that's too much of a
123 corner case to worry about.
128 <hr>Generated by GTK-Doc V1.27.1</div>