• 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
[NSMutableParagraphStyle setMinimumLineHeight] Confusion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[NSMutableParagraphStyle setMinimumLineHeight] Confusion


  • Subject: [NSMutableParagraphStyle setMinimumLineHeight] Confusion
  • From: Matt Gough <email@hidden>
  • Date: Mon, 20 Sep 2004 16:04:28 +0100

I am trying to use [NSMutableParagraphStyle setMinimumLineHeight], but am obviously missing something about what exactly the minimum line height means.

E.g Consider a paragraph containing nothing but 'M's, all with exactly the same font (E.g Lucida Grande Regular 20pt) and a minimumLineHeight of 50.

In this case, the vertical distance between the baselines is exactly 50 pixels, as expected.

However, if I change the Font to 'Hiragino Kaku Gothic Pro', also at 20pt, the distance between baselines ends up at 60 pixels (i.e 10 pixels too much for what I want).

Other fonts have varying differences from the wanted value.

Using TextEdit, you can replicate this discrepancy using the Spacing->Other option in the Ruler and setting the 'Line Height' to 'at least' 50 Points.

I guess there is some Font metric that I could be taking into account, but in my own tests, I could find nothing obvious that equated to the difference between the expected and actual baseline offsets. Also, since this is a paragraph attribute, it has to be able to cope with runs of different fonts.

FYI - I am trying to replicate (within the limitations of the Cocoa text system) the equivalent to Cascading Style Sheets' 'line-height' property.

What am I doing wrong?

Matt Gough

_______________________________________________
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: [NSMutableParagraphStyle setMinimumLineHeight] Confusion
      • From: Glenn Andreas <email@hidden>
  • Prev by Date: Re: -NSView setHidden: in 10.2
  • Next by Date: Re: -NSView setHidden: in 10.2
  • Previous by thread: Re: -NSView setHidden: in 10.2
  • Next by thread: Re: [NSMutableParagraphStyle setMinimumLineHeight] Confusion
  • Index(es):
    • Date
    • Thread