• 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: Line spacing in NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Line spacing in NSTextView


  • Subject: Re: Line spacing in NSTextView
  • From: Graham Cox <email@hidden>
  • Date: Sat, 14 Feb 2009 14:16:34 +1100


On 14 Feb 2009, at 1:15 pm, Slava Pestov wrote:

Hi all,

Can someone enlighten me, how does NSTextView compute line spacing?

When I display a piece of text in stickies, with Helvetica 12 (or any
other font, really), and the same piece of text in my application,
stickies adds another 2 pixels of spacing between every line, and the
result looks more legible. Otherwise the font rendering is identical.
I'm using Core Text to render each line individually, and I presume
Stickies is using an NSTextView. I'm computing line height by adding
the ascent, descent and leading, but for Helvetica 12 at least the
leading is zero.

Line spacing (or to be more precise, leading) is an attribute of the paragraph style. This is added to the lineheight of the font as you have calculated.


--Graham


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Line spacing in NSTextView
      • From: Slava Pestov <email@hidden>
References: 
 >Line spacing in NSTextView (From: Slava Pestov <email@hidden>)

  • Prev by Date: Re: How to handle clicks on NSOutlineView
  • Next by Date: Re: Programatically Uncheck "Change Picture" In Desktop Settings?
  • Previous by thread: Line spacing in NSTextView
  • Next by thread: Re: Line spacing in NSTextView
  • Index(es):
    • Date
    • Thread