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: Andrew Farmer <email@hidden>
- Date: Mon, 21 Jul 2008 17:30:38 -0700
On 20 Jul 08, at 21:27, Rua Haszard Morris wrote:
I am using NSSuperscriptAttributeName to make part of a string
displayed in an NSTextView label display as superscript (to show "to
the power of 2"). I may also use a smaller font attribute to make
the "2" char smaller.
My problem is that thebaseline of the text drawn in the NSTextView
is moved down (presumably to accommodate the superscript 2) and the
label now looks wrong as the text doesn't line up with the other
edits and labels on the line in the dialog.
Is there a correct, standard way to keep the baseline fixed when
using an NSAttributedString in a NSTextView used as a label?
Devious solution: use the ² character (U+00B2, SUPERSCRIPT TWO). There
are characters in Unicode for superscript and subscript 0-9._______________________________________________
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