]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mgl/font.h
Prevent seg fault for older GTK+
[wxWidgets.git] / include / wx / mgl / font.h
CommitLineData
32b8ec41
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: font.h
3// Author: Vaclav Slavik
4// Id: $Id$
52750c2e 5// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
65571936 6// Licence: wxWindows licence
32b8ec41
VZ
7/////////////////////////////////////////////////////////////////////////////
8
9#ifndef __WX_FONT_H__
10#define __WX_FONT_H__
11
32b8ec41
VZ
12#include "wx/hash.h"
13
14// ----------------------------------------------------------------------------
15// classes
16// ----------------------------------------------------------------------------
17
18class WXDLLEXPORT wxDC;
19class WXDLLEXPORT wxPaintDC;
20class WXDLLEXPORT wxWindow;
21class WXDLLEXPORT wxFont;
22
23struct font_t;
24
25// ----------------------------------------------------------------------------
26// wxFont
27// ----------------------------------------------------------------------------
28
29class WXDLLEXPORT wxFont : public wxFontBase
30{
31public:
32 // ctors and such
f8855e47 33 wxFont() { }
32b8ec41
VZ
34
35 wxFont(const wxNativeFontInfo& info)
36 {
32b8ec41
VZ
37 (void)Create(info);
38 }
39
40 wxFont(int size,
41 int family,
42 int style,
43 int weight,
44 bool underlined = FALSE,
45 const wxString& face = wxEmptyString,
46 wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
47 {
32b8ec41
VZ
48 (void)Create(size, family, style, weight, underlined, face, encoding);
49 }
50
51 bool Create(int size,
52 int family,
53 int style,
54 int weight,
55 bool underlined = FALSE,
56 const wxString& face = wxEmptyString,
57 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
58
59 bool Create(const wxNativeFontInfo& fontinfo);
60
d3c7fc99 61 virtual ~wxFont() {}
32b8ec41 62
32b8ec41
VZ
63 // implement base class pure virtuals
64 virtual int GetPointSize() const;
65 virtual int GetFamily() const;
66 virtual int GetStyle() const;
67 virtual int GetWeight() const;
68 virtual wxString GetFaceName() const;
69 virtual bool GetUnderlined() const;
70 virtual wxFontEncoding GetEncoding() const;
f3437beb 71 virtual bool IsFixedWidth() const;
3bf5a59b 72 virtual const wxNativeFontInfo *GetNativeFontInfo() const;
32b8ec41
VZ
73
74 virtual void SetPointSize(int pointSize);
75 virtual void SetFamily(int family);
76 virtual void SetStyle(int style);
77 virtual void SetWeight(int weight);
85ab460e 78 virtual bool SetFaceName(const wxString& faceName);
32b8ec41
VZ
79 virtual void SetUnderlined(bool underlined);
80 virtual void SetEncoding(wxFontEncoding encoding);
81
d7ae4a62
VS
82 // Unofficial API, don't use
83 virtual void SetNoAntiAliasing(bool no = true);
84 virtual bool GetNoAntiAliasing() const;
85
32b8ec41
VZ
86 struct font_t *GetMGLfont_t(float scale, bool antialiased);
87
32b8ec41 88protected:
6d7ee9e8
VS
89 // ref counting code
90 virtual wxObjectRefData *CreateRefData() const;
91 virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
92
32b8ec41
VZ
93private:
94 DECLARE_DYNAMIC_CLASS(wxFont)
95};
96
97#endif // __WX_FONT_H__