Re: Line spacing in NSTextView
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