+#else
+ m_ctFont.reset( CTFontCreateWithFontDescriptor( m_ctFontDescriptor, m_pointSize, NULL ) );
+#endif
+ }
+#if wxMAC_USE_ATSU_TEXT == 0
+ OSStatus status = noErr;
+ CTFontDescriptorRef desc = m_ctFontDescriptor ;
+ ATSFontRef atsfont = CTFontGetPlatformFont( m_ctFont, &desc );
+ FMFont fmfont = FMGetFontFromATSFontRef( atsfont );
+ ATSUAttributeTag atsuTags[] =
+ {
+ kATSUFontTag ,
+ kATSUSizeTag ,
+ kATSUVerticalCharacterTag,
+ kATSUQDBoldfaceTag ,
+ kATSUQDItalicTag ,
+ kATSUQDUnderlineTag ,
+ };
+ ByteCount atsuSizes[sizeof(atsuTags) / sizeof(ATSUAttributeTag)] =
+ {
+ sizeof( ATSUFontID ) ,
+ sizeof( Fixed ) ,
+ sizeof( ATSUVerticalCharacterType),
+ sizeof( Boolean ) ,
+ sizeof( Boolean ) ,
+ sizeof( Boolean ) ,
+ };
+ Boolean kTrue = true ;
+ Boolean kFalse = false ;
+
+ Fixed atsuSize = IntToFixed( m_pointSize );
+ ATSUVerticalCharacterType kHorizontal = kATSUStronglyHorizontal;
+ ATSUAttributeValuePtr atsuValues[sizeof(atsuTags) / sizeof(ATSUAttributeTag)] =
+ {
+ &fmfont ,
+ &atsuSize ,
+ &kHorizontal,
+ (m_weight == wxBOLD) ? &kTrue : &kFalse ,
+ (m_style == wxITALIC || m_style == wxSLANT) ? &kTrue : &kFalse ,
+ (m_underlined) ? &kTrue : &kFalse ,
+ };
+
+ if ( m_macATSUStyle )
+ {
+ ::ATSUDisposeStyle((ATSUStyle)m_macATSUStyle);
+ m_macATSUStyle = NULL ;
+ }
+ status = ::ATSUCreateStyle((ATSUStyle *)&m_macATSUStyle);
+ wxASSERT_MSG( status == noErr , wxT("couldn't create ATSU style") );
+ status = ::ATSUSetAttributes(
+ (ATSUStyle)m_macATSUStyle,
+ sizeof(atsuTags) / sizeof(ATSUAttributeTag) ,
+ atsuTags, atsuSizes, atsuValues);
+#endif
+ }
+#endif
+#if wxMAC_USE_ATSU_TEXT
+ {
+ OSStatus status = noErr;
+ Str255 qdFontName ;
+ if ( m_macThemeFontID != kThemeCurrentPortFont )
+ {
+ Style style ;
+ GetThemeFont( m_macThemeFontID, GetApplicationScript(), qdFontName, &m_macFontSize, &style );
+ if ( m_macFontSize == 0 )
+ m_macFontSize = 12;
+ m_macFontStyle = style ;
+ m_faceName = wxMacMakeStringFromPascal( qdFontName );
+ if ( m_macFontStyle & bold )
+ m_weight = wxBOLD ;
+ else
+ m_weight = wxNORMAL ;
+ if ( m_macFontStyle & italic )
+ m_style = wxITALIC ;
+ if ( m_macFontStyle & underline )
+ m_underlined = true ;
+ m_pointSize = m_macFontSize ;
+ m_macFontFamily = FMGetFontFamilyFromName( qdFontName );