+ }
+
+ if (!orderFeatures && (order > 1)) {
+ OpenTypeUtilities::sort(lookupOrderArray, order);
+
+ // If there's no specified feature order,
+ // we will apply the lookups in the order
+ // that they're in the font. If a particular
+ // lookup may be referenced by more than one feature,
+ // it will apprear in the lookupOrderArray more than
+ // once, so remove any duplicate entries in the sorted array.
+ le_int32 out = 1;
+
+ for (le_int32 in = 1; in < order; in += 1) {
+ if (lookupOrderArray[out - 1] != lookupOrderArray[in]) {
+ if (out != in) {
+ lookupOrderArray[out] = lookupOrderArray[in];
+ }