X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c22ace4dff0629aa55f5afb9fa7d77334d27409b..17a546027262c3a97792d22108c6f652cf8b4046:/src/osx/carbon/font.cpp diff --git a/src/osx/carbon/font.cpp b/src/osx/carbon/font.cpp index e6fd9cc650..c37e0c8f1e 100644 --- a/src/osx/carbon/font.cpp +++ b/src/osx/carbon/font.cpp @@ -252,6 +252,9 @@ void wxFontRefData::Free() #endif m_cgFont.reset(); #if wxOSX_USE_ATSU_TEXT +#if wxOSX_USE_CARBON + m_macThemeFontID = kThemeCurrentPortFont ; +#endif if ( m_macATSUStyle ) { ::ATSUDisposeStyle((ATSUStyle)m_macATSUStyle); @@ -439,7 +442,7 @@ void wxFontRefData::MacFindFont() kATSUQDCondensedTag , kATSUQDExtendedTag , }; - ByteCount atsuSizes[sizeof(atsuTags) / sizeof(ATSUAttributeTag)] = + ByteCount atsuSizes[WXSIZEOF(atsuTags)] = { sizeof( ATSUFontID ) , sizeof( Fixed ) , @@ -457,7 +460,7 @@ void wxFontRefData::MacFindFont() Fixed atsuSize = IntToFixed( m_info.m_pointSize ); ATSUVerticalCharacterType kHorizontal = kATSUStronglyHorizontal; FMFontStyle addQDStyle = m_info.m_atsuAdditionalQDStyles; - ATSUAttributeValuePtr atsuValues[sizeof(atsuTags) / sizeof(ATSUAttributeTag)] = + ATSUAttributeValuePtr atsuValues[WXSIZEOF(atsuTags)] = { &m_info.m_atsuFontID , &atsuSize , @@ -471,7 +474,7 @@ void wxFontRefData::MacFindFont() status = ::ATSUSetAttributes( (ATSUStyle)m_macATSUStyle, - sizeof(atsuTags) / sizeof(ATSUAttributeTag) , + WXSIZEOF(atsuTags), atsuTags, atsuSizes, atsuValues); wxASSERT_MSG( status == noErr , wxT("couldn't modify ATSU style") ); @@ -1055,7 +1058,10 @@ void wxNativeFontInfo::EnsureValid() // ATSUFontID and FMFont are equivalent FMFontStyle intrinsicStyle = 0 ; OSStatus status = FMGetFontFromFontFamilyInstance( m_qdFontFamily , m_qdFontStyle , (FMFont*)&m_atsuFontID , &intrinsicStyle); - wxASSERT_MSG( status == noErr , wxT("couldn't get an ATSUFont from font family") ); + if ( status != noErr ) + { + wxFAIL_MSG( wxT("couldn't get an ATSUFont from font family") ); + } m_atsuAdditionalQDStyles = m_qdFontStyle & (~intrinsicStyle ); m_atsuFontValid = true; } @@ -1141,7 +1147,7 @@ bool wxNativeFontInfo::FromString(const wxString& s) { long l; - wxStringTokenizer tokenizer(s, _T(";")); + wxStringTokenizer tokenizer(s, wxT(";")); wxString token = tokenizer.GetNextToken(); // @@ -1192,7 +1198,7 @@ wxString wxNativeFontInfo::ToString() const { wxString s; - s.Printf(_T("%d;%d;%d;%d;%d;%d;%s;%d"), + s.Printf(wxT("%d;%d;%d;%d;%d;%d;%s;%d"), 0, // version m_pointSize, m_family,