Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
CGFontCreateWithPlatformFont vs CGContextSelectFont
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CGFontCreateWithPlatformFont vs CGContextSelectFont



Hi all,

I've got to be missing something...

The following snippet works:

<x-tad-smaller> ::CGContextSelectFont( context, "Skia-Regular", </x-tad-smaller><x-tad-smaller>0.0</x-tad-smaller><x-tad-smaller>, kCGEncodingMacRoman );
::CGContextSetFontSize( context, size );
</x-tad-smaller>

The following snippet doesn't work:

<x-tad-smaller> ATSFontRef ref = ::ATSFontFindFromPostScriptName( CFSTR("Skia-Regular"), kATSOptionFlagsDefault );
CGFontRef font = ::CGFontCreateWithPlatformFont( &ref );
::CGContextSetFont( context, font );
::CGContextSetFontSize( context, size );


</x-tad-smaller>
ref is not zero, font is not zero.

Why do they behave differently?

.... I just had a thought. If I use CGContextSetFont, do I need to draw with glyphs?

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

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.