Another common operation in the more complex shapers is when things reorder. In those cases, to maintain monotone clusters, HB merges the clusters of everything in the reordering sequence. For example, let's again start with the character sequence:
D is reordered before
D clusters merge, and we get:
This is clearly not ideal, but it is the only sensible way to maintain monotone indices and retain the true relationship between glyphs and characters.