Re: drawRect - top to bottom text
Re: drawRect - top to bottom text
- Subject: Re: drawRect - top to bottom text
- From: "R. Scott Thompson" <email@hidden>
- Date: Fri, 5 Nov 2004 17:49:20 -0600
<x-tad-bigger>I'm currently using NSString's member function drawInRect:withAttributes:
and as it says in the documentation, the origin of the text is being
displayed from the rect's bottom left corner.
My question is if there's any way to make the origin the top left corner
with out having to override the isFlipped function. The reason I don't want
to use this function is because it'll change everything else that i've set
in place. I just want my text to start from the top of the rectangle and
progress downward.
</x-tad-bigger>
Presumably you are trying to draw multiple lines of text with drawInRect:withAttributes;?
drawInRect:withAttributes: is a fairly simplistic tool. I don't think you're going to have much luck working around it's behavior. You might be able to use the NSAffineTransform in combination with Quartz calls to change the origin, change the axis, change the text matrix, use drawInRect:withAttributes:, and then restore everything back.
You'd probably be better off in the long run, however, just putting together a text layout yourself and drawing the lines wherever you think they should go. More information on that can be found at:
<http://developer.apple.com/documentation/Cocoa/Conceptual/TextArchitecture/index.html>
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden