manpagez: man pages & more
html files: harfbuzz
Home | html | info | man

Level 2

Level 2 is a different beast from levels 0 and 1. It is simple to describe, but hard to make sense of. It simply doesn't do any cluster merging whatsoever. When things ligate or otherwise multiple glyphs turn into one, the cluster value of the first glyph is retained.

Here are a few examples of why processing cluster values produced at this level might be tricky:

Ligatures with combining marks

Imagine capital letters are bases and lower case letters are combining marks. With an input sequence like this:


if A,B,C ligate, then here are the cluster values one would get under the various levels:

level 0:

  0  ,0,0,0

level 1:

  0  ,0,0,5

level 2:

  0  ,1,3,5

Making sense of the last example is the hardest for a client, because there is nothing in the cluster values to suggest that B and C ligated with A.


Another tricky case is when things reorder. Under level 2:


Now imagine D moves before B:


Now, if D ligates with B, we get:

  0,3 ,2,4

In a different scenario, A and B could have ligated before D reordered; that would have resulted in:

  0 ,3,2,4   

There's no way to differentitate between these two scenarios based on the cluster numbers alone.

Another problem appens with ligatures under level 2 if the direction of the text is forced to opposite of its natural direction (e.g. left-to-right Arabic). But that's too much of a corner case to worry about.

© 2000-2017
Individual documents may contain additional copyright information.