Most of them were dummy and didn't do anything and this API was never meant to
be used anyhow.
Keep just the declarations in wxFontBase but mark them as deprecated.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62349
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
18 files changed:
the static box itself.
- wxMouseState::{Left,Middle,Right}Down() were renamed to XXXIsDown() for
consistency with wxMouseEvent and the old names were deprecated.
the static box itself.
- wxMouseState::{Left,Middle,Right}Down() were renamed to XXXIsDown() for
consistency with wxMouseEvent and the old names were deprecated.
+- wxFont::SetNoAntiAliasing() was deprecated, it never really worked in most
+ ports and was always marked as "experimental" API. It will be replaced with
+ wxDC-level anti-aliasing control in the future.
Major new features in this release
Major new features in this release
wxDECLARE_COMMON_FONT_METHODS();
wxDECLARE_COMMON_FONT_METHODS();
- // Unofficial API, don't use
- virtual void SetNoAntiAliasing(bool no = true);
- virtual bool GetNoAntiAliasing() const;
-
// implementation from now on:
wxIDirectFBFontPtr GetDirectFBFont(bool antialiased) const;
// implementation from now on:
wxIDirectFBFontPtr GetDirectFBFont(bool antialiased) const;
wxString GetStyleString() const;
wxString GetWeightString() const;
wxString GetStyleString() const;
wxString GetWeightString() const;
- // Unofficial API, don't use
- virtual void SetNoAntiAliasing( bool WXUNUSED(no) = true ) { }
- virtual bool GetNoAntiAliasing() const { return false; }
-
// the default encoding is used for creating all fonts with default
// encoding parameter
static wxFontEncoding GetDefaultEncoding() { return ms_encodingDefault; }
static void SetDefaultEncoding(wxFontEncoding encoding);
// the default encoding is used for creating all fonts with default
// encoding parameter
static wxFontEncoding GetDefaultEncoding() { return ms_encodingDefault; }
static void SetDefaultEncoding(wxFontEncoding encoding);
+ // this doesn't do anything and is kept for compatibility only
+#ifdef WXWIN_COMPATIBILITY_2_8
+ wxDEPRECATED_INLINE(void SetNoAntiAliasing(bool no = true), wxUnusedVar(no););
+ wxDEPRECATED_INLINE(bool GetNoAntiAliasing() const, return false;)
+#endif // WXWIN_COMPATIBILITY_2_8
+
protected:
// the function called by both overloads of SetNativeFontInfo()
virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info);
protected:
// the function called by both overloads of SetNativeFontInfo()
virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info);
wxDECLARE_COMMON_FONT_METHODS();
wxDECLARE_COMMON_FONT_METHODS();
- virtual void SetNoAntiAliasing( bool no = true );
- virtual bool GetNoAntiAliasing() const ;
-
// implementation from now on
void Unshare();
// implementation from now on
void Unshare();
wxDECLARE_COMMON_FONT_METHODS();
wxDECLARE_COMMON_FONT_METHODS();
- virtual void SetNoAntiAliasing( bool no = true );
- virtual bool GetNoAntiAliasing() const ;
-
// implementation from now on
void Unshare();
// implementation from now on
void Unshare();
wxDECLARE_COMMON_FONT_METHODS();
wxDECLARE_COMMON_FONT_METHODS();
- // Unofficial API, don't use
- virtual void SetNoAntiAliasing(bool no = true);
- virtual bool GetNoAntiAliasing() const;
-
struct font_t *GetMGLfont_t(float scale, bool antialiased);
protected:
struct font_t *GetMGLfont_t(float scale, bool antialiased);
protected:
virtual bool RealizeResource();
virtual bool RealizeResource();
- // Unofficial API, don't use
- virtual void SetNoAntiAliasing( bool noAA = TRUE ) ;
- virtual bool GetNoAntiAliasing() const ;
-
// Mac-specific, risks to change, don't use in portable code
#if wxOSX_USE_CARBON && wxOSX_USE_ATSU_TEXT
// Mac-specific, risks to change, don't use in portable code
#if wxOSX_USE_CARBON && wxOSX_USE_ATSU_TEXT
void SetUnderlined(bool underlined);
void SetEncoding(wxFontEncoding encoding);
void SetUnderlined(bool underlined);
void SetEncoding(wxFontEncoding encoding);
- // Unofficial API, don't use
- void SetNoAntiAliasing(bool no);
- bool GetNoAntiAliasing() const { return m_noAA; }
-
private:
void EnsureValidFont();
wxNativeFontInfo m_info;
private:
void EnsureValidFont();
wxNativeFontInfo m_info;
wxFontFace *m_fontFace;
wxFontBundle *m_fontBundle;
wxFontFace *m_fontFace;
wxFontBundle *m_fontBundle;
wxDECLARE_COMMON_FONT_METHODS();
wxDECLARE_COMMON_FONT_METHODS();
- virtual void SetNoAntiAliasing( bool no = TRUE );
- virtual bool GetNoAntiAliasing() const ;
-
// Implementation
#if wxUSE_PANGO
// Implementation
#if wxUSE_PANGO
if ( f.IsOk() )
f.SetPointSize( /*LogicalToDeviceYRel*/(font.GetPointSize()));
m_graphicContext->SetFont( f, m_textForegroundColour );
if ( f.IsOk() )
f.SetPointSize( /*LogicalToDeviceYRel*/(font.GetPointSize()));
m_graphicContext->SetFont( f, m_textForegroundColour );
-#if defined(__WXGTK__) || defined(__WXOSX__)
- if ( m_font.IsOk() && m_font.GetNoAntiAliasing() )
- {
- m_graphicContext->SetAntialiasMode(wxANTIALIAS_NONE);
- }
-#endif
m_info.underlined = underlined;
m_info.encoding = encoding;
m_info.underlined = underlined;
m_info.encoding = encoding;
m_fontFace = NULL;
m_fontBundle = NULL;
m_fontValid = false;
m_fontFace = NULL;
m_fontBundle = NULL;
m_fontValid = false;
wxFontMgrFontRefData::wxFontMgrFontRefData(const wxFontMgrFontRefData& data)
{
m_info = data.m_info;
wxFontMgrFontRefData::wxFontMgrFontRefData(const wxFontMgrFontRefData& data)
{
m_info = data.m_info;
m_fontFace = data.m_fontFace;
m_fontBundle = data.m_fontBundle;
m_fontFace = data.m_fontFace;
m_fontBundle = data.m_fontBundle;
{
wxConstCast(this, wxFontMgrFontRefData)->EnsureValidFont();
return m_fontFace->GetFontInstance(m_info.pointSize * scale,
{
wxConstCast(this, wxFontMgrFontRefData)->EnsureValidFont();
return m_fontFace->GetFontInstance(m_info.pointSize * scale,
- antialiased && !m_noAA);
}
void wxFontMgrFontRefData::SetPointSize(int pointSize)
}
void wxFontMgrFontRefData::SetPointSize(int pointSize)
-void wxFontMgrFontRefData::SetNoAntiAliasing(bool no)
-{
- m_noAA = no;
-}
-
-
void wxFontMgrFontRefData::EnsureValidFont()
{
if ( !m_fontValid )
void wxFontMgrFontRefData::EnsureValidFont()
{
if ( !m_fontValid )
return M_FONTDATA->GetNativeFontInfo();
}
return M_FONTDATA->GetNativeFontInfo();
}
-bool wxFont::GetNoAntiAliasing() const
-{
- wxCHECK_MSG( Ok(), false, wxT("invalid font") );
-
- return M_FONTDATA->GetNoAntiAliasing();
-}
-
// ----------------------------------------------------------------------------
// change font attributes
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// change font attributes
// ----------------------------------------------------------------------------
M_FONTDATA->SetEncoding(encoding);
}
M_FONTDATA->SetEncoding(encoding);
}
-void wxFont::SetNoAntiAliasing(bool no)
-{
- AllocExclusive();
- M_FONTDATA->SetNoAntiAliasing(no);
-}
bool SetFaceName(const wxString& facename);
void SetEncoding(wxFontEncoding encoding);
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);
// and this one also modifies all the other font data fields
void SetNativeFontInfo(const wxNativeFontInfo& info);
private:
bool m_underlined;
private:
bool m_underlined;
- bool m_noAA; // No anti-aliasing
// The native font info: basically a PangoFontDescription
wxNativeFontInfo m_nativeFontInfo;
// The native font info: basically a PangoFontDescription
wxNativeFontInfo m_nativeFontInfo;
family = wxFONTFAMILY_SWISS;
m_underlined = underlined;
family = wxFONTFAMILY_SWISS;
m_underlined = underlined;
// Create native font info
m_nativeFontInfo.description = pango_font_description_new();
// Create native font info
m_nativeFontInfo.description = pango_font_description_new();
void wxFontRefData::InitFromNative()
{
void wxFontRefData::InitFromNative()
{
// Get native info
PangoFontDescription *desc = m_nativeFontInfo.description;
// Get native info
PangoFontDescription *desc = m_nativeFontInfo.description;
: wxGDIRefData()
{
m_underlined = data.m_underlined;
: wxGDIRefData()
{
m_underlined = data.m_underlined;
// Forces a copy of the internal data. wxNativeFontInfo should probably
// have a copy ctor and assignment operator to fix this properly but that
// Forces a copy of the internal data. wxNativeFontInfo should probably
// have a copy ctor and assignment operator to fix this properly but that
// Pango always uses UTF8... see also SetEncoding()
}
// Pango always uses UTF8... see also SetEncoding()
}
-bool wxFont::GetNoAntiAliasing() const
-{
- wxCHECK_MSG( IsOk(), false, wxT("invalid font") );
-
- return M_FONTDATA->m_noAA;
-}
-
const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
{
wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") );
const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
{
wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") );
M_FONTDATA->SetNativeFontInfo( info );
}
M_FONTDATA->SetNativeFontInfo( info );
}
-void wxFont::SetNoAntiAliasing( bool no )
-{
- AllocExclusive();
-
- M_FONTDATA->SetNoAntiAliasing( no );
-}
-
wxGDIRefData* wxFont::CreateGDIRefData() const
{
return new wxFontRefData;
wxGDIRefData* wxFont::CreateGDIRefData() const
{
return new wxFontRefData;
bool SetFaceName(const wxString& facename);
void SetEncoding(wxFontEncoding encoding);
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);
// 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 under GTK 2.0
bool m_underlined;
wxString m_faceName;
wxFontEncoding m_encoding; // Unused under GTK 2.0
- bool m_noAA; // No anti-aliasing
// The native font info, basicly an XFLD under GTK 1.2 and
// the pango font description under GTK 2.0.
// The native font info, basicly an XFLD under GTK 1.2 and
// the pango font description under GTK 2.0.
m_underlined = underlined;
m_encoding = encoding;
m_underlined = underlined;
m_encoding = encoding;
}
void wxFontRefData::InitFromNative()
{
}
void wxFontRefData::InitFromNative()
{
// get the font parameters from the XLFD
// -------------------------------------
// get the font parameters from the XLFD
// -------------------------------------
m_faceName = data.m_faceName;
m_encoding = data.m_encoding;
m_faceName = data.m_faceName;
m_encoding = data.m_encoding;
- m_noAA = data.m_noAA;
-
// Forces a copy of the internal data. wxNativeFontInfo should probably
// have a copy ctor and assignment operator to fix this properly but that
// would break binary compatibility...
// Forces a copy of the internal data. wxNativeFontInfo should probably
// have a copy ctor and assignment operator to fix this properly but that
// would break binary compatibility...
return M_FONTDATA->m_encoding;
}
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") );
const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
{
wxCHECK_MSG( Ok(), NULL, wxT("invalid font") );
M_FONTDATA->SetNativeFontInfo( info );
}
M_FONTDATA->SetNativeFontInfo( info );
}
-void wxFont::SetNoAntiAliasing( bool no )
-{
- Unshare();
-
- M_FONTDATA->SetNoAntiAliasing( no );
-}
-
// ----------------------------------------------------------------------------
// get internal representation of font
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// get internal representation of font
// ----------------------------------------------------------------------------
return M_FONTDATA->GetNativeFontInfo();
}
return M_FONTDATA->GetNativeFontInfo();
}
-bool wxFont::GetNoAntiAliasing() const
-{
- wxCHECK_MSG( Ok(), false, wxT("invalid font") );
-
- return M_FONTDATA->GetNoAntiAliasing();
-}
-
// ----------------------------------------------------------------------------
// change font attributes
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// change font attributes
// ----------------------------------------------------------------------------
M_FONTDATA->SetEncoding(encoding);
}
M_FONTDATA->SetEncoding(encoding);
}
-void wxFont::SetNoAntiAliasing(bool no)
-{
- AllocExclusive();
- M_FONTDATA->SetNoAntiAliasing(no);
-}
virtual ~wxFontRefData();
virtual ~wxFontRefData();
- void SetNoAntiAliasing( bool no = true ) { m_noAA = no; }
-
- bool GetNoAntiAliasing() const { return m_noAA; }
-
void SetPointSize( int size )
{
if( GetPointSize() != size )
void SetPointSize( int size )
{
if( GetPointSize() != size )
#if wxOSX_USE_CORE_TEXT
// void Init( CTFontRef font );
#endif
#if wxOSX_USE_CORE_TEXT
// void Init( CTFontRef font );
#endif
- bool m_noAA; // No anti-aliasing
public:
bool m_fontValid;
#if wxOSX_USE_CARBON && wxOSX_USE_ATSU_TEXT
public:
bool m_fontValid;
#if wxOSX_USE_CARBON && wxOSX_USE_ATSU_TEXT
{
Init();
m_info = data.m_info;
{
Init();
m_info = data.m_info;
m_fontValid = data.m_fontValid;
#if wxOSX_USE_CARBON && wxOSX_USE_ATSU_TEXT
m_macThemeFontID = data.m_macThemeFontID;
m_fontValid = data.m_fontValid;
#if wxOSX_USE_CARBON && wxOSX_USE_ATSU_TEXT
m_macThemeFontID = data.m_macThemeFontID;
void wxFontRefData::Init()
{
void wxFontRefData::Init()
{
#if wxOSX_USE_CARBON && wxOSX_USE_ATSU_TEXT
m_macThemeFontID = kThemeCurrentPortFont ;
#endif
#if wxOSX_USE_CARBON && wxOSX_USE_ATSU_TEXT
m_macThemeFontID = kThemeCurrentPortFont ;
#endif
M_FONTDATA->SetUnderlined( underlined );
}
M_FONTDATA->SetUnderlined( underlined );
}
-void wxFont::SetNoAntiAliasing( bool no )
-{
- AllocExclusive();
-
- M_FONTDATA->SetNoAntiAliasing( no );
-}
-
// ----------------------------------------------------------------------------
// accessors
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// accessors
// ----------------------------------------------------------------------------
return M_FONTDATA->GetEncoding() ;
}
return M_FONTDATA->GetEncoding() ;
}
-bool wxFont::GetNoAntiAliasing() const
-{
- wxCHECK_MSG( M_FONTDATA != NULL , false, wxT("invalid font") );
-
- return M_FONTDATA->GetNoAntiAliasing();
-}
-
#if wxOSX_USE_ATSU_TEXT && wxOSX_USE_CARBON
short wxFont::MacGetFontNum() const
#if wxOSX_USE_ATSU_TEXT && wxOSX_USE_CARBON
short wxFont::MacGetFontNum() const
void Font::Create(const char *faceName, int characterSet,
int size, bool bold, bool italic,
void Font::Create(const char *faceName, int characterSet,
int size, bool bold, bool italic,
+ bool WXUNUSED(extraFontFlag)) {
Release();
// The minus one is done because since Scintilla uses SC_SHARSET_DEFAULT
Release();
// The minus one is done because since Scintilla uses SC_SHARSET_DEFAULT
false,
stc2wx(faceName),
encoding);
false,
stc2wx(faceName),
encoding);
- font->SetNoAntiAliasing(!extraFontFlag);
bool SetFaceName(const wxString& facename);
void SetEncoding(wxFontEncoding encoding);
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);
// 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_underlined;
wxString m_faceName;
wxFontEncoding m_encoding; // Unused in Unicode mode
- bool m_noAA; // No anti-aliasing
wxNativeFontInfo m_nativeFontInfo;
wxNativeFontInfo m_nativeFontInfo;
void wxFontRefData::InitFromNative()
{
void wxFontRefData::InitFromNative()
{
#if wxUSE_UNICODE
// Get native info
PangoFontDescription *desc = m_nativeFontInfo.description;
#if wxUSE_UNICODE
// Get native info
PangoFontDescription *desc = m_nativeFontInfo.description;
m_faceName = data.m_faceName;
m_encoding = data.m_encoding;
m_faceName = data.m_faceName;
m_encoding = data.m_encoding;
- m_noAA = data.m_noAA;
-
m_nativeFontInfo = data.m_nativeFontInfo;
}
m_nativeFontInfo = data.m_nativeFontInfo;
}
return M_FONTDATA->m_encoding;
}
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") );
const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
{
wxCHECK_MSG( Ok(), NULL, wxT("invalid font") );
M_FONTDATA->SetNativeFontInfo( info );
}
M_FONTDATA->SetNativeFontInfo( info );
}
-void wxFont::SetNoAntiAliasing( bool no )
-{
- Unshare();
-
- M_FONTDATA->SetNoAntiAliasing( no );
-}
-
-#if wxUSE_UNICODE
-#else
// ----------------------------------------------------------------------------
// X11 implementation
// ----------------------------------------------------------------------------
// X11 implementation
return (f ? f->m_fontStruct : (WXFontStructPtr) 0);
}
return (f ? f->m_fontStruct : (WXFontStructPtr) 0);
}
+#endif // !wxUSE_UNICODE