#include "wx/utils.h"
#include "wx/intl.h"
#include "wx/gdicmn.h"
+ #include "wx/log.h"
#endif
#include "wx/fontutil.h"
wxNativeFontInfo m_info;
};
-#define M_FONTDATA (wxFontRefData*)m_refData)
+#define M_FONTDATA ((wxFontRefData*)m_refData)
// ============================================================================
break ;
case wxMODERN :
+ case wxTELETYPE:
m_faceName = wxT("Monaco");
break ;
#ifndef __LP64__
wxMacStringToPascal( m_faceName , qdFontName );
m_macFontFamily = FMGetFontFamilyFromName( qdFontName );
+ if ( m_macFontFamily == kInvalidFontFamily )
+ {
+ wxLogDebug( wxT("ATSFontFamilyFindFromName failed for %s"), m_faceName.c_str() );
+ m_macFontFamily = GetAppFont();
+ }
#endif
}
}
{
wxMacCFStringHolder cf( m_faceName, wxLocale::GetSystemEncoding() );
ATSFontFamilyRef atsfamily = ATSFontFamilyFindFromName( cf , kATSOptionFlagsDefault );
- wxASSERT_MSG( atsfamily != (ATSFontFamilyRef) -1 , wxT("ATSFontFamilyFindFromName failed") );
- m_macFontFamily = FMGetFontFamilyFromATSFontFamilyRef( atsfamily );
+
+ // ATSFontFamilyRef is an unsigned type, so check against max
+ // for an invalid value, not -1.
+ if ( atsfamily == 0xffffffff )
+ {
+ wxLogDebug( wxT("ATSFontFamilyFindFromName failed for ") + m_faceName );
+ m_macFontFamily = GetAppFont();
+ }
+ else
+ m_macFontFamily = FMGetFontFamilyFromATSFontFamilyRef( atsfamily );
}
}
dc->GetTextExtent( wxT("g"), &width, &height, NULL, NULL);
return wxSize((int)width, (int)height);
#else
- wxFontBase::GetPixelSize();
+ return wxFontBase::GetPixelSize();
#endif
}