• 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: Cocoa, ATSUI, and graphics context
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Cocoa, ATSUI, and graphics context (From: "Timothy J. Wood" <email@hidden>)

  • Prev by Date: Re: Ghostly Contents folder :-(
  • Next by Date: pixel format conversion
  • Previous by thread: Re: Cocoa, ATSUI, and graphics context
  • Next by thread: NSScanner problem...
  • Index(es):
    • Date
    • Thread