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

Re: Output text to NSView


  • Subject: Re: Output text to NSView
  • From: Douglas Davidson <email@hidden>
  • Date: Tue, 3 Sep 2002 10:37:43 -0700

On Monday, September 2, 2002, at 11:01 PM, Famille GOUREAU-SUIGNARD wrote:

I'm trying to create my own view to send it to the printer.
But I can't find how to draw text on a view.

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: 
 >Output text to NSView (From: Famille GOUREAU-SUIGNARD <email@hidden>)

  • Prev by Date: Re: cString deprecated!
  • Next by Date: How to 'set' NSScrollView of NSTableView ?
  • Previous by thread: Output text to NSView
  • Next by thread: [ANN] BDControl 1.0.0 released
  • Index(es):
    • Date
    • Thread