+#endif
+}
+
+#if wxMAC_USE_CORE_TEXT
+
+/* from Core Text Manual Common Operations */
+
+static CTFontDescriptorRef wxMacCreateCTFontDescriptor(CFStringRef iFamilyName, CTFontSymbolicTraits iTraits )
+{
+ CTFontDescriptorRef descriptor = NULL;
+ CFMutableDictionaryRef attributes;
+
+ assert(iFamilyName != NULL);
+ // Create a mutable dictionary to hold our attributes.
+ attributes = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
+ &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+ check(attributes != NULL);
+
+ if (attributes != NULL) {
+ // Add a family name to our attributes.
+ CFDictionaryAddValue(attributes, kCTFontFamilyNameAttribute, iFamilyName);
+
+
+ if ( iTraits ) {
+ CFMutableDictionaryRef traits;
+ CFNumberRef symTraits;
+
+ // Create the traits dictionary.
+ symTraits = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type,
+ &iTraits);
+ check(symTraits != NULL);
+
+ if (symTraits != NULL) {
+ // Create a dictionary to hold our traits values.
+ traits = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
+ &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+ check(traits != NULL);
+
+ if (traits != NULL) {
+ // Add the symbolic traits value to the traits dictionary.
+ CFDictionaryAddValue(traits, kCTFontSymbolicTrait, symTraits);
+
+ // Add the traits attribute to our attributes.
+ CFDictionaryAddValue(attributes, kCTFontTraitsAttribute, traits);
+ CFRelease(traits);
+ }
+ CFRelease(symTraits);
+ }
+ }
+ // Create the font descriptor with our attributes
+ descriptor = CTFontDescriptorCreateWithAttributes(attributes);
+ check(descriptor != NULL);
+
+ CFRelease(attributes);
+ }
+ // Return our font descriptor.
+ return descriptor ;
+}
+
+wxFontRefData::wxFontRefData( wxUint32 coreTextFontType )
+{
+ CTFontRef font = CTFontCreateUIFontForLanguage( coreTextFontType, 0.0, NULL ) ;
+ if ( CTFontGetSize(m_ctFont) == 0 )
+ {
+ CFRelease(font);
+ font = CTFontCreateUIFontForLanguage( coreTextFontType, 12.0, NULL );
+ }
+ Init( font );
+}
+
+wxFontRefData::wxFontRefData( CTFontRef font )
+{
+ Init( font );
+}
+
+wxFontRefData::wxFontRefData( CTFontDescriptorRef fontdescriptor, int size )
+{
+ if ( size == 0 )
+ {
+ wxCFRef< CFNumberRef > value( (CFNumberRef) CTFontDescriptorCopyAttribute( fontdescriptor, kCTFontSizeAttribute ) );
+
+ float fsize;
+ if ( CFNumberGetValue( value , kCFNumberFloatType , &fsize ) )
+ {
+ size = (int) fsize + 0.5 ;
+ }
+ }
+ Init( CTFontCreateWithFontDescriptor(fontdescriptor, size,NULL) );
+}
+
+void wxFontRefData::Init( CTFontRef font )
+{
+ Init(10, wxDEFAULT, wxNORMAL, wxNORMAL,
+ false, wxT("applicationfont"), wxFONTENCODING_DEFAULT);
+
+ m_ctFont.reset( font );
+}
+
+#endif
+
+void wxFontRefData::MacFindFont()
+{
+
+#if wxMAC_USE_CORE_TEXT
+ if ( UMAGetSystemVersion() >= 0x1050 )