From: handa Date: Thu, 27 Nov 2008 02:08:18 +0000 (+0000) Subject: (setup_lookup_indices): New arg LangSys. X-Git-Tag: REL-0-9-9~43 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d3ef335024d3e1d3541d0f5b5ac534b5fbf3630;p=m17n%2Flibotf.git (setup_lookup_indices): New arg LangSys. (OTF_drive_gsub_internal, OTF_drive_gpos): Adjusted for the above change. --- diff --git a/src/otfdrive.c b/src/otfdrive.c index 3dc6eda..e843967 100644 --- a/src/otfdrive.c +++ b/src/otfdrive.c @@ -204,6 +204,7 @@ get_langsys (OTF_ScriptList *script_list, 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; @@ -222,13 +223,17 @@ setup_lookup_indices (OTF_LookupList *LookupList, OTF_FeatureList *FeatureList, 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; } @@ -242,9 +247,9 @@ setup_lookup_indices (OTF_LookupList *LookupList, OTF_FeatureList *FeatureList, 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]) @@ -1389,7 +1394,7 @@ OTF_drive_gsub_internal (OTF *otf, OTF_GlyphString *gstring, * (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; @@ -1466,7 +1471,7 @@ OTF_drive_gpos (OTF *otf, OTF_GlyphString *gstring, * (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;