X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dedf5d9f66a309691a4459efe9c1244bfb8c71af..9fcd0bf7f313e637e8cd4b5d7f3cd5b294fec033:/src/mac/carbon/font.cpp?ds=sidebyside diff --git a/src/mac/carbon/font.cpp b/src/mac/carbon/font.cpp index 9b5e4bb5a7..fe8a315e25 100644 --- a/src/mac/carbon/font.cpp +++ b/src/mac/carbon/font.cpp @@ -18,6 +18,7 @@ #include "wx/utils.h" #include "wx/intl.h" #include "wx/gdicmn.h" + #include "wx/log.h" #endif #include "wx/fontutil.h" @@ -253,6 +254,7 @@ void wxFontRefData::MacFindFont() break ; case wxMODERN : + case wxTELETYPE: m_faceName = wxT("Monaco"); break ; @@ -265,7 +267,7 @@ void wxFontRefData::MacFindFont() m_macFontFamily = FMGetFontFamilyFromName( qdFontName ); if ( m_macFontFamily == kInvalidFontFamily ) { - wxLogDebug( wxT("ATSFontFamilyFindFromName failed for %s"), m_faceName ); + wxLogDebug( wxT("ATSFontFamilyFindFromName failed for %s"), m_faceName.c_str() ); m_macFontFamily = GetAppFont(); } #endif @@ -288,9 +290,12 @@ void wxFontRefData::MacFindFont() { wxMacCFStringHolder cf( m_faceName, wxLocale::GetSystemEncoding() ); ATSFontFamilyRef atsfamily = ATSFontFamilyFindFromName( cf , kATSOptionFlagsDefault ); - if ( atsfamily == (ATSFontFamilyRef) -1 ) + + // ATSFontFamilyRef is an unsigned type, so check against max + // for an invalid value, not -1. + if ( atsfamily == 0xffffffff ) { - wxLogDebug( wxT("ATSFontFamilyFindFromName failed for %s"), m_faceName ); + wxLogDebug( wxT("ATSFontFamilyFindFromName failed for ") + m_faceName ); m_macFontFamily = GetAppFont(); } else