Skip to content

Commit

Permalink
Removes lineHeightMultiplier from DefaultStringAttributes
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbs committed Mar 16, 2024
1 parent 392e97f commit c6e8d0e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Sources/Runestone/Library/DefaultStringAttributes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,23 @@ struct DefaultStringAttributes {
private let font: UIFont
private let kern: CGFloat
private let tabWidth: CGFloat
private let lineHeightMultiplier: CGFloat

init(
textColor: UIColor,
font: UIFont,
kern: CGFloat,
tabWidth: CGFloat,
lineHeightMultiplier: CGFloat = 1
tabWidth: CGFloat
) {
self.textColor = textColor
self.font = font
self.kern = kern
self.tabWidth = tabWidth
self.lineHeightMultiplier = lineHeightMultiplier
}

func apply(to attributedString: NSMutableAttributedString) {
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.tabStops = []
paragraphStyle.defaultTabInterval = tabWidth
paragraphStyle.lineHeightMultiple = lineHeightMultiplier
let range = NSRange(location: 0, length: attributedString.length)
let attributes: [NSAttributedString.Key: Any] = [
.foregroundColor: textColor,
Expand Down

0 comments on commit c6e8d0e

Please sign in to comment.