static int
setup_lookup_indices (OTF_LookupList *LookupList, OTF_FeatureList *FeatureList,
+ OTF_LangSys *LangSys,
const char *features, int *lookup_indices)
{
int i, j, n = 0;
if (*features == '*')
{
/* Consume all remaining features. */
- for (i = 0; i < FeatureList->FeatureCount; i++)
- if (! feature_table[i])
- {
- feature = FeatureList->Feature + i;
- for (j = 0; j < feature->LookupCount; j++)
- lookup_indices[n++] = feature->LookupListIndex[j];
- }
+ for (i = 0; i < LangSys->FeatureCount; i++)
+ {
+ int index = LangSys->FeatureIndex[i];
+
+ if (! feature_table[index])
+ {
+ feature = FeatureList->Feature + index;
+ for (j = 0; j < feature->LookupCount; j++)
+ lookup_indices[n++] = feature->LookupListIndex[j];
+ }
+ }
break;
}
for (; i < 4; i++)
tagname[i] = '\0';
tag = OTF_tag (tagname);
- for (i = 0; i < FeatureList->FeatureCount; i++)
+ for (i = 0; i < LangSys->FeatureCount; i++)
{
- feature = FeatureList->Feature + i;
+ feature = FeatureList->Feature + LangSys->FeatureIndex[i];
if (tag == feature->FeatureTag)
{
if (feature_table[i])
* (gsub->FeatureList.FeatureCount + 1));
if (! lookup_indices)
OTF_ERROR (OTF_ERROR_MEMORY, " feature list");
- n = setup_lookup_indices (&gsub->LookupList, &gsub->FeatureList,
+ n = setup_lookup_indices (&gsub->LookupList, &gsub->FeatureList, LangSys,
features, lookup_indices);
if (n < 0)
return errret;
* (gpos->FeatureList.FeatureCount + 1));
if (! lookup_indices)
OTF_ERROR (OTF_ERROR_MEMORY, " feature list");
- n = setup_lookup_indices (&gpos->LookupList, &gpos->FeatureList,
+ n = setup_lookup_indices (&gpos->LookupList, &gpos->FeatureList, LangSys,
features, lookup_indices);
if (n < 0)
return errret;