• 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: Drawing text in NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing text in NSView


  • Subject: Re: Drawing text in NSView
  • From: Douglas Davidson <email@hidden>
  • Date: Thu, 5 Sep 2002 12:10:41 -0700

On Thursday, September 5, 2002, at 11:51 AM, Aidas wrote:

"Drawing text" in cocoa is still not avalaible(at last in december dev
tools). Maybe someone knows how to draw text in NSView?

The simple way to draw text is with NSString's drawAtPoint:withAttributes: or drawInRect:withAttributes:, or NSAttributedString's drawAtPoint: and drawInRect:. See NSStringDrawing.h. One point to keep in mind is that views in which text is drawn with these methods should usually be flipped; non-flipped views can be used, but there is currently a performance cost.

For a way of drawing text that offers greater flexibility, and, potentially, performance, take a look at the CircleView example. There are also other ways of drawing text that have their own advantages, e.g. turning the text into a bezier path.

Douglas Davidson
_______________________________________________
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.

References: 
 >Drawing text in NSView (From: Aidas <email@hidden>)

  • Prev by Date: Drawing text in NSView
  • Next by Date: Re: NSButton geometry
  • Previous by thread: Drawing text in NSView
  • Next by thread: Re: NSButton geometry
  • Index(es):
    • Date
    • Thread