X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2a0155df7266eff2548304f5aff3fbf6e0a895f4..85a0a12a9c6fe2885c0de8801e91a2f6d6e4119a:/src/mac/carbon/font.cpp diff --git a/src/mac/carbon/font.cpp b/src/mac/carbon/font.cpp index 1d4d28e4d6..ff9671bd6c 100644 --- a/src/mac/carbon/font.cpp +++ b/src/mac/carbon/font.cpp @@ -15,11 +15,12 @@ #ifndef WX_PRECOMP #include "wx/string.h" + #include "wx/utils.h" + #include "wx/intl.h" + #include "wx/gdicmn.h" #endif #include "wx/fontutil.h" -#include "wx/gdicmn.h" -#include "wx/utils.h" #include "wx/fontutil.h" #include "wx/mac/private.h" @@ -202,7 +203,7 @@ wxFontRefData::~wxFontRefData() void wxFontRefData::MacFindFont() { OSStatus status ; - + Str255 qdFontName ; if ( m_macThemeFontID != kThemeCurrentPortFont ) { @@ -219,7 +220,7 @@ void wxFontRefData::MacFindFont() if ( m_macFontStyle & underline ) m_underlined = true ; m_pointSize = m_macFontSize ; - + m_macFontFamily = FMGetFontFamilyFromName( qdFontName ); } else @@ -268,6 +269,7 @@ void wxFontRefData::MacFindFont() { wxMacCFStringHolder cf( m_faceName, wxLocale::GetSystemEncoding() ); ATSFontFamilyRef atsfamily = ATSFontFamilyFindFromName( cf , kATSOptionFlagsDefault ); + wxASSERT_MSG( atsfamily != (ATSFontFamilyRef) -1 , wxT("ATSFontFamilyFindFromName failed") ); m_macFontFamily = FMGetFontFamilyFromATSFontFamilyRef( atsfamily ); } } @@ -291,7 +293,7 @@ void wxFontRefData::MacFindFont() wxASSERT_MSG( status == noErr , wxT("couldn't get an ATSUFont from font family") ); m_macATSUAdditionalQDStyles = m_macFontStyle & (~intrinsicStyle ); - + if ( m_macATSUStyle ) { ::ATSUDisposeStyle((ATSUStyle)m_macATSUStyle); @@ -471,13 +473,15 @@ void wxFont::SetWeight(int weight) RealizeResource(); } -void wxFont::SetFaceName(const wxString& faceName) +bool wxFont::SetFaceName(const wxString& faceName) { Unshare(); M_FONTDATA->m_faceName = faceName; RealizeResource(); + + return wxFontBase::SetFaceName(faceName); } void wxFont::SetUnderlined(bool underlined)