• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTextView font line height
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSTextView font line height (From: Duncan Campbell <email@hidden>)

  • Prev by Date: Re: Masking an NSImage
  • Next by Date: Re: Getting notified when a document closes
  • Previous by thread: NSTextView font line height
  • Next by thread: Controlling a Mac via email
  • Index(es):
    • Date
    • Thread