
Signature
/los "I was a teenage net-random"
------------------------------------------------------------------------
Opinions expressed here are mine and not necessarily those of my employer!
------------------------------------------------------------------------
> This is probably a silly question, but when drawing within a common
> view, drawing various shapes and text, can you draw text at an angle?
>
> I don't see an attribute for angle or rotation but it seems to me that
> in order to have text drawn at an angle, its housing view must be rotated?
The following works just fine for me:
@implementation RotatedView
- (void)drawRect:(NSRect)rect {
NSAffineTransform *t = [NSAffineTransform transform];
[t translateXBy:200. yBy:200.];
[t rotateByDegrees:40.];
[t translateXBy:-200. yBy:-200.];
[t set];
[@"Hello World" drawAtPoint:NSMakePoint(100., 100.)
withAttributes:nil];
[[NSAffineTransform transform] set];
}
@end
David Phillip Oster - 29 Aug 2007 16:32 GMT
> > This is probably a silly question, but when drawing within a common
> > view, drawing various shapes and text, can you draw text at an angle?
[quoted text clipped - 17 lines]
>
> @end
See also:
file:///Developer/Examples/AppKit/CircleView/ for an example of using
the NSTextView system to lay out text so it follows the curve of a
circle.
slashlos - 31 Aug 2007 02:21 GMT
> See also:
>
> file:///Developer/Examples/AppKit/CircleView/ for an example of using
> the NSTextView system to lay out text so it follows the curve of a
> circle.
Thanks for doc pointer, it's what I needed.

Signature
/los "I was a teenage net-random"
------------------------------------------------------------------------
Opinions expressed here are mine and not necessarily those of my employer!
------------------------------------------------------------------------