Re: Getting font attributes from an NSTextView
Re: Getting font attributes from an NSTextView
- Subject: Re: Getting font attributes from an NSTextView
- From: Douglas Davidson <email@hidden>
- Date: Mon, 18 Jul 2005 09:42:10 -0700
On Jul 17, 2005, at 5:00 PM, Ian was here wrote:
I need to get the font info for each bit of text in an
NSTextView because I am trying to convert the text
into XML tags.
<font face="some face" color="00ffffff">
<text>Hello</text>
</font>
Try attribute:atIndex:effectiveRange:, where the attribute name is
NSFontAttributeName, and an effective range is returned by
reference. You may also wish to consider
attribute:atIndex:longestEffectiveRange:inRange:, or some of the
other related methods. The documentation should describe the
differences between these.
Note that in 10.4 the text system will export HTML, including XHTML,
and the functionality is sufficiently flexible to enable you to
control precisely which tags are used. See the release notes for
details.
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