Last active
October 15, 2019 12:53
-
-
Save olejorgensen/2ea373c437315ccb0a7fece97bf13d93 to your computer and use it in GitHub Desktop.
Font Weights
This file contains hidden or 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
import SwiftUI | |
import MapKit | |
import PlaygroundSupport | |
struct FontContantsListView: View { | |
var body: some View { | |
VStack { | |
Section(header: Text("Font weights").font(.headline).padding()) { | |
List { | |
Text("\(String(describing: Font.Weight.black))").fontWeight(Font.Weight.black) | |
Text("\(String(describing: Font.Weight.heavy))").fontWeight(Font.Weight.heavy) | |
Text("\(String(describing: Font.Weight.bold))").fontWeight(Font.Weight.bold) | |
Text("\(String(describing: Font.Weight.semibold))").fontWeight(Font.Weight.semibold) | |
Text("\(String(describing: Font.Weight.medium))").fontWeight(Font.Weight.medium) | |
Text("\(String(describing: Font.Weight.regular))").fontWeight(Font.Weight.regular) | |
Text("\(String(describing: Font.Weight.light))").fontWeight(Font.Weight.light) | |
Text("\(String(describing: Font.Weight.thin))").fontWeight(Font.Weight.thin) | |
Text("\(String(describing: Font.Weight.ultraLight))").fontWeight(Font.Weight.ultraLight) | |
} | |
} | |
Section(header: Text("Font types").font(.headline).padding()) { | |
List { | |
Text("LargeTitle LARGETITLE").font(.largeTitle) | |
Text("Title TITLE").font(.title) | |
Text("Headline HEADLINE").font(.headline) | |
Text("Body BODY").font(.body) | |
Text("None NONE").font(.none) | |
Text("Callout CALLOUT").font(.callout) | |
Text("Subheadline SUBHEADLINE").font(.subheadline) | |
Text("Footnote FOOTNOTE").font(.footnote) | |
Text("Caption CAPTION").font(.caption) | |
} | |
} | |
} | |
} | |
} | |
let host = UIHostingController(rootView: FontContantsListView()) | |
PlaygroundPage.current.liveView = host |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment