Re: Messing with NSAttributedText
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