Re: Cached text output is flippin' flipped!
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