在介绍新系统字体时,显示以下屏幕截图。哪个UIFontDescriptorFeatureSettingsAttribute用于启用此行为?
答案 0 :(得分:1)
如果其他人正在努力解决这个问题,我发现这个功能会激活它:
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)