X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5f48b3adcc05beedef8b34b039d6bfb933bb551c..797e38dde12c5dc2d99070eef25d9b8c2549d621:/src/mac/carbon/font.cpp?ds=inline diff --git a/src/mac/carbon/font.cpp b/src/mac/carbon/font.cpp index b517eb633e..90f88f2d00 100644 --- a/src/mac/carbon/font.cpp +++ b/src/mac/carbon/font.cpp @@ -18,11 +18,11 @@ #include "wx/utils.h" #include "wx/intl.h" #include "wx/gdicmn.h" + #include "wx/log.h" #endif #include "wx/fontutil.h" #include "wx/graphics.h" -#include "wx/log.h" #include "wx/mac/private.h" @@ -36,7 +36,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) class WXDLLEXPORT wxFontRefData: public wxGDIRefData { - friend class WXDLLEXPORT wxFont; + friend class wxFont; public: wxFontRefData() @@ -254,6 +254,7 @@ void wxFontRefData::MacFindFont() break ; case wxMODERN : + case wxTELETYPE: m_faceName = wxT("Monaco"); break ; @@ -266,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 @@ -289,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 @@ -551,7 +555,7 @@ wxSize wxFont::GetPixelSize() const dc->GetTextExtent( wxT("g"), &width, &height, NULL, NULL); return wxSize((int)width, (int)height); #else - wxFontBase::GetPixelSize(); + return wxFontBase::GetPixelSize(); #endif }