             var fontAttributes = fontDescriptor.fontAttributes
             var features = fontAttributes[BONFontDescriptorFeatureSettingsAttribute] as? [StyleAttributes] ?? []
             if featureProviders.count > 0 {
-                let newFeatures = featureProviders.map() { $0.featureAttribute() }
+                let newFeatures = featureProviders.map() { $0.featureAttributes() }.flatMap { $0 }
                 features.append(contentsOf: newFeatures)
                 fontAttributes[BONFontDescriptorFeatureSettingsAttribute] = features
             }

    /// Protocol to provide values to be used by `UIFontFeatureTypeIdentifierKey` and `UIFontFeatureSelectorIdentifierKey`.
    /// You can typically find these values in CoreText.SFNTLayoutTypes
    public protocol FontFeatureProvider {
        func featureSettings() -> (type: Int, selector: Int)
    }

    public extension BONFont {

            case .ordinals: selector = kOrdinalsSelector
            case .scientificInferiors: selector = kScientificInferiorsSelector
            }
            return [(type: kVerticalPositionType, selector: selector)]
        }

    }

    extension FontFeatureProvider {

        /// - returns: an array of dictionaries, each representing one feature for the attributes key in the font attributes
        func featureAttributes() -> [StyleAttributes] {
            let featureSettings = self.featureSettings()
            return featureSettings.map {
                return [
                    BONFontFeatureTypeIdentifierKey: $0.type,
                    BONFontFeatureSelectorIdentifierKey: $0.selector,
                    ]
            }
        }
    }

