xref: /aosp_15_r20/external/harfbuzz_ng/docs/usermanual-shaping-concepts.xml (revision 2d1272b857b1f7575e6e246373e1cb218663db8a)
1*2d1272b8SAndroid Build Coastguard Worker<?xml version="1.0"?>
2*2d1272b8SAndroid Build Coastguard Worker<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3*2d1272b8SAndroid Build Coastguard Worker               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
4*2d1272b8SAndroid Build Coastguard Worker  <!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
5*2d1272b8SAndroid Build Coastguard Worker  <!ENTITY version SYSTEM "version.xml">
6*2d1272b8SAndroid Build Coastguard Worker]>
7*2d1272b8SAndroid Build Coastguard Worker<chapter id="shaping-concepts">
8*2d1272b8SAndroid Build Coastguard Worker  <title>Shaping concepts</title>
9*2d1272b8SAndroid Build Coastguard Worker  <section id="text-shaping-concepts">
10*2d1272b8SAndroid Build Coastguard Worker    <title>Text shaping</title>
11*2d1272b8SAndroid Build Coastguard Worker    <para>
12*2d1272b8SAndroid Build Coastguard Worker      Text shaping is the process of transforming a sequence of Unicode
13*2d1272b8SAndroid Build Coastguard Worker      codepoints that represent individual characters (letters,
14*2d1272b8SAndroid Build Coastguard Worker      diacritics, tone marks, numbers, symbols, etc.) into the
15*2d1272b8SAndroid Build Coastguard Worker      orthographically and linguistically correct two-dimensional layout
16*2d1272b8SAndroid Build Coastguard Worker      of glyph shapes taken from a specified font.
17*2d1272b8SAndroid Build Coastguard Worker    </para>
18*2d1272b8SAndroid Build Coastguard Worker    <para>
19*2d1272b8SAndroid Build Coastguard Worker      For some writing systems (or <emphasis>scripts</emphasis>) and
20*2d1272b8SAndroid Build Coastguard Worker      languages, the process is simple, requiring the shaper to do
21*2d1272b8SAndroid Build Coastguard Worker      little more than advance the horizontal position forward by the
22*2d1272b8SAndroid Build Coastguard Worker      correct amount for each successive glyph.
23*2d1272b8SAndroid Build Coastguard Worker    </para>
24*2d1272b8SAndroid Build Coastguard Worker    <para>
25*2d1272b8SAndroid Build Coastguard Worker      But, for other scripts (often unceremoniously called <emphasis>complex scripts</emphasis>), any combination of
26*2d1272b8SAndroid Build Coastguard Worker      several shaping operations may be required, and the rules for how
27*2d1272b8SAndroid Build Coastguard Worker      and when they are applied vary from script to script. HarfBuzz and
28*2d1272b8SAndroid Build Coastguard Worker      other shaping engines implement these rules.
29*2d1272b8SAndroid Build Coastguard Worker    </para>
30*2d1272b8SAndroid Build Coastguard Worker    <para>
31*2d1272b8SAndroid Build Coastguard Worker      The exact rules and necessary operations for a particular script
32*2d1272b8SAndroid Build Coastguard Worker      constitute a shaping <emphasis>model</emphasis>. OpenType
33*2d1272b8SAndroid Build Coastguard Worker      specifies a set of shaping models that covers all of
34*2d1272b8SAndroid Build Coastguard Worker      Unicode. Other shaping models are available, however, including
35*2d1272b8SAndroid Build Coastguard Worker      Graphite and Apple Advanced Typography (AAT).
36*2d1272b8SAndroid Build Coastguard Worker    </para>
37*2d1272b8SAndroid Build Coastguard Worker  </section>
38*2d1272b8SAndroid Build Coastguard Worker
39*2d1272b8SAndroid Build Coastguard Worker  <section id="script-specific-shaping">
40*2d1272b8SAndroid Build Coastguard Worker    <title>Script-specific shaping</title>
41*2d1272b8SAndroid Build Coastguard Worker    <para>
42*2d1272b8SAndroid Build Coastguard Worker      In many scripts, transforming the input
43*2d1272b8SAndroid Build Coastguard Worker      sequence into the final layout often requires some combination of
44*2d1272b8SAndroid Build Coastguard Worker      operations&mdash;such as context-dependent substitutions,
45*2d1272b8SAndroid Build Coastguard Worker      context-dependent mark positioning, glyph-to-glyph joining,
46*2d1272b8SAndroid Build Coastguard Worker      glyph reordering, or glyph stacking.
47*2d1272b8SAndroid Build Coastguard Worker    </para>
48*2d1272b8SAndroid Build Coastguard Worker    <para>
49*2d1272b8SAndroid Build Coastguard Worker      In some scripts, the shaping rules require that a text
50*2d1272b8SAndroid Build Coastguard Worker      run be divided into syllables before the operations can be
51*2d1272b8SAndroid Build Coastguard Worker      applied. Other scripts may apply shaping operations over
52*2d1272b8SAndroid Build Coastguard Worker      entire words or over the entire text run, with no subdivision
53*2d1272b8SAndroid Build Coastguard Worker      required.
54*2d1272b8SAndroid Build Coastguard Worker    </para>
55*2d1272b8SAndroid Build Coastguard Worker    <para>
56*2d1272b8SAndroid Build Coastguard Worker      Other scripts, do not require these
57*2d1272b8SAndroid Build Coastguard Worker      operations. However, correctly shaping a text run in
58*2d1272b8SAndroid Build Coastguard Worker      any script may still involve Unicode normalization,
59*2d1272b8SAndroid Build Coastguard Worker      ligature substitutions, mark positioning, kerning, and applying
60*2d1272b8SAndroid Build Coastguard Worker      other font features.
61*2d1272b8SAndroid Build Coastguard Worker    </para>
62*2d1272b8SAndroid Build Coastguard Worker  </section>
63*2d1272b8SAndroid Build Coastguard Worker
64*2d1272b8SAndroid Build Coastguard Worker  <section id="shaping-operations">
65*2d1272b8SAndroid Build Coastguard Worker    <title>Shaping operations</title>
66*2d1272b8SAndroid Build Coastguard Worker    <para>
67*2d1272b8SAndroid Build Coastguard Worker      Shaping a text run involves transforming the
68*2d1272b8SAndroid Build Coastguard Worker      input sequence of Unicode codepoints with some combination of
69*2d1272b8SAndroid Build Coastguard Worker      operations that is specified in the shaping model for the
70*2d1272b8SAndroid Build Coastguard Worker      script.
71*2d1272b8SAndroid Build Coastguard Worker    </para>
72*2d1272b8SAndroid Build Coastguard Worker    <para>
73*2d1272b8SAndroid Build Coastguard Worker      The specific conditions that trigger a given operation for a
74*2d1272b8SAndroid Build Coastguard Worker      text run varies from script to script, as do the order that the
75*2d1272b8SAndroid Build Coastguard Worker      operations are performed in and which codepoints are
76*2d1272b8SAndroid Build Coastguard Worker      affected. However, the same general set of shaping operations is
77*2d1272b8SAndroid Build Coastguard Worker      common to all of the script shaping models.
78*2d1272b8SAndroid Build Coastguard Worker    </para>
79*2d1272b8SAndroid Build Coastguard Worker
80*2d1272b8SAndroid Build Coastguard Worker    <itemizedlist>
81*2d1272b8SAndroid Build Coastguard Worker      <listitem>
82*2d1272b8SAndroid Build Coastguard Worker	<para>
83*2d1272b8SAndroid Build Coastguard Worker	  A <emphasis>reordering</emphasis> operation moves a glyph
84*2d1272b8SAndroid Build Coastguard Worker	  from its original ("logical") position in the sequence to
85*2d1272b8SAndroid Build Coastguard Worker	  some other ("visual") position.
86*2d1272b8SAndroid Build Coastguard Worker	</para>
87*2d1272b8SAndroid Build Coastguard Worker	<para>
88*2d1272b8SAndroid Build Coastguard Worker	  The shaping model for a given script might involve
89*2d1272b8SAndroid Build Coastguard Worker	  more than one reordering step.
90*2d1272b8SAndroid Build Coastguard Worker	</para>
91*2d1272b8SAndroid Build Coastguard Worker      </listitem>
92*2d1272b8SAndroid Build Coastguard Worker
93*2d1272b8SAndroid Build Coastguard Worker      <listitem>
94*2d1272b8SAndroid Build Coastguard Worker	<para>
95*2d1272b8SAndroid Build Coastguard Worker	  A <emphasis>joining</emphasis> operation replaces a glyph
96*2d1272b8SAndroid Build Coastguard Worker	  with an alternate form that is designed to connect with one
97*2d1272b8SAndroid Build Coastguard Worker	  or more of the adjacent glyphs in the sequence.
98*2d1272b8SAndroid Build Coastguard Worker	</para>
99*2d1272b8SAndroid Build Coastguard Worker      </listitem>
100*2d1272b8SAndroid Build Coastguard Worker
101*2d1272b8SAndroid Build Coastguard Worker      <listitem>
102*2d1272b8SAndroid Build Coastguard Worker	<para>
103*2d1272b8SAndroid Build Coastguard Worker	  A contextual <emphasis>substitution</emphasis> operation
104*2d1272b8SAndroid Build Coastguard Worker	  replaces either a single glyph or a subsequence of several
105*2d1272b8SAndroid Build Coastguard Worker	  glyphs with an alternate glyph. This substitution is
106*2d1272b8SAndroid Build Coastguard Worker	  performed when the original glyph or subsequence of glyphs
107*2d1272b8SAndroid Build Coastguard Worker	  occurs in a specified position with respect to the
108*2d1272b8SAndroid Build Coastguard Worker	  surrounding sequence. For example, one substitution might be
109*2d1272b8SAndroid Build Coastguard Worker	  performed only when the target glyph is the first glyph in
110*2d1272b8SAndroid Build Coastguard Worker	  the sequence, while another substitution is performed only
111*2d1272b8SAndroid Build Coastguard Worker	  when a different target glyph occurs immediately after a
112*2d1272b8SAndroid Build Coastguard Worker	  particular string pattern.
113*2d1272b8SAndroid Build Coastguard Worker	</para>
114*2d1272b8SAndroid Build Coastguard Worker	<para>
115*2d1272b8SAndroid Build Coastguard Worker	  The shaping model for a given script might involve
116*2d1272b8SAndroid Build Coastguard Worker	  multiple contextual-substitution operations, each applying
117*2d1272b8SAndroid Build Coastguard Worker	  to different target glyphs and patterns, and which are
118*2d1272b8SAndroid Build Coastguard Worker	  performed in separate steps.
119*2d1272b8SAndroid Build Coastguard Worker	</para>
120*2d1272b8SAndroid Build Coastguard Worker      </listitem>
121*2d1272b8SAndroid Build Coastguard Worker
122*2d1272b8SAndroid Build Coastguard Worker      <listitem>
123*2d1272b8SAndroid Build Coastguard Worker	<para>
124*2d1272b8SAndroid Build Coastguard Worker	  A contextual <emphasis>positioning</emphasis> operation
125*2d1272b8SAndroid Build Coastguard Worker	  moves the horizontal and/or vertical position of a
126*2d1272b8SAndroid Build Coastguard Worker	  glyph. This positioning move is performed when the glyph
127*2d1272b8SAndroid Build Coastguard Worker	  occurs in a specified position with respect to the
128*2d1272b8SAndroid Build Coastguard Worker	  surrounding sequence.
129*2d1272b8SAndroid Build Coastguard Worker	</para>
130*2d1272b8SAndroid Build Coastguard Worker	<para>
131*2d1272b8SAndroid Build Coastguard Worker	  Many contextual positioning operations are used to place
132*2d1272b8SAndroid Build Coastguard Worker	  <emphasis>mark</emphasis> glyphs (such as diacritics, vowel
133*2d1272b8SAndroid Build Coastguard Worker	  signs, and tone markers) with respect to
134*2d1272b8SAndroid Build Coastguard Worker	  <emphasis>base</emphasis> glyphs. However, some
135*2d1272b8SAndroid Build Coastguard Worker	  scripts may use contextual positioning operations to
136*2d1272b8SAndroid Build Coastguard Worker	  correctly place base glyphs as well, such as
137*2d1272b8SAndroid Build Coastguard Worker	  when the script uses <emphasis>stacking</emphasis> characters.
138*2d1272b8SAndroid Build Coastguard Worker	</para>
139*2d1272b8SAndroid Build Coastguard Worker      </listitem>
140*2d1272b8SAndroid Build Coastguard Worker
141*2d1272b8SAndroid Build Coastguard Worker    </itemizedlist>
142*2d1272b8SAndroid Build Coastguard Worker  </section>
143*2d1272b8SAndroid Build Coastguard Worker
144*2d1272b8SAndroid Build Coastguard Worker  <section id="unicode-character-categories">
145*2d1272b8SAndroid Build Coastguard Worker    <title>Unicode character categories</title>
146*2d1272b8SAndroid Build Coastguard Worker    <para>
147*2d1272b8SAndroid Build Coastguard Worker      Shaping models are typically specified with respect to how
148*2d1272b8SAndroid Build Coastguard Worker      scripts are defined in the Unicode standard.
149*2d1272b8SAndroid Build Coastguard Worker    </para>
150*2d1272b8SAndroid Build Coastguard Worker    <para>
151*2d1272b8SAndroid Build Coastguard Worker      Every codepoint in the Unicode Character Database (UCD) is
152*2d1272b8SAndroid Build Coastguard Worker      assigned a <emphasis>Unicode General Category</emphasis> (UGC),
153*2d1272b8SAndroid Build Coastguard Worker      which provides the most fundamental information about the
154*2d1272b8SAndroid Build Coastguard Worker      codepoint: whether the codepoint represents a
155*2d1272b8SAndroid Build Coastguard Worker      <emphasis>Letter</emphasis>, a <emphasis>Mark</emphasis>, a
156*2d1272b8SAndroid Build Coastguard Worker      <emphasis>Number</emphasis>, <emphasis>Punctuation</emphasis>, a
157*2d1272b8SAndroid Build Coastguard Worker      <emphasis>Symbol</emphasis>, a <emphasis>Separator</emphasis>,
158*2d1272b8SAndroid Build Coastguard Worker      or something else (<emphasis>Other</emphasis>).
159*2d1272b8SAndroid Build Coastguard Worker    </para>
160*2d1272b8SAndroid Build Coastguard Worker    <para>
161*2d1272b8SAndroid Build Coastguard Worker      These UGC properties are "Major" categories. Each codepoint is
162*2d1272b8SAndroid Build Coastguard Worker      further assigned to a "minor" category within its Major
163*2d1272b8SAndroid Build Coastguard Worker      category, such as "Letter, uppercase" (<literal>Lu</literal>) or
164*2d1272b8SAndroid Build Coastguard Worker      "Letter, modifier" (<literal>Lm</literal>).
165*2d1272b8SAndroid Build Coastguard Worker    </para>
166*2d1272b8SAndroid Build Coastguard Worker    <para>
167*2d1272b8SAndroid Build Coastguard Worker      Shaping models are concerned primarily with Letter and Mark
168*2d1272b8SAndroid Build Coastguard Worker      codepoints. The minor categories of Mark codepoints are
169*2d1272b8SAndroid Build Coastguard Worker      particularly important for shaping. Marks can be nonspacing
170*2d1272b8SAndroid Build Coastguard Worker      (<literal>Mn</literal>), spacing combining
171*2d1272b8SAndroid Build Coastguard Worker      (<literal>Mc</literal>), or enclosing (<literal>Me</literal>).
172*2d1272b8SAndroid Build Coastguard Worker    </para>
173*2d1272b8SAndroid Build Coastguard Worker    <para>
174*2d1272b8SAndroid Build Coastguard Worker      In addition to the UGC property, codepoints in the Indic and
175*2d1272b8SAndroid Build Coastguard Worker      Southeast Asian scripts are also assigned
176*2d1272b8SAndroid Build Coastguard Worker      <emphasis>Unicode Indic Syllabic Category</emphasis> (UISC) and
177*2d1272b8SAndroid Build Coastguard Worker      <emphasis>Unicode Indic Positional Category</emphasis> (UIPC)
178*2d1272b8SAndroid Build Coastguard Worker      properties that provide more detailed information needed for
179*2d1272b8SAndroid Build Coastguard Worker      shaping.
180*2d1272b8SAndroid Build Coastguard Worker    </para>
181*2d1272b8SAndroid Build Coastguard Worker    <para>
182*2d1272b8SAndroid Build Coastguard Worker      The UISC property sub-categorizes Letters and Marks according to
183*2d1272b8SAndroid Build Coastguard Worker      common script-shaping behaviors. For example, UISC distinguishes
184*2d1272b8SAndroid Build Coastguard Worker      between consonant letters, vowel letters, and vowel marks. The
185*2d1272b8SAndroid Build Coastguard Worker      UIPC property sub-categorizes Mark codepoints by the relative visual
186*2d1272b8SAndroid Build Coastguard Worker      position that they occupy (above, below, right, left, or in
187*2d1272b8SAndroid Build Coastguard Worker      multiple positions).
188*2d1272b8SAndroid Build Coastguard Worker    </para>
189*2d1272b8SAndroid Build Coastguard Worker    <para>
190*2d1272b8SAndroid Build Coastguard Worker      Some scripts require that the text run be split into
191*2d1272b8SAndroid Build Coastguard Worker      syllables. What constitutes a valid syllable in these
192*2d1272b8SAndroid Build Coastguard Worker      scripts is specified in regular expressions, formed from the
193*2d1272b8SAndroid Build Coastguard Worker      Letter and Mark codepoints, that take the UISC and UIPC
194*2d1272b8SAndroid Build Coastguard Worker      properties into account.
195*2d1272b8SAndroid Build Coastguard Worker    </para>
196*2d1272b8SAndroid Build Coastguard Worker
197*2d1272b8SAndroid Build Coastguard Worker  </section>
198*2d1272b8SAndroid Build Coastguard Worker
199*2d1272b8SAndroid Build Coastguard Worker  <section id="text-runs">
200*2d1272b8SAndroid Build Coastguard Worker    <title>Text runs</title>
201*2d1272b8SAndroid Build Coastguard Worker    <para>
202*2d1272b8SAndroid Build Coastguard Worker      Real-world text usually contains codepoints from a mixture of
203*2d1272b8SAndroid Build Coastguard Worker      different Unicode scripts (including punctuation, numbers, symbols,
204*2d1272b8SAndroid Build Coastguard Worker      white-space characters, and other codepoints that do not belong
205*2d1272b8SAndroid Build Coastguard Worker      to any script). Real-world text may also be marked up with
206*2d1272b8SAndroid Build Coastguard Worker      formatting that changes font properties (including the font,
207*2d1272b8SAndroid Build Coastguard Worker      font style, and font size).
208*2d1272b8SAndroid Build Coastguard Worker    </para>
209*2d1272b8SAndroid Build Coastguard Worker    <para>
210*2d1272b8SAndroid Build Coastguard Worker      For shaping purposes, all real-world text streams must be first
211*2d1272b8SAndroid Build Coastguard Worker      segmented into runs that have a uniform set of properties.
212*2d1272b8SAndroid Build Coastguard Worker    </para>
213*2d1272b8SAndroid Build Coastguard Worker    <para>
214*2d1272b8SAndroid Build Coastguard Worker      In particular, shaping models always assume that every codepoint
215*2d1272b8SAndroid Build Coastguard Worker      in a text run has the same <emphasis>direction</emphasis>,
216*2d1272b8SAndroid Build Coastguard Worker      <emphasis>script</emphasis> tag, and
217*2d1272b8SAndroid Build Coastguard Worker      <emphasis>language</emphasis> tag.
218*2d1272b8SAndroid Build Coastguard Worker    </para>
219*2d1272b8SAndroid Build Coastguard Worker  </section>
220*2d1272b8SAndroid Build Coastguard Worker
221*2d1272b8SAndroid Build Coastguard Worker  <section id="opentype-shaping-models">
222*2d1272b8SAndroid Build Coastguard Worker    <title>OpenType shaping models</title>
223*2d1272b8SAndroid Build Coastguard Worker    <para>
224*2d1272b8SAndroid Build Coastguard Worker      OpenType provides shaping models for the following scripts:
225*2d1272b8SAndroid Build Coastguard Worker    </para>
226*2d1272b8SAndroid Build Coastguard Worker
227*2d1272b8SAndroid Build Coastguard Worker    <itemizedlist>
228*2d1272b8SAndroid Build Coastguard Worker      <listitem>
229*2d1272b8SAndroid Build Coastguard Worker	<para>
230*2d1272b8SAndroid Build Coastguard Worker	  The <emphasis>default</emphasis> shaping model handles all
231*2d1272b8SAndroid Build Coastguard Worker	  scripts with no script-specific shaping model, and may also be used as a fallback for
232*2d1272b8SAndroid Build Coastguard Worker	  handling unrecognized scripts.
233*2d1272b8SAndroid Build Coastguard Worker	</para>
234*2d1272b8SAndroid Build Coastguard Worker      </listitem>
235*2d1272b8SAndroid Build Coastguard Worker
236*2d1272b8SAndroid Build Coastguard Worker      <listitem>
237*2d1272b8SAndroid Build Coastguard Worker	<para>
238*2d1272b8SAndroid Build Coastguard Worker	  The <emphasis>Indic</emphasis> shaping model handles the Indic
239*2d1272b8SAndroid Build Coastguard Worker	  scripts Bengali, Devanagari, Gujarati, Gurmukhi, Kannada,
240*2d1272b8SAndroid Build Coastguard Worker	  Malayalam, Oriya, Tamil, and Telugu.
241*2d1272b8SAndroid Build Coastguard Worker	</para>
242*2d1272b8SAndroid Build Coastguard Worker	<para>
243*2d1272b8SAndroid Build Coastguard Worker	  The Indic shaping model was revised significantly in
244*2d1272b8SAndroid Build Coastguard Worker	  2005. To denote the change, a new set of <emphasis>script
245*2d1272b8SAndroid Build Coastguard Worker	  tags</emphasis> was assigned for Bengali, Devanagari,
246*2d1272b8SAndroid Build Coastguard Worker	  Gujarati, Gurmukhi, Kannada, Malayalam, Oriya, Tamil, and
247*2d1272b8SAndroid Build Coastguard Worker	  Telugu. For the sake of clarity, the term "Indic2" is
248*2d1272b8SAndroid Build Coastguard Worker	  sometimes used to refer to the current, revised shaping
249*2d1272b8SAndroid Build Coastguard Worker	  model.
250*2d1272b8SAndroid Build Coastguard Worker	</para>
251*2d1272b8SAndroid Build Coastguard Worker      </listitem>
252*2d1272b8SAndroid Build Coastguard Worker
253*2d1272b8SAndroid Build Coastguard Worker      <listitem>
254*2d1272b8SAndroid Build Coastguard Worker	<para>
255*2d1272b8SAndroid Build Coastguard Worker	  The <emphasis>Arabic</emphasis> shaping model supports
256*2d1272b8SAndroid Build Coastguard Worker	  Arabic, Mongolian, N'Ko, Syriac, and several other connected
257*2d1272b8SAndroid Build Coastguard Worker	  or cursive scripts.
258*2d1272b8SAndroid Build Coastguard Worker	</para>
259*2d1272b8SAndroid Build Coastguard Worker      </listitem>
260*2d1272b8SAndroid Build Coastguard Worker
261*2d1272b8SAndroid Build Coastguard Worker      <listitem>
262*2d1272b8SAndroid Build Coastguard Worker	<para>
263*2d1272b8SAndroid Build Coastguard Worker	  The <emphasis>Thai/Lao</emphasis> shaping model supports
264*2d1272b8SAndroid Build Coastguard Worker	  the Thai and Lao scripts.
265*2d1272b8SAndroid Build Coastguard Worker	</para>
266*2d1272b8SAndroid Build Coastguard Worker      </listitem>
267*2d1272b8SAndroid Build Coastguard Worker
268*2d1272b8SAndroid Build Coastguard Worker      <listitem>
269*2d1272b8SAndroid Build Coastguard Worker	<para>
270*2d1272b8SAndroid Build Coastguard Worker	  The <emphasis>Khmer</emphasis> shaping model supports the
271*2d1272b8SAndroid Build Coastguard Worker	  Khmer script.
272*2d1272b8SAndroid Build Coastguard Worker	</para>
273*2d1272b8SAndroid Build Coastguard Worker      </listitem>
274*2d1272b8SAndroid Build Coastguard Worker
275*2d1272b8SAndroid Build Coastguard Worker      <listitem>
276*2d1272b8SAndroid Build Coastguard Worker	<para>
277*2d1272b8SAndroid Build Coastguard Worker	  The <emphasis>Myanmar</emphasis> shaping model supports the
278*2d1272b8SAndroid Build Coastguard Worker	  Myanmar (or Burmese) script.
279*2d1272b8SAndroid Build Coastguard Worker	</para>
280*2d1272b8SAndroid Build Coastguard Worker      </listitem>
281*2d1272b8SAndroid Build Coastguard Worker
282*2d1272b8SAndroid Build Coastguard Worker      <listitem>
283*2d1272b8SAndroid Build Coastguard Worker	<para>
284*2d1272b8SAndroid Build Coastguard Worker	  The <emphasis>Tibetan</emphasis> shaping model supports the
285*2d1272b8SAndroid Build Coastguard Worker	  Tibetan script.
286*2d1272b8SAndroid Build Coastguard Worker	</para>
287*2d1272b8SAndroid Build Coastguard Worker      </listitem>
288*2d1272b8SAndroid Build Coastguard Worker
289*2d1272b8SAndroid Build Coastguard Worker      <listitem>
290*2d1272b8SAndroid Build Coastguard Worker	<para>
291*2d1272b8SAndroid Build Coastguard Worker	  The <emphasis>Hangul</emphasis> shaping model supports the
292*2d1272b8SAndroid Build Coastguard Worker	  Hangul script.
293*2d1272b8SAndroid Build Coastguard Worker	</para>
294*2d1272b8SAndroid Build Coastguard Worker      </listitem>
295*2d1272b8SAndroid Build Coastguard Worker
296*2d1272b8SAndroid Build Coastguard Worker      <listitem>
297*2d1272b8SAndroid Build Coastguard Worker	<para>
298*2d1272b8SAndroid Build Coastguard Worker	  The <emphasis>Hebrew</emphasis> shaping model supports the
299*2d1272b8SAndroid Build Coastguard Worker	  Hebrew script.
300*2d1272b8SAndroid Build Coastguard Worker	</para>
301*2d1272b8SAndroid Build Coastguard Worker      </listitem>
302*2d1272b8SAndroid Build Coastguard Worker
303*2d1272b8SAndroid Build Coastguard Worker      <listitem>
304*2d1272b8SAndroid Build Coastguard Worker	<para>
305*2d1272b8SAndroid Build Coastguard Worker	  The <emphasis>Universal Shaping Engine</emphasis> (USE)
306*2d1272b8SAndroid Build Coastguard Worker	  shaping model supports scripts not covered by one of
307*2d1272b8SAndroid Build Coastguard Worker	  the above, script-specific shaping models, including
308*2d1272b8SAndroid Build Coastguard Worker	  Javanese, Balinese, Buginese, Batak, Chakma, Lepcha, Modi,
309*2d1272b8SAndroid Build Coastguard Worker	  Phags-pa, Tagalog, Siddham, Sundanese, Tai Le, Tai Tham, Tai
310*2d1272b8SAndroid Build Coastguard Worker	  Viet, and many others.
311*2d1272b8SAndroid Build Coastguard Worker	</para>
312*2d1272b8SAndroid Build Coastguard Worker      </listitem>
313*2d1272b8SAndroid Build Coastguard Worker
314*2d1272b8SAndroid Build Coastguard Worker      <listitem>
315*2d1272b8SAndroid Build Coastguard Worker	<para>
316*2d1272b8SAndroid Build Coastguard Worker	  Text runs that do not fall under one of the above shaping
317*2d1272b8SAndroid Build Coastguard Worker	  models may still require processing by a shaping engine. Of
318*2d1272b8SAndroid Build Coastguard Worker	  particular note is <emphasis>Emoji</emphasis> shaping, which
319*2d1272b8SAndroid Build Coastguard Worker	  may involve variation-selector sequences and glyph
320*2d1272b8SAndroid Build Coastguard Worker	  substitution. Emoji shaping is handled by the default
321*2d1272b8SAndroid Build Coastguard Worker	  shaping model.
322*2d1272b8SAndroid Build Coastguard Worker	</para>
323*2d1272b8SAndroid Build Coastguard Worker      </listitem>
324*2d1272b8SAndroid Build Coastguard Worker
325*2d1272b8SAndroid Build Coastguard Worker    </itemizedlist>
326*2d1272b8SAndroid Build Coastguard Worker
327*2d1272b8SAndroid Build Coastguard Worker  </section>
328*2d1272b8SAndroid Build Coastguard Worker
329*2d1272b8SAndroid Build Coastguard Worker  <section id="graphite-shaping">
330*2d1272b8SAndroid Build Coastguard Worker    <title>Graphite shaping</title>
331*2d1272b8SAndroid Build Coastguard Worker    <para>
332*2d1272b8SAndroid Build Coastguard Worker      In contrast to OpenType shaping, Graphite shaping does not
333*2d1272b8SAndroid Build Coastguard Worker      specify a predefined set of shaping models or a set of supported
334*2d1272b8SAndroid Build Coastguard Worker      scripts.
335*2d1272b8SAndroid Build Coastguard Worker    </para>
336*2d1272b8SAndroid Build Coastguard Worker    <para>
337*2d1272b8SAndroid Build Coastguard Worker      Instead, each Graphite font contains a complete set of rules that
338*2d1272b8SAndroid Build Coastguard Worker      implement the required shaping model for the intended
339*2d1272b8SAndroid Build Coastguard Worker      script. These rules include finite-state machines to match
340*2d1272b8SAndroid Build Coastguard Worker      sequences of codepoints to the shaping operations to perform.
341*2d1272b8SAndroid Build Coastguard Worker    </para>
342*2d1272b8SAndroid Build Coastguard Worker    <para>
343*2d1272b8SAndroid Build Coastguard Worker      Graphite shaping can perform the same shaping operations used in
344*2d1272b8SAndroid Build Coastguard Worker      OpenType shaping, as well as other functions that have not been
345*2d1272b8SAndroid Build Coastguard Worker      defined for OpenType shaping.
346*2d1272b8SAndroid Build Coastguard Worker    </para>
347*2d1272b8SAndroid Build Coastguard Worker  </section>
348*2d1272b8SAndroid Build Coastguard Worker
349*2d1272b8SAndroid Build Coastguard Worker  <section id="aat-shaping">
350*2d1272b8SAndroid Build Coastguard Worker    <title>AAT shaping</title>
351*2d1272b8SAndroid Build Coastguard Worker    <para>
352*2d1272b8SAndroid Build Coastguard Worker      In contrast to OpenType shaping, AAT shaping does not specify a
353*2d1272b8SAndroid Build Coastguard Worker      predefined set of shaping models or a set of supported scripts.
354*2d1272b8SAndroid Build Coastguard Worker    </para>
355*2d1272b8SAndroid Build Coastguard Worker    <para>
356*2d1272b8SAndroid Build Coastguard Worker      Instead, each AAT font includes a complete set of rules that
357*2d1272b8SAndroid Build Coastguard Worker      implement the desired shaping model for the intended
358*2d1272b8SAndroid Build Coastguard Worker      script. These rules include finite-state machines to match glyph
359*2d1272b8SAndroid Build Coastguard Worker      sequences and the shaping operations to perform.
360*2d1272b8SAndroid Build Coastguard Worker    </para>
361*2d1272b8SAndroid Build Coastguard Worker    <para>
362*2d1272b8SAndroid Build Coastguard Worker      Notably, AAT shaping rules are expressed for glyphs in the font,
363*2d1272b8SAndroid Build Coastguard Worker      not for Unicode codepoints. AAT shaping can perform the same
364*2d1272b8SAndroid Build Coastguard Worker      shaping operations used in OpenType shaping, as well as other
365*2d1272b8SAndroid Build Coastguard Worker      functions that have not been defined for OpenType shaping.
366*2d1272b8SAndroid Build Coastguard Worker    </para>
367*2d1272b8SAndroid Build Coastguard Worker  </section>
368*2d1272b8SAndroid Build Coastguard Worker</chapter>
369