Skip to content

Commit

Permalink
Workaround for #384 Sequoia line height issue: Use Menlo font for tex…
Browse files Browse the repository at this point in the history
…t input views
  • Loading branch information
livid committed Oct 1, 2024
1 parent 64f0eb4 commit 2b0f5fa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Planet/Labs/Quick Post/QuickPostView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ struct QuickPostView: View {
.padding(.trailing, 0)

TextEditor(text: $viewModel.content)
.font(.system(size: 14, weight: .regular, design: .default))
.lineSpacing(4)
//.font(.system(size: 14, weight: .regular, design: .default))
.font(.custom("Menlo", size: 14.0))
.lineSpacing(4.0)
.disableAutocorrection(true)
.padding(.top, 10)
.padding(.bottom, 10)
Expand Down
6 changes: 4 additions & 2 deletions Planet/Writer/WriterTextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ struct WriterTextView: NSViewRepresentable {
@Binding var text: String
@State var selectedRanges: [NSValue] = []

var font: NSFont? = .monospacedSystemFont(ofSize: 14, weight: .regular)
// var font: NSFont? = .monospacedSystemFont(ofSize: 14, weight: .regular)
// Use 14pt Menlo font as default font
var font: NSFont? = NSFont(name: "Menlo", size: 14)

func makeCoordinator() -> Coordinator {
Coordinator(self)
Expand Down Expand Up @@ -139,7 +141,7 @@ class WriterCustomTextView: NSView {
}
}
}

deinit {
NotificationCenter.default.removeObserver(self)
}
Expand Down
3 changes: 2 additions & 1 deletion Planet/Writer/WriterTitleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ struct WriterTitleView: View {
Group {
if #available(macOS 13.0, *) {
TextField("Title", text: $title)
.font(.system(size: 15, weight: .regular, design: .default))
// .font(.system(size: 15, weight: .regular, design: .default))
.font(.custom("Menlo", size: 15.0))
.background(Color(NSColor.textBackgroundColor))
.textFieldStyle(PlainTextFieldStyle())
.focused($focusTitle, equals: titleIsFocused)
Expand Down

0 comments on commit 2b0f5fa

Please sign in to comment.