(OTF_check_features): If the MSB of a feature tag
authorhanda <handa>
Fri, 24 Jun 2005 02:13:10 +0000 (02:13 +0000)
committerhanda <handa>
Fri, 24 Jun 2005 02:13:10 +0000 (02:13 +0000)
is set, treat it as a negation flag.

src/otfopen.c

index b9e93fd..b484003 100644 (file)
@@ -2955,13 +2955,23 @@ OTF_check_features (OTF *otf, int gsubp,
   for (j = 0; j < n_features; j++)
     {
       OTF_Tag feature = features[j];
+      int negate = 0;
 
       if (feature == 0)
        continue;
+      if (((unsigned) feature) & 0x80000000)
+       {
+         feature = (OTF_Tag) (((unsigned) feature) & 0x7FFFFFFF);
+         negate = 1;
+       }
       for (i = 0; i < LangSys->FeatureCount; i++)
        if (feature_list->Feature[LangSys->FeatureIndex[i]].FeatureTag
            == feature)
-         break;
+         {
+           if (negate)
+             return 0;
+           break;
+         }
       if (i == LangSys->FeatureCount)
        return 0;
     }