• 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: Cached text output is flippin' flipped!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cached text output is flippin' flipped!


  • Subject: Re: Cached text output is flippin' flipped!
  • From: Aki Inoue <email@hidden>
  • Date: Mon, 5 May 2008 18:09:02 -0700

Graham,

All is well when I'm drawing directly to the real screen, but at certain times I cache my output offscreen in an NSPDFImageRep and/or a CGLayer. In both cases the text output gets inverted on a per-line basis - i.e. the whole block is the right way up but each line is upside-down.

NSLayoutManager expects that the coordinate system its rendering into to be flipped and the current graphics context's -isFlipped to return YES. How are you rendering into these contexts ?


If you're create NSGraphicsContext from CGContext, you should be able to specify the initial flippedness via +[NSGraphcisContext graphicsContextWithGraphicsPort:flipped:] method.

Aki

On 2008/05/05, at 16:43, Graham Cox wrote:

I'm drawing text using the lower-level parts of the text system - specifically I end up with a call to NSLayoutManager's - drawGlyphsForGlyphRange:atPoint:

All is well when I'm drawing directly to the real screen, but at certain times I cache my output offscreen in an NSPDFImageRep and/or a CGLayer. In both cases the text output gets inverted on a per-line basis - i.e. the whole block is the right way up but each line is upside-down.

Any ideas what I need to do to make the layout manager do the right thing?

I should mention that when drawing to the screen I do use a flipped view, and when building these caches I don't attempt any additional flipping - when the caches are drawn to the flipped view they come out the right way up for all objects as I need them to, except for text.


tia, Graham _______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Cached text output is flippin' flipped!
      • From: Graham Cox <email@hidden>
References: 
 >Cached text output is flippin' flipped! (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Accessing attributes of XML (Christian Graus)
  • Next by Date: Re: Cached text output is flippin' flipped!
  • Previous by thread: Cached text output is flippin' flipped!
  • Next by thread: Re: Cached text output is flippin' flipped!
  • Index(es):
    • Date
    • Thread