#include "wx/x11/private.h"
-IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
-
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
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);
bool m_underlined;
wxString m_faceName;
wxFontEncoding m_encoding; // Unused in Unicode mode
- bool m_noAA; // No anti-aliasing
wxNativeFontInfo m_nativeFontInfo;
void wxFontRefData::InitFromNative()
{
- m_noAA = false;
-
#if wxUSE_UNICODE
// Get native info
PangoFontDescription *desc = m_nativeFontInfo.description;
}
switch ( wxToupper( m_nativeFontInfo.
- GetXFontComponent(wxXLFD_SLANT)[0u]).GetValue() )
+ GetXFontComponent(wxXLFD_SLANT)[0u]).GetValue() )
{
case wxT('I'): // italique
m_style = wxFONTSTYLE_ITALIC;
m_faceName = data.m_faceName;
m_encoding = data.m_encoding;
- m_noAA = data.m_noAA;
-
m_nativeFontInfo = data.m_nativeFontInfo;
}
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
bool wxFont::IsFixedWidth() const
{
- wxCHECK_MSG( Ok(), false, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), false, wxT("invalid font") );
#if wxUSE_UNICODE
return wxFontBase::IsFixedWidth();
M_FONTDATA->SetNativeFontInfo( info );
}
-void wxFont::SetNoAntiAliasing( bool no )
-{
- Unshare();
-
- M_FONTDATA->SetNoAntiAliasing( no );
-}
-
-#if wxUSE_UNICODE
-#else
+#if !wxUSE_UNICODE
// ----------------------------------------------------------------------------
// X11 implementation
// 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
return (f ? f->m_fontStruct : (WXFontStructPtr) 0);
}
-#endif
+#endif // !wxUSE_UNICODE