[英]Text Kit: Upper case Math symbols in San Francisco
在介紹新的系統字體時,顯示了以下屏幕截圖。 哪個UIFontDescriptorFeatureSettingsAttribute用於啟用此行為?
萬一其他人為此苦惱,這是我發現的功能,它將激活它:
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)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.