Re: Drawing text in NSView
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.