• 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
Drawing custom text attributes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drawing custom text attributes


  • Subject: Drawing custom text attributes
  • From: René Puls <email@hidden>
  • Date: Sun, 21 Dec 2003 18:31:14 +0100

Hi,

does anyone have some quick examples how to use custom attributes with the Cocoa text system? I know that I can just set arbitrary attributes on an NSAttributedString, but where do I go if I want these attributes to actually change the appearance of my text in an NSTextView?

For example, how would I implement an attribute similar to NSUnderlineStyleAttributeName, but which draws a line *above* the text instead of below? (Never mind if there is already such a thing, I just want to know how it is done.)

I think that I need to subclass NSLayoutManager and override some of the drawing methods; but they all look totally esoteric to me. A simple-and-stupid example would be most welcome. :-)

Kind regards,
Reni Puls
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Drawing custom text attributes
      • From: Douglas Davidson <email@hidden>
    • Re: Drawing custom text attributes
      • From: Jonathan Jackel <email@hidden>
  • Prev by Date: Re: Newbie - Buy book(s) or read free documentation, which is best ????
  • Next by Date: Re: Drawing custom text attributes
  • Previous by thread: Prevent setDisplayMode in Toolbars?
  • Next by thread: Re: Drawing custom text attributes
  • Index(es):
    • Date
    • Thread