小文字のフォントを使用しようとしています。私はそれが小さな帽子を行うと主張したが、何かの男のウェブサイト上でUIFont拡張子が見つかりましたが、悲しいかな、幸運。何か案は?small capsの使い方は?
extension UIFont {
func smallCapsFontVariant(smallCapsForUppercase: Bool = true) -> UIFont {
var features = [
[UIFontFeatureTypeIdentifierKey: kLowerCaseType,
UIFontFeatureSelectorIdentifierKey: kLowerCaseSmallCapsSelector]
]
if smallCapsForUppercase {
features.append([UIFontFeatureTypeIdentifierKey: kUpperCaseType,
UIFontFeatureSelectorIdentifierKey: kUpperCaseSmallCapsSelector])
}
let smallCapsFontDescriptor = fontDescriptor().fontDescriptorByAddingAttributes([
UIFontDescriptorFeatureSettingsAttribute : features
])
return UIFont(descriptor: smallCapsFontDescriptor, size: 0d)
}
@LeoNatan私はそれを理解していますが、ユーザーは*の回答が必要な言語で質問にタグを付けることができます。その質問は、タグ付き言語に関するものである必要はありません。たとえば、ここで、私はOPがObjective-Cの答えを望んでいないという事実を知っています。 – Moritz