Re: CoreText & NSMutableParagraphStyle maximumLineHeight
Re: CoreText & NSMutableParagraphStyle maximumLineHeight
- Subject: Re: CoreText & NSMutableParagraphStyle maximumLineHeight
- From: Kyle Sluder <email@hidden>
- Date: Tue, 20 Aug 2013 01:09:48 -0700
On Mon, Aug 19, 2013, at 09:08 PM, Peter C wrote:
> maximumLineHeight when set to 1.0, the lines is maximum compacted to
> unreadable text. Gradual increase of the value, will see the lines
> expanding. However I discover it to be strange behaviour of
> maximumLineHeight (probably something I don't understand yet).
> maximumLineHeight does not correspond to font size for some font types.
> For some other fonts, maximumLineHeight is equivalent to font size. I try
> calculating from from font ascent, descent and leading value, it just
> does not add up.
>
> For example, for Helvetica font size of 12.0, maximumLineHeight is 15.0
> to equal as maximumLineHeight = 0.
The default line height of Helvetica is 14.0. That information is
encoded in the font. You can discover this for yourself by asking your
NSLayoutManager for its defaultLineHeightForFont:. This line height will
be used for text layout if the typesetter returns YES from
-usesFontLeading.
And of course, since 14 is less than 15, your maximumLineHeight is not
reached and thus you won't see any effect for values greater than 14.
--Kyle Sluder
_______________________________________________
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