File tree Expand file tree Collapse file tree
Sources/Runestone/Library Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,31 +2,15 @@ import Foundation
22import UIKit
33
44struct DefaultStringAttributes {
5- private let textColor : UIColor
6- private let font : UIFont
7- private let kern : CGFloat
8- private let tabWidth : CGFloat
9- private let lineHeightMultiplier : CGFloat
10-
11- init (
12- textColor: UIColor ,
13- font: UIFont ,
14- kern: CGFloat ,
15- tabWidth: CGFloat ,
16- lineHeightMultiplier: CGFloat = 1
17- ) {
18- self . textColor = textColor
19- self . font = font
20- self . kern = kern
21- self . tabWidth = tabWidth
22- self . lineHeightMultiplier = lineHeightMultiplier
23- }
5+ let textColor : UIColor
6+ let font : UIFont
7+ let kern : CGFloat
8+ let tabWidth : CGFloat
249
2510 func apply( to attributedString: NSMutableAttributedString ) {
2611 let paragraphStyle = NSMutableParagraphStyle ( )
2712 paragraphStyle. tabStops = [ ]
2813 paragraphStyle. defaultTabInterval = tabWidth
29- paragraphStyle. lineHeightMultiple = lineHeightMultiplier
3014 let range = NSRange ( location: 0 , length: attributedString. length)
3115 let attributes : [ NSAttributedString . Key : Any ] = [
3216 . foregroundColor: textColor,
You can’t perform that action at this time.
0 commit comments