Skip to content

Instantly share code, notes, and snippets.

@Bradysm
Created March 28, 2020 18:26
Show Gist options
  • Save Bradysm/661b75e7c1e8d6fcdb291f911460457e to your computer and use it in GitHub Desktop.
Save Bradysm/661b75e7c1e8d6fcdb291f911460457e to your computer and use it in GitHub Desktop.
Font name generator
// place this function in a .onAppear() lifecycle call on your root view
// credit to apple https://developer.apple.com/documentation/uikit/text_display_and_fonts/adding_a_custom_font_to_your_app
// Created By: Brady Murphy
func getCustomFontNames() {
// get each of the font families
for family in UIFont.familyNames.sorted() {
let names = UIFont.fontNames(forFamilyName: family)
// print array of names
print("Family: \(family) Font names: \(names)")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment