Clean up code

parent 315b6d8a
......@@ -139,12 +139,16 @@ class ViewController: UIViewController, UITextViewDelegate {
guard let fontSet = betterFonts[fontSize] else { fatalError("Could get get font set for \(fontSize)")}
let titleQuarterLineHeight = fontSet.title.lineHeight / 4.0
let titleOneSixteenthLineHeight = fontSet.title.lineHeight / 16.0
let bodyQuarterLineHeight = fontSet.body.lineHeight / 4.0
let titleStyle = StringStyle(
.adapt(.body),
.font(fontSet.title),
.color(.black),
.lineHeightMultiple(0.75),
.paragraphSpacingAfter(fontSet.title.lineHeight/4.0)
.paragraphSpacingAfter(titleQuarterLineHeight)
)
let bodyStyle = StringStyle(
......@@ -153,7 +157,7 @@ class ViewController: UIViewController, UITextViewDelegate {
.color(.gray)
)
let linkStyle = bodyStyle.byAdding(.paragraphSpacingBefore(fontSet.body.lineHeight/4.0))
let linkStyle = bodyStyle.byAdding(.paragraphSpacingBefore(bodyQuarterLineHeight))
var statusAttributedString:NSMutableAttributedString
var statusImage:UIImage!
......@@ -197,7 +201,7 @@ class ViewController: UIViewController, UITextViewDelegate {
self.statusTextView.isScrollEnabled = true
// Make the context of the status text view start flush at the edges.
self.statusTextView.contentOffset = CGPoint(x: 0.0, y: fontSet.title.lineHeight/16.0)
self.statusTextView.contentOffset = CGPoint(x: 0.0, y: titleOneSixteenthLineHeight)
}
statusTextView.isScrollEnabled = false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment