Skip to content

Instantly share code, notes, and snippets.

@sauvikatinnofied
Last active February 16, 2019 05:54
Show Gist options
  • Save sauvikatinnofied/75b4a3b47c99e73380d15d22a1e77c8c to your computer and use it in GitHub Desktop.
Save sauvikatinnofied/75b4a3b47c99e73380d15d22a1e77c8c to your computer and use it in GitHub Desktop.
MediumBlogPost_FontHandling_Gist_3
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