Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ATSU and QDBeginCGContext



Hi,

I'm working on an application framework (using Carbon) that draws text via ATSU functions. Initially I drew text straight to the screen without passing ATSU a CGContextRef via ATSUSetlayoutControls, but the text would look terrible; bad kerning, bad anti-aliasing... just ugly. I think this case is delt with in the Apple documenatation here:
http://developer.apple.com/documentation/Carbon/Conceptual/ATSUI_Concepts/atsui_chap4/chapter_4_section_7.html

So I'm trying to fix that by having a global context like it says and so far it's been really rough going. Firstly text only appears on the first window and then I get no text on the 2nd window. Also now all my text is drawn relitive to the window instead of relitive to the control currently being painted. Heres how I create my context (just once):

	static CGContextRef GlobalContext = 0;
	if (!GlobalContext)
	{
		CGrafPtr port;
		GetPort(&port);
		QDBeginCGContext(port, &GlobalContext);
	}

Am I using the wrong method to get the port?

Do I need to create a CGContextRef per window?

Is there some easy way to map output into the bounds of the control (HIView) currently being drawn?

Regards
--
Matthew Allen - Memecode Software
(http://www.memecode.com)

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.