Created
August 21, 2019 02:24
-
-
Save robinkunde/19e468a5b8a42ad8d40e25df3c7d892e to your computer and use it in GitHub Desktop.
Print certain font names
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
for familyName in UIFont.familyNames.sorted() { | |
var hasPrintedFamilyName = false | |
for fontName in UIFont.fontNames(forFamilyName: familyName).sorted() { | |
let font = UIFont(name: fontName, size: 16.0)! | |
guard font.fontDescriptor.symbolicTraits.contains(.traitMonoSpace) else { continue } | |
if !hasPrintedFamilyName { | |
print(familyName) | |
hasPrintedFamilyName = true | |
} | |
print(" " + fontName) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment