Last active
April 4, 2018 20:02
-
-
Save emarashliev/0d3d49638f8f9ef0f2091bd62a3b09d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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