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>Shaper selection: 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="shaping-and-shape-plans.html" title="Shaping and shape plans">
9 <link rel="prev" href="shaping-opentype-features.html" title="OpenType features">
10 <link rel="next" href="shaping-plans-and-caching.html" title="Plans and caching">
11 <meta name="generator" content="GTK-Doc V1.32.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="shaping-and-shape-plans.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
19 <td><a accesskey="p" href="shaping-opentype-features.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
20 <td><a accesskey="n" href="shaping-plans-and-caching.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="shaping-shaper-selection"></a>Shaper selection</h2></div></div></div>
26 The basic version of <code class="function">hb_shape()</code> determines
27 its shaping strategy based on examining the capabilities of the
28 font file. OpenType font tables cause HarfBuzz to try the
29 <code class="literal">ot</code> shaper, while AAT font tables cause HarfBuzz to try the
30 <code class="literal">aat</code> shaper.
33 In the real world, however, a font might include some unusual
34 mix of tables, or one of the tables might simply be broken for
35 the script you need to shape. So, sometimes, you might not
36 want to rely on HarfBuzz's process for deciding what to do, and
37 just tell <code class="function">hb_shape()</code> what you want it to try.
40 <code class="function">hb_shape_full()</code> is an alternate shaping
41 function that lets you supply a list of shapers for HarfBuzz to
42 try, in order, when shaping your buffer. For example, if you
43 have determined that HarfBuzz's attempts to work around broken
44 tables gives you better results than the AAT shaper itself does,
45 you might move the AAT shaper to the end of your list of
46 preferences and call <code class="function">hb_shape_full()</code>
48 <pre class="programlisting">
49 char *shaperprefs[3] = {"ot", "default", "aat"};
51 hb_shape_full(font, buf, userfeatures, num_features, shaperprefs);
54 to get results you are happier with.
57 You may also want to call
58 <code class="function">hb_shape_list_shapers()</code> to get a list of
59 the shapers that were built at compile time in your copy of HarfBuzz.
63 <hr>Generated by GTK-Doc V1.32.1</div>