Last active
June 13, 2020 13:43
-
-
Save popcornomnom/1238714fea8d9a8efa109782958a5b99 to your computer and use it in GitHub Desktop.
This file contains 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
//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