I am able to change the Font in NSTextView AFTER I have loaded some text.
but how can I set this Font as the default Font?
if the user starts typing in an empty NsTextView control, the Font always returns to the controls default Font which seems to be 'Helvetica Regular', size 12
Ok, after a lot of try and error I found a solution:
let font = NSFont(name: "Lucida Sans", size: 18)
let attributes = NSDictionary(object: font!, forKey: NSFontAttributeName)
nameTextView.typingAttributes = attributes
I put that code lines in function awakefromNib
The following works for me
func applicationDidFinishLaunching(aNotification: NSNotification) {
// Insert code here to initialize your application
nameTextView.font = NSFont(name: "Lucida Sans", size: 15)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With