The strange thing is that there only seem to be 3 baseline positions supported by NSTextField; any positive value, 0, and any negative value.

I assume you've seen this, from http://developer.apple.com/documentation/Cocoa/Conceptual/AttributedStrings/Articles/standardAttributes.html#/ /apple_ref/doc/uid/TP40004903

"The superscript attribute indicates an abstract level for both super- and subscripts. The user of the attributed string can interpret this as desired, adjusting the baseline by the same or a different amount for each level, changing the font size, or both."

Are you perhaps setting a baseline attribute _and_ a superscript attribute? It sounds like the Cocoa text system is adjusting the baseline according to its notion of superscripts and ignoring your baseline attribute value.

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.

If the only thing you need to draw is a superscript 2, I like Andrew's solution.

Ross
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to