applied wxNativeFontInfo patch from Derry Bryson (with minor changes)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9134 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
1a2b91971d
commit
3b7e6277be
@ -100,6 +100,15 @@ public:
|
||||
(void)Create(size, family, style, weight, underlined, face, encoding);
|
||||
}
|
||||
|
||||
wxFont(const wxNativeFontInfo& info)
|
||||
{
|
||||
Init();
|
||||
|
||||
(void)Create(info);
|
||||
}
|
||||
|
||||
wxFont(const wxString& fontDesc);
|
||||
|
||||
bool Create(int size,
|
||||
int family,
|
||||
int style,
|
||||
@ -108,6 +117,8 @@ public:
|
||||
const wxString& face = wxEmptyString,
|
||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
||||
|
||||
bool Create(const wxNativeFontInfo& info);
|
||||
|
||||
virtual ~wxFont();
|
||||
|
||||
// assignment
|
||||
|
@ -18,13 +18,12 @@
|
||||
#include "wx/font.h"
|
||||
#include "wx/gdicmn.h"
|
||||
|
||||
#include "wx/fontutil.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARIES
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
@ -120,6 +119,13 @@ void wxFont::Init()
|
||||
wxTheFontList->Append(this);
|
||||
}
|
||||
|
||||
wxFont::wxFont(const wxString& fontdesc)
|
||||
{
|
||||
wxNativeFontInfo info;
|
||||
if ( info.FromString(fontdesc) )
|
||||
(void)Create(info);
|
||||
}
|
||||
|
||||
bool wxFont::Create(int pointSize,
|
||||
int family,
|
||||
int style,
|
||||
@ -137,6 +143,12 @@ bool wxFont::Create(int pointSize,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxFont::Create(const wxNativeFontInfo& info)
|
||||
{
|
||||
return Create(info.pointSize, info.family, info.style, info.weight,
|
||||
info.underlined, info.faceName, info.encoding);
|
||||
}
|
||||
|
||||
wxFont::~wxFont()
|
||||
{
|
||||
if (wxTheFontList)
|
||||
|
@ -34,6 +34,7 @@
|
||||
|
||||
#include "wx/fontenum.h"
|
||||
#include "wx/fontmap.h"
|
||||
#include "wx/fontutil.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private classes
|
||||
|
@ -18,13 +18,12 @@
|
||||
#include "wx/font.h"
|
||||
#include "wx/gdicmn.h"
|
||||
|
||||
#include "wx/fontutil.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARIES
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
@ -120,6 +119,13 @@ void wxFont::Init()
|
||||
wxTheFontList->Append(this);
|
||||
}
|
||||
|
||||
wxFont::wxFont(const wxString& fontdesc)
|
||||
{
|
||||
wxNativeFontInfo info;
|
||||
if ( info.FromString(fontdesc) )
|
||||
(void)Create(info);
|
||||
}
|
||||
|
||||
bool wxFont::Create(int pointSize,
|
||||
int family,
|
||||
int style,
|
||||
@ -137,6 +143,12 @@ bool wxFont::Create(int pointSize,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxFont::Create(const wxNativeFontInfo& info)
|
||||
{
|
||||
return Create(info.pointSize, info.family, info.style, info.weight,
|
||||
info.underlined, info.faceName, info.encoding);
|
||||
}
|
||||
|
||||
wxFont::~wxFont()
|
||||
{
|
||||
if (wxTheFontList)
|
||||
|
@ -34,6 +34,7 @@
|
||||
|
||||
#include "wx/fontenum.h"
|
||||
#include "wx/fontmap.h"
|
||||
#include "wx/fontutil.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private classes
|
||||
|
Loading…
Reference in New Issue
Block a user