Fix contextual lookup recursion indexing

See email thread "Skipping Control for Attaching Marks using OpenType"
from earlier this month.
This commit is contained in:
Behdad Esfahbod 2013-06-26 19:46:55 -04:00
parent f5da11e0fa
commit 3f9e2dced2
1 changed files with 2 additions and 8 deletions

View File

@ -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;