Hi everyone,

Given an NSFont object how can I extract or create a CGFontRef from it to use 
directly with CoreGraphics?

I've already searched around in the lists and ADC with no luck.  

So far, I've tried the following:

        NSFontManager* fm = [NSFontManager sharedFontManager];
        NSFont* font = [ fm fontWithFamily:... ];

        CFDictionaryRef dict = CFDictionaryCreate( kCFAllocatorDefault, NULL, 
NULL, 0, NULL, NULL );
        CGFontRef fontRef = CGFontCreateCopyWithVariations( (CGFontRef) font, 
dict );
        CFRelease( dict );

        int unitsPerEM = CGFontGetUnitsPerEm( fontRef );   // CRASH!


Thanks in advance!

Andy_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to