• 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: how to prevent baseline shift when using NSSuperscriptAttributeName on a NSTextView's NSAttributedString ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: how to prevent baseline shift when using NSSuperscriptAttributeName on a NSTextView's NSAttributedString ?
      • From: Ross Carter <email@hidden>
References: 
 >how to prevent baseline shift when using NSSuperscriptAttributeName on a NSTextView's NSAttributedString ? (From: Rua Haszard Morris <email@hidden>)

  • Prev by Date: Re: setFirstResponder to NSTextField fails 1st time, works next
  • Next by Date: Re: StopWatch Application Help
  • Previous by thread: NSBaselineOffsetAttributeName support in NSTextField - bug? Re: how to prevent baseline shift when using NSSuperscriptAttributeName on a NSTextView's NSAttributedString ?
  • Next by thread: Re: how to prevent baseline shift when using NSSuperscriptAttributeName on a NSTextView's NSAttributedString ?
  • Index(es):
    • Date
    • Thread