+ LEReferenceTo<FeatureTable> requiredFeatureTable;
+ LETag requiredFeatureTag = 0x00000000U;
+
+ // Count the total number of lookups referenced by all features. This will
+ // be the maximum number of entries in the lookupOrderArray. We can't use
+ // lookupListCount because some lookups might be referenced by more than
+ // one feature.
+ if(featureListTable.isValid() && LE_SUCCESS(success)) {
+ LEReferenceToArrayOf<le_uint16> featureIndexArray(langSysTable, success, langSysTable->featureIndexArray, featureCount);
+
+ for (le_uint32 feature = 0; LE_SUCCESS(success)&&(feature < featureCount); feature += 1) {
+ le_uint16 featureIndex = SWAPW(featureIndexArray.getObject(feature, success));
+
+ featureTable = featureListTable->getFeatureTable(featureListTable, featureIndex, &featureTag, success);
+ if (!featureTable.isValid() || LE_FAILURE(success)) {
+ continue;
+ }
+ featureReferences += SWAPW(featureTable->lookupCount);
+ }
+ }
+
+ if (!featureTable.isValid() || LE_FAILURE(success)) {
+ success = LE_INTERNAL_ERROR;
+ return;
+ }