• 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: CoreText & NSMutableParagraphStyle maximumLineHeight
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreText & NSMutableParagraphStyle maximumLineHeight


  • Subject: Re: CoreText & NSMutableParagraphStyle maximumLineHeight
  • From: Peter C <email@hidden>
  • Date: Tue, 20 Aug 2013 16:53:45 +0800

On 20 Aug, 2013, at 4:09 PM, Kyle Sluder <email@hidden> wrote:

> 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

That's it ! NSLayoutManager defaultLineHeightForFont works, thanks.

But only for NSFont. CTFontRef will the return same font size. I can live with that, get value from NSFont & NSLayoutManager before doing anything else.

I tested it, when the Helvetica  font size is 12.0, the default line height is 14.0 . If when the Helvetica font size is 18.0, the default line height of is 22.0.  Default line height is define by the font size.

-- Peter Chan



_______________________________________________

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


References: 
 >CoreText & NSMutableParagraphStyle maximumLineHeight (From: Peter C <email@hidden>)
 >Re: CoreText & NSMutableParagraphStyle maximumLineHeight (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: CoreText & NSMutableParagraphStyle maximumLineHeight
  • Next by Date: Re: CoreText & NSMutableParagraphStyle maximumLineHeight
  • Previous by thread: Re: CoreText & NSMutableParagraphStyle maximumLineHeight
  • Next by thread: Converting to Arc → undeclared identifier
  • Index(es):
    • Date
    • Thread