NSTextView CoreText 注释:客户端请求的名称

NSTextView CoreText note: Client requested name

NSTextView 上将字体设置为 .monospacedSystemFont Xcode 时显示有关无效字体的警告。示例:

CoreText note: Client requested name ".SFNSMono-Bold", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:]

NSTextView.typingAttributes设置相同的字体,例如:

let textView = NSTextView()
textView.typingAttributes[.font] = NSFont.monospacedSystemFont(ofSize: NSFont.systemFontSize, weight: .regular)
textView.font = .monospacedSystemFont(ofSize: NSFont.systemFontSize, weight: .regular)