• 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: 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


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

  • Prev by Date: Re: Binding TableColumn Programatically
  • Next by Date: Re: error building against sdk 10.5
  • Previous by thread: Re: how to prevent baseline shift when using NSSuperscriptAttributeName on a NSTextView's NSAttributedString ?
  • Next by thread: ikimagebrowserview + bindings
  • Index(es):
    • Date
    • Thread