• 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: Getting font attributes from an NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Getting font attributes from an NSTextView (From: Ian was here <email@hidden>)

  • Prev by Date: Re: checking for clipping by other windows
  • Next by Date: Re: autorelease use...
  • Previous by thread: Getting font attributes from an NSTextView
  • Next by thread: Problems with a chain of bindings and search field
  • Index(es):
    • Date
    • Thread