From 25262537765a795ad4593c0039e57c93b0eda8a5 Mon Sep 17 00:00:00 2001 From: handa Date: Mon, 9 Aug 2004 07:32:18 +0000 Subject: [PATCH] (setup_lookup_indices): Fix handling of "*" in features. --- src/otfdrive.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/otfdrive.c b/src/otfdrive.c index a857e68..463f3e6 100644 --- a/src/otfdrive.c +++ b/src/otfdrive.c @@ -199,33 +199,23 @@ setup_lookup_indices (OTF_LookupList *LookupList, OTF_FeatureList *FeatureList, { char tagname[4]; OTF_Tag tag; - int negate = 0; + int use_it = 1; if (*features == '*') { /* Consume all remaining features. */ - /* We are sure that the last LookupCount elements of - lookup_indices are free to be used for this work. */ - int *free_table = (lookup_indices + (LookupList->LookupCount - * FeatureList->FeatureCount)); - - for (i = 0; i < LookupList->LookupCount; i++) - free_table[i] = 0; for (i = 0; i < FeatureList->FeatureCount; i++) if (! feature_table[i]) { feature = FeatureList->Feature + i; for (j = 0; j < feature->LookupCount; j++) - free_table[feature->LookupListIndex[j]] = 1; + lookup_indices[n++] = feature->LookupListIndex[j]; } - for (i = 0; i < LookupList->LookupCount; i++) - if (free_table[i]) - lookup_indices[n++] = i; break; } if (*features == '~') - negate = 1, features++; + use_it = -1, features++; for (i = 0; *features && *features != ','; i++, features++) tagname[i] = *features; if (*features) @@ -239,10 +229,12 @@ setup_lookup_indices (OTF_LookupList *LookupList, OTF_FeatureList *FeatureList, feature = FeatureList->Feature + i; if (tag == feature->FeatureTag) { - if (! negate) + if (feature_table[i]) + break; + if (use_it > 0) for (j = 0; j < feature->LookupCount; j++) lookup_indices[n++] = feature->LookupListIndex[j]; - feature_table[i] = 1; + feature_table[i] = use_it; break; } } @@ -900,11 +892,9 @@ lookup_gpos (OTF_LookupList *lookup_list, unsigned lookup_list_index, if (subtable->Format == 1) { OTF_GPOS_MarkLig1 *mark_lig1 = &subtable->u.mark_lig1; - unsigned class = g->MarkAttachClass; OTF_Glyph *ligg; int coverage_idx_lig; OTF_MarkRecord *mark_record; - OTF_ComponentRecord *cmp_record; OTF_LigatureAttach *attach; int *num_class = alloca (sizeof (int) * mark_lig1->ClassCount); int j; -- 1.7.10.4