Re: NSTextView font line height
Re: NSTextView font line height
- Subject: Re: NSTextView font line height
- From: Douglas Davidson <email@hidden>
- Date: Thu, 17 Mar 2005 16:57:16 -0800
On 2005-03-17 00:13:14 -0800 Duncan Campbell
<email@hidden> wrote:
What if I want to have a different font:
[myTextView setFont:[NSFont fontWithName:@"Lucida Grande" size:9]];
But still have the LINE HEIGHT of the textView be the same as the
first
(Monaco size 10).
I know I can do something like:
[NSFont fontWithName:@"Monaco" size:10] defaultLineHeightForFont]
but i can't figure out how to apply this to the NSTextView..
You can set a minimum and/or maximum line height using a paragraph
style. You can apply a paragraph style to the text in a variety of
ways, the most obvious being to set it as the value for the
NSParagraphStyleAttributeName attribute on the text view's text
storage. Remember that NSTextStorage is a subclass of
NSMutableAttributedString.
Douglas Davidson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden