• 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
NSTextView font line height
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTextView font line height


  • Subject: NSTextView font line height
  • From: Duncan Campbell <email@hidden>
  • Date: Thu, 17 Mar 2005 19:13:14 +1100

Hey folks,

say i am setting the font of an NSTextView:

[myTextView setFont:[NSFont fontWithName:@"Monaco" size:10]];

this will give me Monaco font, size 10.

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..

The reason I am doing this is I am trying to create a linenumberTextView like XCode - where the line number font is smaller than the edit-area font, but the line height is the same.

Any help, much appreciated.

D.

---------------------------------------------------------------
Duncan Campbell
http://www.duncanandsarah.com/duncan
---------------------------------------------------------------

_______________________________________________
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


  • Follow-Ups:
    • Re: NSTextView font line height
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: Getting notified when a document closes
  • Next by Date: Re: is glyph halfwidth or fullwidth
  • Previous by thread: Re: Two questions about NSCalendarDate
  • Next by thread: Re: NSTextView font line height
  • Index(es):
    • Date
    • Thread