Re: how to prevent baseline shift when using NSSuperscriptAttributeName on a NSTextView's NSAttributedString ?
Re: how to prevent baseline shift when using NSSuperscriptAttributeName on a NSTextView's NSAttributedString ?
- Subject: Re: how to prevent baseline shift when using NSSuperscriptAttributeName on a NSTextView's NSAttributedString ?
- From: Martin Wierschin <email@hidden>
- Date: Tue, 22 Jul 2008 16:40:55 -0700
Personally, I don't think NSSuperscriptAttributeName is
particularly useful. I just adjust the baseline and font size:
newFontSize = oldFontSize * 0.75, baseline for superscript += 0.4
* oldFontSize, baseline for subscript -= 0.3 * oldFontSize.
I do something very similar, but instead of using the font size, the
baseline is calculated using the ascender/descender:
baseline for superscript = font ascender * 0.4
baseline for subscript = font descender * 0.35 // descender is negative
I have no idea whether this is any better than using the font size-
both methods seem a bit makeshift.
~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