X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/03647350fc7cd141953c72e0284e928847d30f44..cc4d5638c66a409e421420ed7110917755a66788:/src/x11/font.cpp diff --git a/src/x11/font.cpp b/src/x11/font.cpp index 49a2b7dfd5..4aa5917e88 100644 --- a/src/x11/font.cpp +++ b/src/x11/font.cpp @@ -4,7 +4,6 @@ // Author: Julian Smart // Modified by: // Created: 17/09/98 -// RCS-ID: $Id$ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -44,8 +43,6 @@ #include "wx/x11/private.h" -IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) - // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- @@ -125,9 +122,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 +146,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 +225,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 +405,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 +710,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 +770,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 +852,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 +863,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 +918,4 @@ WXFontStructPtr wxFont::GetFontStruct(double scale, WXDisplay* display) const return (f ? f->m_fontStruct : (WXFontStructPtr) 0); } -#endif +#endif // !wxUSE_UNICODE