Skip to content

Instantly share code, notes, and snippets.

@popcornomnom
Last active June 13, 2020 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save popcornomnom/1238714fea8d9a8efa109782958a5b99 to your computer and use it in GitHub Desktop.
Save popcornomnom/1238714fea8d9a8efa109782958a5b99 to your computer and use it in GitHub Desktop.
//put Family and Weight together
private class func stringName(_ family: Family, _ weight: CustomWeight) -> String {
let fontWeight: String
switch (family, weight) {
case (.inter, .heavy):
fontWeight = CustomWeight.semibold.rawValue
case (.inter, .light):
fontWeight = "\(weight.rawValue)BETA"
default:
fontWeight = weight.rawValue
}
let familyName = family.rawValue
return fontWeight.isEmpty ? "\(familyName)" : "\(familyName)-\(fontWeight)"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment