Rightpoint / BonMot

Beautiful, easy attributed strings in Swift
MIT License
3.54k stars 197 forks source link

.lineSpacing ignores default alignment #300

Closed armandsLa closed 6 years ago

armandsLa commented 7 years ago

I'm not sure if this is intended or not, but when .lineSpacing is added, textAlignemt set in IB is ignored. It does not happen when I add .tracking.

ZevEisenberg commented 7 years ago

That makes sense to me, because line spacing and text alignment are both specified using an NSParagraphStyle, and when you set the line spacing with BonMot, it clobbers the paragraph style that was set up in IB. My advice is to specify all your styling in one place: in code. Otherwise, you'll need to write code that can find the alignment already applied to the view, mix it into the StringStyle, and re-apply it to the view.