• 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: Setting line height exactly - fails for certain unicode chars
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting line height exactly - fails for certain unicode chars


  • Subject: Re: Setting line height exactly - fails for certain unicode chars
  • From: Martin Wierschin <email@hidden>
  • Date: Mon, 2 Jul 2007 17:50:15 -0700

1. Is it even possible to "force" a line height like I am trying to do, or does setMaximumLineHeight / setMinimumLineHeight simply give the text system a hint as to which line height to use?

2. Assuming it is possible to accomplish what I am trying to do, can somebody please enlighten me as to how it should be done?

1. The text system does in fact use the min/max line height you have set. The problem is just that the "#" character dips lower than the rest of the characters, which decreases the baseline and adjusts the other characters upwards. This gives the appearance of unequal line heights.


2. You will need to subclass NSTypesetter and override:

	-willSetLineFragmentRect:forGlyphRange:usedRect:baselineOffset:

If you detect that the current paragraph style has an exact line height, you can adjust the baseline and line fragment rects to compensate. Good luck,

~Martin

_______________________________________________

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: Setting line height exactly - fails for certain unicode chars
      • From: "B.A. Winckler" <email@hidden>
References: 
 >Setting line height exactly - fails for certain unicode chars (From: "B.A. Winckler" <email@hidden>)

  • Prev by Date: NSURLConnection Threading Behavior
  • Next by Date: Re: NSPopupButton in main window changes when NSUserDefaultsController adds/removes item in Preference Pane
  • Previous by thread: Setting line height exactly - fails for certain unicode chars
  • Next by thread: Re: Setting line height exactly - fails for certain unicode chars
  • Index(es):
    • Date
    • Thread