Re: Cocoa, ATSUI, and graphics context
Re: Cocoa, ATSUI, and graphics context
- Subject: Re: Cocoa, ATSUI, and graphics context
- From: Todd Heberlein <email@hidden>
- Date: Sun, 21 Apr 2002 15:59:29 -0700
On 4/21/02 2:57 PM, "Timothy J. Wood" <email@hidden> wrote:
>
On Sunday, April 21, 2002, at 12:18 PM, Todd Heberlein wrote:
>
>
> values[0] = CG_context;
>
>
So, try this:
>
>
values[0] = &CG_context;
Tried this. No luck, same error message.
...
BUT!!!! I think I have solved the immediate problem. I found some another
sample code that sets kATSUCGContextTag tag, but it sets it in a
ATSUTextLayout via ATSUSetLayoutControls() as opposed setting a ATSUStyle
via ATSUSetAttributes().
This not only doesn't generate an error, it actually gets the text to be
drawn into the NSView instead of directly on the screen. Drawing text on
the screen outside a window was kind of cool, but it wasn't what I wanted.
So, to summarize in the rare case that someone else actually wants to use
ATSUI commands in Cocoa:
ATSUCreateStyle() -> create a style object
ATSUCreateTextLayoutWithTextPtr() -> create a text layout object
ATSUSetLayoutControls() -> set graphics context to the NSView
ATSUDrawText() -> draws the text into the view.
Thanks for everyone's suggestions and encouragement!
Todd
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.