【发布时间】:2020-01-29 17:04:40
【问题描述】:
下面的这段代码使我能够在 iOS 12 上创建小型大写字母。但是在 iOS 13 上它已停止工作。
iOS 12 日志
.SFUIDisplay-Semibold
.SFUIDisplay-Semibold
iOS 13 日志
.SFUI-Semibold
TimesNewRomanPSMT
SFUI 字体似乎至少在 iOS 13 中改名了,但它是否也放弃了对小型大写字母的支持?
let font = UIFont.systemFont(ofSize: 20, weight: .semibold)
print(font.fontName)
let settings = [[UIFontDescriptor.FeatureKey.featureIdentifier: kLowerCaseType,
UIFontDescriptor.FeatureKey.typeIdentifier: kLowerCaseSmallCapsSelector]]
let attributes: [UIFontDescriptor.AttributeName: AnyObject] = [UIFontDescriptor.AttributeName.featureSettings: settings as AnyObject,
UIFontDescriptor.AttributeName.name: font.fontName as AnyObject]
let smallCapsFont = UIFont(descriptor: UIFontDescriptor(fontAttributes: attributes), size: 20)
print(smallCapsFont.fontName)
【问题讨论】:
标签: ios swift xcode ios13 ios12