Re: (freely) Rotating Text
Re: (freely) Rotating Text
- Subject: Re: (freely) Rotating Text
- From: Matt Neuburg <email@hidden>
- Date: Mon, 02 May 2005 15:01:11 -0700
On Mon, 2 May 2005 19:09:35 +0200, Stephane Sudre <email@hidden> said:
>
>On 2 mai 05, at 18:46, Douglas Davidson wrote:
>
>>
>> On May 2, 2005, at 4:10 AM, Thomas Bruhin wrote:
>>
>>> I am working on a graphing application which is nearly finished. The
>>> last problem to be solved is the one I now have serious trouble with:
>>> I want to be able to draw the labels for my horizontal axis not only
>>> horizontally (which works perfect using the drawAtPoint Method of the
>>> NSAttributedString class) but vertically (90 degrees rotated) and
>>> even in some other degree like 30 or 60 or whatever. I found a
>>> (partial) solution in the list-archives: "Unwanted clip of rotated
>>> text". I followed the thread Erez Anzel and Douglas Davidson had, and
>>> implemented the methods from Apples CircleView demo application. It
>>> works fine, however the overhead is quite big, since I have to draw
>>> each glyph individually. This was also noted by Douglas and he
>>> suggested to do it all in one call to the Glyph drawing method. But
>>> this gives me a really hard time :-( I just don't get it!
>>>
>>
>> You're making this too complicated. Just use an NSAffineTransform
>> followed by a drawAtPoint: or drawInRect:. The only tricky part is
>> making sure you have the right affine transform to place your text
>> where you want it.
>
>Isn't there also a limitation with the bounds of the view?
>
>IIRC what I've seen in the past, depending on the order in which you do
>the translation and rotation, you might end up with a cut or blank
>string.
Anyone who has used Intaglio can have no doubt that Cocoa can freely rotate
text (and leave it editable)! m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
_______________________________________________
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