• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Displaying Text Vertically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Displaying Text Vertically


  • Subject: Re: Displaying Text Vertically
  • From: email@hidden
  • Date: Thu, 16 Feb 2006 18:31:41 -0800

I'd like to display the text on its side. Sorry, I should have been clearer.

Prior to rendering it however you would normally do so, offset and rotate the current graphics context. See the documentation for NSGraphicsContext and NSAffineTransform.


Note that a mere rotation won't do - that'll rotate around the origin, which presumably is not where you're rendering your text. You'll want to first translate the origin to the point you want to rotate around (typically the text origin), then perform the rotation, then draw your string (with a position of {0, 0}, since your origin will by now be positioned where you want your text to start).

Make sure to save your graphics context first, then pop it off again, so your changes to the origin and rotation aren't permanent.

If you're talking about rotation an NSTextView or similar, then you could play with the setBoundsRotation: and so forth... I don't have any experience with them myself.

Wade Tregaskis

    ICQ: 40056898
    AIM, Yahoo & Skype: wadetregaskis
    MSN: email@hidden
    iChat & email: email@hidden
    Jabber: email@hidden
    Google Talk: email@hidden

    http://homepage.mac.com/wadetregaskis/

-- Sed quis custodiet ipsos custodes?


_______________________________________________ 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
References: 
 >Displaying Text Vertically (From: Adam Johnson <email@hidden>)
 >Re: Displaying Text Vertically (From: Douglas Davidson <email@hidden>)
 >Re: Displaying Text Vertically (From: Adam Johnson <email@hidden>)

  • Prev by Date: Re: [Solved] Importing a .nib file
  • Next by Date: Change build flags; Ignore warnings; Alter C code?
  • Previous by thread: Re: Displaying Text Vertically
  • Next by thread: Re: Displaying Text Vertically
  • Index(es):
    • Date
    • Thread