• 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: Messing with NSAttributedText
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Messing with NSAttributedText


  • Subject: Re: Messing with NSAttributedText
  • From: Douglas Davidson <email@hidden>
  • Date: Tue, 26 Jun 2001 15:28:43 -0700

On Monday, June 25, 2001, at 02:54 PM, email@hidden wrote:

I have an NSTextView with Attributed Text in it. I currently
programmatically change the color of the text, but I do not know how to
change the baseline/kerning/etc.

For example, say I wanted to make text in an RTF zig zag up and down by
changing the baseline of the characters to 5, 4, 3, 2, 1, 0, -1, -2, -3,
-4, 5 and back over and over again instead of having the user change the
baseline manually dozens of times.

You would add one of the following attributes to change the baseline:

APPKIT_EXTERN NSString *NSSuperscriptAttributeName; /* int, default 0 */
APPKIT_EXTERN NSString *NSBaselineOffsetAttributeName; /* float, in points; offset from baseline, default 0 */

and the following attribute to change kerning:

APPKIT_EXTERN NSString *NSKernAttributeName; /* float, amount to modify default kerning, if 0, kerning off */

In each of these cases the value should be an NSNumber.

See the AppKit's NSAttributedString.h for more information.

Douglas Davidson


References: 
 >Messing with NSAttributedText (From: email@hidden)

  • Prev by Date: NSRect to QDRect and back
  • Next by Date: Thread Safe APIs?
  • Previous by thread: Messing with NSAttributedText
  • Next by thread: How doess Cocoa handle SIGINT?
  • Index(es):
    • Date
    • Thread