mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Merge pull request #170 from writeas/use-linespacing-in-blank-posts
Set typingAttributes for Mac post editor
This commit is contained in:
commit
91f84e01fa
@ -140,8 +140,8 @@ final class CustomTextView: NSView {
|
||||
layoutManager.addTextContainer(textContainer)
|
||||
|
||||
let paragraphStyle = NSMutableParagraphStyle()
|
||||
let lineHeightMultiple: CGFloat = 1.5
|
||||
paragraphStyle.lineHeightMultiple = lineHeightMultiple
|
||||
let lineSpacing: CGFloat = 8.5
|
||||
paragraphStyle.lineSpacing = lineSpacing
|
||||
|
||||
let textView = NSTextView(frame: .zero, textContainer: textContainer)
|
||||
textView.autoresizingMask = .width
|
||||
@ -162,6 +162,7 @@ final class CustomTextView: NSView {
|
||||
textView.usesFindPanel = true
|
||||
textView.isAutomaticDashSubstitutionEnabled = false
|
||||
textView.isRichText = false
|
||||
textView.typingAttributes = [.paragraphStyle: paragraphStyle, .font: font] // H/T Daniel Jalkut
|
||||
|
||||
return textView
|
||||
}()
|
||||
|
Loading…
Reference in New Issue
Block a user