title: CTFontManagerRegisterGraphicsFont does not register the family name
body: <p>For reasons related to licensing, I have to decrypt a font file and load it into memory then then register it instead of reading directly from a URL. For this I have to use <code>CTFontManagerRegisterGraphicsFont</code>.</p>
  
  <p>The problematic part comes when I try to use <code>[NSFont fontWithName:@"Open Sans" size:21.0]</code> where it will only accept the font's PostScript name (i.e. ("OpenSans or OpenSans-Bold for the bold weight) and won't work the family name "Open Sans".</p>
  
  <p>If a font is registered using <code>ATSApplicationFontsPath</code>in the info.plist file or using <code>CTFontManagerRegisterFontsForURLs</code> then I am able to use the font's family name. But I can't do it this way.</p>
  
  <p>("Open Sans" is used here as an example)</p>
  
  <p>Here's the relevant code I'm using to register the font.</p>
  
  <pre class="lang-c prettyprint-override"><code>NSString *fontPath = [[NSBundle mainBundle] pathForResource:@"OpenSans-Regular" ofType:@"ttf" inDirectory:@"Fonts"];
  NSData *fontData = [NSData dataWithContentsOfFile:fontPath];
  
  CGDataProviderRef fontProviderRef = CGDataProviderCreateWithCFData((CFDataRef)fontData);
  CGFontRef fontRef = CGFontCreateWithDataProvider(fontProviderRef);
  CFErrorRef error;
  
  if (! CTFontManagerRegisterGraphicsFont(fontRef, &amp;error)) {
  
      CFStringRef errorDescription = CFErrorCopyDescription(error);
      NSLog(@"Failed to load font: %@", errorDescription);
      CFRelease(errorDescription);
  }
  
  CFRelease(fontRef);
  CFRelease(fontProviderRef);
  </code></pre>
  
  <p>Is there a way to make the font family name available to NSFont with <code>CTFontManagerRegisterGraphicsFont</code>?</p>
  
  <p>(Using Xcode 5 and targeting Mac OS X >= 10.8)</p>