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:
Imagine capital letters are bases and lower case letters are combining marks. With an input sequence like this:
A,B,C ligate, then here are the cluster
values one would get under the various levels:
ABC,a,b,c 0 ,0,0,0
ABC,a,b,c 0 ,0,0,5
ABC,a,b,c 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
C ligated with
Another tricky case is when things reorder. Under level 2:
D moves before
D ligates with
A,DB,C,E 0,3 ,2,4
In a different scenario,
B could have ligated
D reordered; that
would have resulted in:
AB,D,C,E 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.