Text Kit: Upper case Math symbols in San Francisco

228 Views Asked by At

In Introducing the new system fonts, the following screen shot was shown. Which UIFontDescriptorFeatureSettingsAttribute is used to enable this behaviour?

Click me

1

There are 1 best solutions below

0
Trevor Squires On

In case anyone else is struggling with this, here's the feature I found which will activate it:

let descriptor = UIFont.systemFontOfSize(24.0, weight: UIFontWeightLight).fontDescriptor()
let adjusted = descriptor.fontDescriptorByAddingAttributes(
    [
        UIFontDescriptorFeatureSettingsAttribute: [
            [
                UIFontFeatureTypeIdentifierKey: kCaseSensitiveLayoutType,
                UIFontFeatureSelectorIdentifierKey: kCaseSensitiveLayoutOnSelector
            ]
        ]
    ]
)
return UIFont(descriptor: adjusted, size: 24.0)