• 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: Using a font without installing it
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using a font without installing it


  • Subject: Re: Using a font without installing it
  • From: Stefan Landvogt <email@hidden>
  • Date: Sun, 16 Jan 2005 09:43:09 +0100

Shauns code that loads all fonts in a certain directory. Call this method in your AppDelegate...

Be aware, that fonts have also copyright, before you distribute them with your application.
I learned by the hard way, that Myriad Web Bold is not public domain...


- (void)loadLocalFonts {
NSString *fontsFolder = [[NSBundle mainBundle] resourcePath]; //[ stringByAppendingPathComponent:@"Fonts"];
if (fontsFolder) {
NSURL *fontsURL = [NSURL fileURLWithPath:fontsFolder];
if (fontsURL) {
FSRef fsRef;
FSSpec fsSpec;
(void)CFURLGetFSRef((CFURLRef)fontsURL, &fsRef);
OSStatus status = FSGetCatalogInfo(&fsRef, kFSCatInfoNone, NULL,
NULL, &fsSpec, NULL);
if (noErr == status) {
FMGeneration generationCount = FMGetGeneration();
status = FMActivateFonts(&fsSpec, NULL, NULL,
kFMLocalActivationContext);
generationCount = FMGetGeneration() - generationCount;
}
}
}
}


On 16. Jan 2005, at 06:07, Shaun Wexler wrote:

On Jan 15, 2005, at 8:47 PM, Andy Lee wrote:

If the app crashes, will you be left with an installed font that you didn't want to be there?

The font is private and stored in the app's own memory space, by default and/or if you specify kFMLocalActivationContext.
--
Shaun Wexler
MacFOH
http://www.macfoh.com


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Using a font without installing it
      • From: Shaun Wexler <email@hidden>
References: 
 >RE: Re: Using a font without installing it (From: "Peter Karlsson" <email@hidden>)
 >Re: Using a font without installing it (From: Shaun Wexler <email@hidden>)
 >Re: Using a font without installing it (From: Andy Lee <email@hidden>)
 >Re: Using a font without installing it (From: Shaun Wexler <email@hidden>)

  • Prev by Date: Re: Getting clipboard text contents
  • Next by Date: Changing Bundle Name
  • Previous by thread: Re: Using a font without installing it
  • Next by thread: Re: Using a font without installing it
  • Index(es):
    • Date
    • Thread