Re: How to change default font for NSTextView?
Re: How to change default font for NSTextView?
- Subject: Re: How to change default font for NSTextView?
- From: David Rehring <email@hidden>
- Date: Wed, 13 Feb 2002 11:25:57 -0800
On 2/13/02 9:40 AM, Douglas Davidson at email@hidden wrote:
>
On Wednesday, February 13, 2002, at 04:27 AM, Manfred Lippert wrote:
>
>
> how can I set the default font of an NSTextView?
>
> In my program it is always set to Helvetica, but it would fit better to
>
> the
>
> rest of the system if it was Lucida Grande.
>
>
The default font for text that has no font attribute set is 12-pt
>
Helvetica. However, it is always possible for you to set the font or
>
fonts for any text, by calling the appropriate NSMutableAttributedString
>
methods on your text storage. Given a textview, you can call the NSText
>
method setFont: (always check the superclass) which will set the font
>
for the entire text and also in the typing attributes, which determine
>
the attributes to be applied to newly typed-in text. You can also set
>
the typing attributes directly, if that is what you want. If your
>
textview does not allow rich text, then after you set the font the user
>
will not be able to change it. If your textview does allow rich text,
>
then the user can change the font. Also bear in mind that characters
>
that cannot be displayed in the font you choose will be displayed in
>
some other suitable font.
However, setFont: does NOT work until AFTER there is some text in the
NSTextView.
As well, if the user deletes all the text in the NSTextView, the font
reverts to the default font.
Very lame.
Later,
--
David Rehring Psychos do not explode when light hits
Senior Software Engineer them, no matter how crazy they are...
Atimi Software, Inc.
www.atimi.com And totally insane guy!
_______________________________________________
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.