diff --git a/Packages/vChewing_PopupCompositionBuffer/Sources/PopupCompositionBuffer/PopupCompositionBuffer.swift b/Packages/vChewing_PopupCompositionBuffer/Sources/PopupCompositionBuffer/PopupCompositionBuffer.swift index 47f730d8..98398cef 100644 --- a/Packages/vChewing_PopupCompositionBuffer/Sources/PopupCompositionBuffer/PopupCompositionBuffer.swift +++ b/Packages/vChewing_PopupCompositionBuffer/Sources/PopupCompositionBuffer/PopupCompositionBuffer.swift @@ -84,6 +84,7 @@ public class PopupCompositionBuffer: NSWindowController { return newStyle }(), ] + let horizontalAttributes: [NSAttributedString.Key: Any] = [.kern: 0] if isTypingDirectionVertical { attrPCBHeader.setAttributes( @@ -92,6 +93,13 @@ public class PopupCompositionBuffer: NSWindowController { attrString.setAttributes( verticalAttributes, range: NSRange(location: 0, length: attrString.length) ) + } else { + attrPCBHeader.setAttributes( + horizontalAttributes, range: NSRange(location: 0, length: attrPCBHeader.length) + ) + attrString.setAttributes( + horizontalAttributes, range: NSRange(location: 0, length: attrString.length) + ) } let markerAttributes: [NSAttributedString.Key: Any] = { @@ -144,10 +152,6 @@ public class PopupCompositionBuffer: NSWindowController { attrString.insert(attrPCBHeader, at: 0) attrString.insert(attrPCBHeader, at: attrString.length) - attrString.setAttributes( - [.kern: 0], range: NSRange(location: 0, length: attrString.length) - ) - textShown = attrString messageTextField.maximumNumberOfLines = 1 if let editor = messageTextField.currentEditor() {