[OTLayout] Respect syllable boundaries for backtrack/lookahead matching
authorBehdad Esfahbod <behdad@behdad.org>
Fri, 15 Feb 2013 12:02:08 +0000 (07:02 -0500)
committerBehdad Esfahbod <behdad@behdad.org>
Fri, 15 Feb 2013 12:02:08 +0000 (07:02 -0500)
Originally we meant to match backtrack/lookahead across syllable
boundaries.  But a bug in the code meant that this was NOT done for
backtrack.  We "fixed" that in 2c7d0b6b80d412de3fddd443ed1a485ea1cbb03c,
but that broke Myanmar shaping.

We now believe that for Indic-like shapers (which is where syllables are
used), all basic shaping forms should be fully contained within their
syllables, so now we limit backtrack/lookahead matching to the syllable
too.  Unbreaks Myanmar.

src/hb-ot-layout-gsubgpos-private.hh

index a709c32..a15dd23 100644 (file)
@@ -381,8 +381,8 @@ struct hb_apply_context_t
       if (!context_match)
       {
        matcher.set_mask (c->lookup_mask);
-       matcher.set_syllable (start_index_ == c->buffer->idx ? c->buffer->cur().syllable () : 0);
       }
+      matcher.set_syllable (start_index_ == c->buffer->idx ? c->buffer->cur().syllable () : 0);
     }
     inline void set_lookup_props (unsigned int lookup_props) { matcher.set_lookup_props (lookup_props); }
     inline void set_syllable (unsigned int syllable) { matcher.set_syllable (syllable); }
@@ -454,8 +454,8 @@ struct hb_apply_context_t
       if (!context_match)
       {
        matcher.set_mask (c->lookup_mask);
-       matcher.set_syllable (start_index_ == c->buffer->idx ? c->buffer->cur().syllable () : 0);
       }
+      matcher.set_syllable (start_index_ == c->buffer->idx ? c->buffer->cur().syllable () : 0);
     }
     inline void set_lookup_props (unsigned int lookup_props) { matcher.set_lookup_props (lookup_props); }
     inline void set_syllable (unsigned int syllable) { matcher.set_syllable (syllable); }