Re: Setting line height exactly - fails for certain unicode chars
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