opensubscriber
   Find in this group all groups
 
Unknown more information…

q : quartz-dev@lists.apple.com 11 January 2006 • 6:29PM -0500

Resource use of CG Fonts
by Kai Brüning

REPLY TO AUTHOR
 
REPLY TO GROUP




Folks:

I am creating CGFonts using
CGFontCreateWithPlatformFont for all our text
drawing.

Initially, I recreate the CGFont each time to
draw a piece of text. This turned out to be bad
at least for the PDF conversion done by Quartz
(as accessible via the print dialog): the
resulting PDFs contain a separate embedded font
subset for each time CGFontCreateWithPlatformFont
is called. This can result in ridiculously large
and slow PDFs.

Now I am caching the CGFonts as I create them,
using a mapping against ATSFontRefs. Works
beautifully, but do I need to be concerned about
resource use? Like restricting the number of
fonts in the cache to some upper number? Or is it
best (certainly it is easiest) just to keep any
CGFont around once it is created until the
program exists?

Note: I have a notification for font list changes
installed with ATSFontNotificationSubscribe and
handle this correctly, dropping fonts from the
cache which are no longer available.

Thanks,
Kai

--

RagTime GmbH                          Tel: [49] (2103) 9657-0
Neustraße 69                          Fax: [49] (2103) 9657-96
D-40721 Hilden                        mailto:kai@RagT...
Deutschland                           http://www.RagTime.de/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list      (Quartz-dev@list...)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartz-dev/subscriber%40opensubscriber.com

This email sent to subscriber@open...

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.