Setting fixed pitch font (temporary) for NSTextView object
Setting fixed pitch font (temporary) for NSTextView object
- Subject: Setting fixed pitch font (temporary) for NSTextView object
- From: Gerben Wierda <email@hidden>
- Date: Tue, 19 Mar 2002 11:28:09 +0100
I have looked at the documentation and tried a lot of calls, but so far
I have not been able to set a text view to a fixed pitch font
temporarily (the same view sometimes displays RTF as well).
For instance, I tried:
[displayView setRichText:NO];
[displayView selectAll:nil];
[[displayView textStorage] applyFontTraits:NSFixedPitchFontMask
range:[displayView selectedRange]];
[displayView setString:stringData];
I also tried a different order of these calls, but whatever I do, the
font in this text view stays Helvetica. Is there a way to set this in a
simple manner so that I can use a normal non-attributed NSString? Or do
I have to do complex juggling with NSFont and attributed strings?
Thanks,
G
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.