• 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
Accessing Fonts 'activated' via ATS calls?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Accessing Fonts 'activated' via ATS calls?


  • Subject: Accessing Fonts 'activated' via ATS calls?
  • From: Marcel Weiher <email@hidden>
  • Date: Sun, 8 Jul 2001 16:29:29 +0200

Hi folks,

I am trying to define some Type 1 fonts during execution of my application, for use by that application at that time (not for generally installing this font). The code I am trying to do this with looks as follows:

+(void)defineFont:(NSData*)fontData
{
OSStatus status;
ATSFontContainerRef fontRef=0;
status = ATSFontActivateFromMemory( [fontData bytes], [fontData length],

kATSFontContextGlobal,kATSFontFormatUnspecified,NULL,kATSOptionFlagsDefault,
&fontRef );
NSLog(@"defined a font, status: %d, fontRef: %d",status,fontRef);
}


Calling this with a Type 1 font in NSData yields a 0 exit code and some integer value in the fontRef, so I am assuming that the call succeeded.

However, when I then try to access this font by name (via CoreGraphics or AppKit) I still get Courier subsituted.

Any ideas wether this should work, or should I be doing something different? One thing that puzzles me is that there doesn't seem to be any other API that makes use of an ATSFontContainerRef. Hmm.

Marcel


References: 
 >Re: Shadowed Text (From: Aki Inoue <email@hidden>)

  • Prev by Date: Learning Cocoa
  • Next by Date: Re: NSImage imageNamed
  • Previous by thread: Re: Shadowed Text
  • Next by thread: Re: Documentation Wish - was Re: AppKit source available as reference
  • Index(es):
    • Date
    • Thread