Lines Matching full:cluster
12 In text shaping, a <emphasis>cluster</emphasis> is a sequence of
14 unit. A single letter or symbol can be a cluster of its
17 — and require the shaper to ensure that the cluster is not
21 A cluster is distinct from a <emphasis>grapheme</emphasis>,
36 cluster and are treated as a unit by the shaping engine —
56 HarfBuzz records cluster information independently from how
59 utilize the cluster information to implement features such as:
107 assigned a <emphasis>cluster value</emphasis>.
110 This cluster value is an arbitrary number; HarfBuzz uses it only
113 cluster value. This is for the sake of convenience; the actual
119 — may alter the cluster values of some characters. The
120 final cluster values in the buffer at the end of the shaping
122 glyphs represent a cluster and, therefore, must not be
126 In addition, client programs can query the final cluster values
132 For example, if the initial sequence of cluster values was:
138 and the final sequence of cluster values is:
145 cluster includes the first two glyphs, and the second cluster
153 initial cluster values in any manner they choose to, HarfBuzz
154 does offer some useful guarantees if the cluster values are
162 are guaranteed that monotonically increasing initial cluster
164 cluster values.
172 monotonically increasing initial cluster values will be
174 cluster values.
195 assigned the cluster value of the closest preceding code
201 reassigned to the same initial cluster value as the base
204 the Grapheme Cluster Boundary specification in <ulink
209 This cluster level is suitable for code that likes to use
210 HarfBuzz cluster values as an approximation of the Unicode
211 Grapheme Cluster Boundaries as well.
229 preceding "base" code point's cluster. By preserving the
230 separate cluster values of these marks and modifier code
244 treats cluster values. In level 2, HarfBuzz never merges
263 assign initial cluster values in a buffer by reusing the indices
265 cluster values that is monotonically increasing (for example,
269 It is not <emphasis>required</emphasis> that the cluster values
271 cluster values in a buffer are monotonic and the buffer is
272 configured to use cluster level 0 or 1, then HarfBuzz
273 guarantees that the final cluster values in the shaped buffer
274 will also be monotonic. No such guarantee is made for cluster
279 model for cluster values:
284 If the sequence of input cluster values is monotonic, the
285 sequence of cluster values will remain monotonic.
290 Each cluster value represents a single cluster.
295 Each cluster contains one or more glyphs and one or more
302 the initial cluster values were monotonically increasing
308 All adjacent glyphs having the same final cluster
309 value belong to the same cluster.
314 Each character belongs to the cluster that has the highest
315 cluster value <emphasis>not larger than</emphasis> its
316 initial cluster value.
332 resulting merged cluster takes as its cluster value the
333 <emphasis>minimum</emphasis> of the incoming cluster values.
338 When a cluster <emphasis>decomposes</emphasis>, all of the
339 resulting child clusters inherit as their cluster value the
340 cluster value of the parent cluster.
347 moves past as part of the reordering are merged into one cluster.
354 what happens with cluster values when shaping involves cluster
360 initial cluster values (bottom row):
378 "merge". This merged cluster takes for its cluster
379 value the minimum of all the cluster values of the clusters that
388 cluster values of <literal>B</literal> and
394 decomposes into two components. Whenever a cluster decomposes,
395 its components each inherit the cluster value of their parent:
403 ligature, then their clusters (cluster values 1 and 3) merge into
411 Note that the entirety of cluster 3 merges into cluster 1, not
413 that the cluster <emphasis>must</emphasis> be treated as an
417 At this point, cluster 1 means: the character sequence
427 reordering. In order to maintain a monotonic cluster sequence
433 row) and initial cluster values (bottom row):
452 as the final cluster sequence.
457 sequence of cluster values remains monotonic and to retain the
465 cluster levels 0 and 1. The only difference between the two
467 process, HarfBuzz merges the cluster of each base character
473 (top row) and accompanying initial cluster values (bottom row):
481 using cluster level 0 on this sequence, then the
494 This initial cluster merging is the default behavior of the
500 But this initial cluster-merging behavior makes it impossible
507 For client programs that rely on HarfBuzz cluster values to
509 relying on cluster boundaries for cursor positioning is wrong: cursor
511 boundaries, not on shaping-cluster boundaries. As such, using
524 cluster, HarfBuzz makes sure to merge the deleted glyph's
525 cluster with a neighboring cluster.
528 This is done primarily to make sure that the starting cluster of the
529 text always has the cluster index pointing to the start of the text
544 HarfBuzz's level 2 cluster behavior uses a significantly
555 ligature substitutions do not trigger a cluster merge.
564 When a cluster <emphasis>decomposes</emphasis>, all of the
565 resulting child clusters inherit as their cluster value the
566 cluster value of the parent cluster.
572 substitutes multiple glyphs with one glyph) the cluster value
573 of the first glyph is retained as the cluster value for the
577 This occurrence sounds similar to a cluster merge, but it is
580 their previous cluster values.
583 Level 2 cluster behavior is ultimately less complex than level 0
585 cluster values produced at level 2 may be tricky.
590 The first example of how HarfBuzz's level 2 cluster behavior
596 characters (top row) and initial cluster values (bottom row):
604 then these are the cluster values HarfBuzz will return under
605 the various cluster levels:
630 program, because there is nothing in the cluster values that
635 In contrast, the "merged" cluster values of the mark glyphs
643 Another example of how HarfBuzz's level 2 cluster behavior
645 with the following characters (top row) and initial cluster
654 <literal>B</literal> in a reordering operation. The cluster
682 these two scenarios based on the cluster values