Re: Question about font managing (NSFont).
Re: Question about font managing (NSFont).
- Subject: Re: Question about font managing (NSFont).
- From: Graham Cox <email@hidden>
- Date: Tue, 30 Jun 2009 11:45:05 +1000
On 30/06/2009, at 2:10 AM, Anders Lassen wrote:
Is a font a large object that requires a lot of memory usage and CPU
time for initial loading, etc. ??? or should I just think of it, as
an small object pointer.
(my object tree will in average contain about 100-300 objects).
I hope someone can help on this.
In fact your objects are not going to "contain" individual font
instances, they are merely going to reference one. I believe the Font
Manager will cache fonts it loads as needed so you don't have to worry
about it. If you ask for a variation of a font, the FM will cache it
and return the same instance again for an identical request from
another object. In effect it's already implementing the "look up
table" scheme you're considering.
In general, implement the simplest approach that solves your problem
then, if necessary, optimise later.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden