Re: fast text
Re: fast text
- Subject: Re: fast text
- From: Alexander White <email@hidden>
- Date: Mon, 25 Nov 2002 15:27:54 -0800
Thanks for the help. I have one more question. In my program I do
some animation with images. My experience there suggest that it is
faster to draw a CGImageRef to a CGContextRef than to draw a NSImage to
the current NSGraphicsContext. I know how to get a CGContextRef using
[NSGraphicsContext currentContext], but I do not know how to get a
CGImageRef form a NSImage. Do you know how to do this?
AW
On Monday, November 25, 2002, at 02:56 PM, John C. Randolph wrote:
>
In that case, make an NSImage big enough to contain the text,
>
lockfocus on the image and draw the text into it, and then composite
>
that image into the view whenever you need to. This is about as fast
>
as it can get within Quartz2D. If you need it to go faster than that,
>
render the text into a GL texture, and let the hardware acceleration
>
deal with it.
>
>
-jcr
>
>
On Monday, November 25, 2002, at 02:14 PM, Alexander White wrote:
>
>
> This is the same text frequently ~20 fps
>
> AW
>
>
>
> On Monday, November 25, 2002, at 02:02 PM, John C. Randolph wrote:
>
>
>
>>
>
>> On Monday, November 25, 2002, at 12:50 PM, Alexander White wrote:
>
>>
>
>>> I am writing a cocoa program that requires text to be rendered
>
>>> quickly to a view. The cocoa text rendering calls are too slow.
>
>>> The quartz text calls do not support (I think) complicated text
>
>>> handling like multiple fonts/colors on one string of text and the
>
>>> antialiasing on the postscript fonts is soft/blurry when compared
>
>>> to the cocoa antialiasing. What is the fastest way to draw text to
>
>>> a CGContext? Is it using the ATSUI toolbox?
>
>>
>
>> Is this rapidly-changing text, or do you need to render the same
>
>> text frequently?
>
>
>
John C. Randolph <email@hidden> (408) 974-8819
>
Sr. Cocoa Software Engineer,
>
Apple Worldwide Developer Relations
>
http://developer.apple.com/cocoa/index.html
_______________________________________________
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.