X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/64c1effefabacc175cf601ea4118f3b806a1fd65..68f146206ff65cfafdf88c154aece854a0ba4864:/src/msw/font.cpp?ds=sidebyside diff --git a/src/msw/font.cpp b/src/msw/font.cpp index 220d37e1b7..397a8c14f0 100644 --- a/src/msw/font.cpp +++ b/src/msw/font.cpp @@ -262,7 +262,7 @@ public: if ( m_nativeFontInfoOk ) return m_nativeFontInfo.SetFaceName(faceName); - m_faceName = faceName; + m_faceName = faceName; return true; } @@ -321,6 +321,8 @@ protected: bool m_nativeFontInfoOk; }; +#define M_FONTDATA ((wxFontRefData*)m_refData) + // ============================================================================ // implementation // ============================================================================ @@ -417,7 +419,11 @@ void wxNativeFontInfo::Init() // we get better font quality if we use this instead of DEFAULT_QUALITY // apparently without any drawbacks +#ifdef __WXWINCE__ + lf.lfQuality = CLEARTYPE_QUALITY; +#else lf.lfQuality = PROOF_QUALITY; +#endif } int wxNativeFontInfo::GetPointSize() const @@ -634,7 +640,7 @@ void wxNativeFontInfo::SetFamily(wxFontFamily family) // is returned as default GUI font for compatibility int verMaj; ff_family = FF_SWISS; - if(wxGetOsVersion(&verMaj) == wxWINDOWS_NT && verMaj >= 5) + if(wxGetOsVersion(&verMaj) == wxOS_WINDOWS_NT && verMaj >= 5) facename.Add(_T("MS Shell Dlg 2")); else facename.Add(_T("MS Shell Dlg")); @@ -1014,6 +1020,8 @@ int wxFont::GetPointSize() const wxSize wxFont::GetPixelSize() const { + wxCHECK_MSG( Ok(), wxDefaultSize, wxT("invalid font") ); + return M_FONTDATA->GetPixelSize(); } @@ -1068,12 +1076,14 @@ wxFontEncoding wxFont::GetEncoding() const const wxNativeFontInfo *wxFont::GetNativeFontInfo() const { - return M_FONTDATA->HasNativeFontInfo() ? &(M_FONTDATA->GetNativeFontInfo()) + return Ok() && M_FONTDATA->HasNativeFontInfo() ? &(M_FONTDATA->GetNativeFontInfo()) : NULL; } wxString wxFont::GetNativeFontInfoDesc() const { + wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") ); + // be sure we have an HFONT associated... wxConstCast(this, wxFont)->RealizeResource(); return wxFontBase::GetNativeFontInfoDesc(); @@ -1081,6 +1091,8 @@ wxString wxFont::GetNativeFontInfoDesc() const wxString wxFont::GetNativeFontInfoUserDesc() const { + wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") ); + // be sure we have an HFONT associated... wxConstCast(this, wxFont)->RealizeResource(); return wxFontBase::GetNativeFontInfoUserDesc();