• 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: Question about font managing (NSFont).
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Question about font managing (NSFont). (From: Anders Lassen <email@hidden>)

  • Prev by Date: (as you type) spell checking of an attributed string
  • Next by Date: Re: disabling grammar checking
  • Previous by thread: Question about font managing (NSFont).
  • Next by thread: NSURL URLWithString:relativeToURL: generates an extra /
  • Index(es):
    • Date
    • Thread