Re: SuperScript to baseline offset
Re: SuperScript to baseline offset
- Subject: Re: SuperScript to baseline offset
- From: Douglas Davidson <email@hidden>
- Date: Thu, 2 Dec 2004 17:23:20 -0800
On Dec 2, 2004, at 2:59 PM, Scott Thompson wrote:
If I bring in RTF text that contains superscript (or subscript)
information, the text attributes in that text range will contain the
NSSuperscriptAttributeName attribute but apparently not the
NSBaselineOffsetAttributeName.
At what point in the text layout process is NSSuperscriptAttributeName
"changed" into a baseline offset? If I want to change the way that
the SuperScript is represented (say by substituting a smaller point
size of the same font, or changing the magnitude of the baseline
shift) where would I insert my code?
The typesetter handles this while it lays out the text. While it is
possible to create a custom typesetter, it would not be
straightforward. I would suggest that you instead simply transform the
attributed string after you read it in from RTF, replacing the
superscript attribute with some combination of other attributes or
attribute changes. If you need to later write the text back out to
RTF, you may wish to perform the inverse transformation before doing
so; you could if you like place a custom attribute on the transformed
ranges to assist in this process.
Douglas Davidson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden