X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/03647350fc7cd141953c72e0284e928847d30f44..04fa04d8067d235ab45b5bc05b65f0679634b541:/src/x11/font.cpp diff --git a/src/x11/font.cpp b/src/x11/font.cpp index 49a2b7dfd5..aa89f60ffd 100644 --- a/src/x11/font.cpp +++ b/src/x11/font.cpp @@ -44,8 +44,6 @@ #include "wx/x11/private.h" -IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) - // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- @@ -125,9 +123,6 @@ public: bool SetFaceName(const wxString& facename); void SetEncoding(wxFontEncoding encoding); - void SetNoAntiAliasing( bool no = true ) { m_noAA = no; } - bool GetNoAntiAliasing() const { return m_noAA; } - // and this one also modifies all the other font data fields void SetNativeFontInfo(const wxNativeFontInfo& info); @@ -152,7 +147,6 @@ protected: bool m_underlined; wxString m_faceName; wxFontEncoding m_encoding; // Unused in Unicode mode - bool m_noAA; // No anti-aliasing wxNativeFontInfo m_nativeFontInfo; @@ -232,8 +226,6 @@ void wxFontRefData::Init(int pointSize, void wxFontRefData::InitFromNative() { - m_noAA = false; - #if wxUSE_UNICODE // Get native info PangoFontDescription *desc = m_nativeFontInfo.description; @@ -414,8 +406,6 @@ wxFontRefData::wxFontRefData( const wxFontRefData& data ) m_faceName = data.m_faceName; m_encoding = data.m_encoding; - m_noAA = data.m_noAA; - m_nativeFontInfo = data.m_nativeFontInfo; } @@ -721,63 +711,54 @@ void wxFont::Unshare() int wxFont::GetPointSize() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid font") ); return M_FONTDATA->m_pointSize; } wxString wxFont::GetFaceName() const { - wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxEmptyString, wxT("invalid font") ); return M_FONTDATA->m_faceName; } -wxFontFamily wxFont::GetFamily() const +wxFontFamily wxFont::DoGetFamily() const { - wxCHECK_MSG( Ok(), wxFONTFAMILY_MAX, wxT("invalid font") ); - return M_FONTDATA->m_family; } wxFontStyle wxFont::GetStyle() const { - wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTSTYLE_MAX, wxT("invalid font") ); return M_FONTDATA->m_style; } wxFontWeight wxFont::GetWeight() const { - wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTWEIGHT_MAX, wxT("invalid font") ); return M_FONTDATA->m_weight; } bool wxFont::GetUnderlined() const { - wxCHECK_MSG( Ok(), false, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid font") ); return M_FONTDATA->m_underlined; } wxFontEncoding wxFont::GetEncoding() const { - wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); return M_FONTDATA->m_encoding; } -bool wxFont::GetNoAntiAliasing() const -{ - wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); - - return M_FONTDATA->m_noAA; -} - const wxNativeFontInfo *wxFont::GetNativeFontInfo() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") ); #if wxUSE_UNICODE #else @@ -790,7 +771,7 @@ const wxNativeFontInfo *wxFont::GetNativeFontInfo() const bool wxFont::IsFixedWidth() const { - wxCHECK_MSG( Ok(), false, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid font") ); #if wxUSE_UNICODE return wxFontBase::IsFixedWidth(); @@ -872,15 +853,7 @@ void wxFont::DoSetNativeFontInfo( const wxNativeFontInfo& info ) M_FONTDATA->SetNativeFontInfo( info ); } -void wxFont::SetNoAntiAliasing( bool no ) -{ - Unshare(); - - M_FONTDATA->SetNoAntiAliasing( no ); -} - -#if wxUSE_UNICODE -#else +#if !wxUSE_UNICODE // ---------------------------------------------------------------------------- // X11 implementation @@ -891,7 +864,7 @@ void wxFont::SetNoAntiAliasing( bool no ) // font to list in the private data for future reference. wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const { - if ( !Ok() ) + if ( !IsOk() ) return NULL; long intScale = long(scale * 100.0 + 0.5); // key for wxXFont @@ -946,4 +919,4 @@ WXFontStructPtr wxFont::GetFontStruct(double scale, WXDisplay* display) const return (f ? f->m_fontStruct : (WXFontStructPtr) 0); } -#endif +#endif // !wxUSE_UNICODE