Skip to content

Instantly share code, notes, and snippets.

@emarashliev
Last active April 4, 2018 20:02
Show Gist options
  • Select an option

  • Save emarashliev/0d3d49638f8f9ef0f2091bd62a3b09d5 to your computer and use it in GitHub Desktop.

Select an option

Save emarashliev/0d3d49638f8f9ef0f2091bd62a3b09d5 to your computer and use it in GitHub Desktop.
let pointSize: CGFloat = 60
let systemFontDesc = UIFont.systemFont(ofSize: pointSize, weight: UIFont.Weight.light).fontDescriptor
let smallCapsFontDesc = systemFontDesc.addingAttributes(
[
UIFontDescriptor.AttributeName.featureSettings:
[
[
kCTFontFeatureTypeIdentifierKey: kLowerCaseType,
kCTFontFeatureSelectorIdentifierKey: kLowerCaseSmallCapsSelector
]
]
]
)
label.text = "Some text"
label.font = UIFont(descriptor: smallCapsFontDesc, size: label.font.pointSize)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment