簡體   English   中英

文本工具包:舊金山的大寫數學符號

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM