Last active
February 16, 2019 05:54
-
-
Save sauvikatinnofied/75b4a3b47c99e73380d15d22a1e77c8c to your computer and use it in GitHub Desktop.
MediumBlogPost_FontHandling_Gist_3
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
enum FontType { | |
case installed(FontName) | |
case custom(String) | |
case system | |
case systemBold | |
case systemItatic | |
case systemWeighted(weight: Double) | |
case monoSpacedDigit(size: Double, weight: Double) | |
} | |
enum FontSize { | |
case standard(StandardSize) | |
case custom(Double) | |
var value: Double { | |
switch self { | |
case .standard(let size): | |
return size.rawValue | |
case .custom(let customSize): | |
return customSize | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment