Last active
January 3, 2017 22:53
-
-
Save sauvikatinnofied/b07390e9fc19d1d9c771195261603eae to your computer and use it in GitHub Desktop.
MediumBlogPost_FontHandling_Gist_4
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
struct Font { | |
enum FontType { | |
case installed(FontName) | |
// ... | |
} | |
enum FontSize { | |
case standard(StandardSize) | |
// ... | |
} | |
enum FontName: String { | |
case RobotoBlack = "Roboto-Black" | |
// ... | |
} | |
enum StandardSize: Double { | |
case h1 = 20.0 | |
// ... | |
} | |
// 1 | |
var type: FontType | |
var size: FontSize | |
// 2 | |
init(_ type: FontType, size: FontSize) { | |
self.type = type | |
self.size = size | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment