From 3f9e2dced298c3d00f31b2dfc38685bb071a3a22 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 26 Jun 2013 19:46:55 -0400 Subject: [PATCH] Fix contextual lookup recursion indexing See email thread "Skipping Control for Attaching Marks using OpenType" from earlier this month. --- src/hb-ot-layout-gsubgpos-private.hh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index 32c4a6d20..2b9500982 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -1009,15 +1009,12 @@ static inline bool apply_lookup (hb_apply_context_t *c, unsigned int i = 0; if (lookupCount && 0 == lookupRecord->sequenceIndex) { - unsigned int old_pos = c->buffer->idx; - /* Apply a lookup */ bool done = c->recurse (lookupRecord->lookupListIndex); lookupRecord++; lookupCount--; - /* Err, this is wrong if the lookup jumped over some glyphs */ - i += c->buffer->idx - old_pos; + i++; if (!done) goto not_applied; @@ -1044,15 +1041,12 @@ static inline bool apply_lookup (hb_apply_context_t *c, if (lookupCount && i == lookupRecord->sequenceIndex) { - unsigned int old_pos = c->buffer->idx; - /* Apply a lookup */ bool done = c->recurse (lookupRecord->lookupListIndex); lookupRecord++; lookupCount--; - /* Err, this is wrong if the lookup jumped over some glyphs */ - i += c->buffer->idx - old_pos; + i++; if (!done) goto not_applied2;