Re: Output text to NSView
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.