2001-06-26 21:05:06 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: font.h
|
|
|
|
// Author: Vaclav Slavik
|
|
|
|
// Id: $Id$
|
2002-02-14 20:30:34 +00:00
|
|
|
// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
2001-06-26 21:05:06 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __WX_FONT_H__
|
|
|
|
#define __WX_FONT_H__
|
|
|
|
|
|
|
|
#include "wx/hash.h"
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2007-07-09 10:09:52 +00:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxDC;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxPaintDC;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxWindow;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxFont;
|
2001-06-26 21:05:06 +00:00
|
|
|
|
|
|
|
struct font_t;
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxFont
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxFont : public wxFontBase
|
2001-06-26 21:05:06 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// ctors and such
|
2006-02-09 00:51:23 +00:00
|
|
|
wxFont() { }
|
2001-06-26 21:05:06 +00:00
|
|
|
|
|
|
|
wxFont(const wxNativeFontInfo& info)
|
|
|
|
{
|
2008-11-03 17:02:25 +00:00
|
|
|
(void)Create(info);
|
2001-06-26 21:05:06 +00:00
|
|
|
}
|
|
|
|
|
2008-11-03 17:02:25 +00:00
|
|
|
#if FUTURE_WXWIN_COMPATIBILITY_3_0
|
2001-06-26 21:05:06 +00:00
|
|
|
wxFont(int size,
|
|
|
|
int family,
|
|
|
|
int style,
|
|
|
|
int weight,
|
2008-11-03 17:02:25 +00:00
|
|
|
bool underlined = false,
|
2001-06-26 21:05:06 +00:00
|
|
|
const wxString& face = wxEmptyString,
|
|
|
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
|
|
|
{
|
2008-11-03 17:02:25 +00:00
|
|
|
(void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
wxFont(int size,
|
|
|
|
wxFontFamily family,
|
|
|
|
wxFontStyle style,
|
|
|
|
wxFontWeight weight,
|
|
|
|
bool underlined = false,
|
|
|
|
const wxString& face = wxEmptyString,
|
|
|
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
|
|
|
{
|
|
|
|
Create(size, family, style, weight, underlined, face, encoding);
|
2001-06-26 21:05:06 +00:00
|
|
|
}
|
2009-08-21 10:41:26 +00:00
|
|
|
|
2009-03-15 16:28:33 +00:00
|
|
|
wxFont(const wxSize& pixelSize,
|
|
|
|
wxFontFamily family,
|
|
|
|
wxFontStyle style,
|
|
|
|
wxFontWeight weight,
|
|
|
|
bool underlined = false,
|
|
|
|
const wxString& face = wxEmptyString,
|
|
|
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
|
|
|
|
{
|
|
|
|
Create(10, family, style, weight, underlined, face, encoding);
|
|
|
|
SetPixelSize(pixelSize);
|
|
|
|
}
|
2009-08-21 10:41:26 +00:00
|
|
|
|
2001-06-26 21:05:06 +00:00
|
|
|
bool Create(int size,
|
2008-11-03 17:02:25 +00:00
|
|
|
wxFontFamily family,
|
|
|
|
wxFontStyle style,
|
|
|
|
wxFontWeight weight,
|
|
|
|
bool underlined = false,
|
2001-06-26 21:05:06 +00:00
|
|
|
const wxString& face = wxEmptyString,
|
|
|
|
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
|
|
|
|
|
|
|
bool Create(const wxNativeFontInfo& fontinfo);
|
|
|
|
|
2006-09-05 20:47:48 +00:00
|
|
|
virtual ~wxFont() {}
|
2001-06-26 21:05:06 +00:00
|
|
|
|
|
|
|
// implement base class pure virtuals
|
|
|
|
virtual int GetPointSize() const;
|
2008-11-03 17:02:25 +00:00
|
|
|
virtual wxFontFamily GetFamily() const;
|
|
|
|
virtual wxFontStyle GetStyle() const;
|
|
|
|
virtual wxFontWeight GetWeight() const;
|
2001-06-26 21:05:06 +00:00
|
|
|
virtual wxString GetFaceName() const;
|
|
|
|
virtual bool GetUnderlined() const;
|
|
|
|
virtual wxFontEncoding GetEncoding() const;
|
2002-01-17 19:38:39 +00:00
|
|
|
virtual bool IsFixedWidth() const;
|
2003-09-24 01:23:37 +00:00
|
|
|
virtual const wxNativeFontInfo *GetNativeFontInfo() const;
|
2001-06-26 21:05:06 +00:00
|
|
|
|
|
|
|
virtual void SetPointSize(int pointSize);
|
2008-11-03 17:02:25 +00:00
|
|
|
virtual void SetFamily(wxFontFamily family);
|
|
|
|
virtual void SetStyle(wxFontStyle style);
|
|
|
|
virtual void SetWeight(wxFontWeight weight);
|
2006-05-29 00:03:36 +00:00
|
|
|
virtual bool SetFaceName(const wxString& faceName);
|
2001-06-26 21:05:06 +00:00
|
|
|
virtual void SetUnderlined(bool underlined);
|
|
|
|
virtual void SetEncoding(wxFontEncoding encoding);
|
|
|
|
|
2009-06-12 20:11:21 +00:00
|
|
|
wxDECLARE_COMMON_FONT_METHODS();
|
2008-11-03 17:02:25 +00:00
|
|
|
|
2001-06-26 21:05:06 +00:00
|
|
|
struct font_t *GetMGLfont_t(float scale, bool antialiased);
|
|
|
|
|
|
|
|
protected:
|
2002-02-09 23:29:05 +00:00
|
|
|
// ref counting code
|
2007-12-15 17:54:20 +00:00
|
|
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
|
|
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
2002-02-09 23:29:05 +00:00
|
|
|
|
2001-06-26 21:05:06 +00:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxFont)
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __WX_FONT_H__
|