]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: font.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
58614078 | 5 | // Id: $Id$ |
371a5b4e | 6 | // Copyright: (c) 1998 Robert Roebling |
65571936 | 7 | // Licence: wxWindows licence |
c801d85f KB |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
c801d85f KB |
10 | #ifndef __GTKFONTH__ |
11 | #define __GTKFONTH__ | |
12 | ||
c801d85f | 13 | #include "wx/hash.h" |
c801d85f | 14 | |
0c5d3e1c | 15 | // ---------------------------------------------------------------------------- |
c801d85f | 16 | // classes |
0c5d3e1c | 17 | // ---------------------------------------------------------------------------- |
c801d85f | 18 | |
20123d49 MW |
19 | class WXDLLIMPEXP_CORE wxDC; |
20 | class WXDLLIMPEXP_CORE wxPaintDC; | |
21 | class WXDLLIMPEXP_CORE wxWindow; | |
c801d85f | 22 | |
20123d49 | 23 | class WXDLLIMPEXP_CORE wxFont; |
c801d85f | 24 | |
0c5d3e1c | 25 | // ---------------------------------------------------------------------------- |
c801d85f | 26 | // wxFont |
0c5d3e1c | 27 | // ---------------------------------------------------------------------------- |
c801d85f | 28 | |
20123d49 | 29 | class WXDLLIMPEXP_CORE wxFont : public wxFontBase |
c801d85f | 30 | { |
358fc25c | 31 | public: |
f8855e47 | 32 | wxFont() { } |
409d5a58 VZ |
33 | |
34 | // wxGTK-specific | |
35 | wxFont(const wxString& fontname) | |
7826e2dd | 36 | { |
409d5a58 | 37 | Create(fontname); |
7826e2dd VZ |
38 | } |
39 | ||
40 | wxFont(const wxNativeFontInfo& info); | |
0c5d3e1c VZ |
41 | |
42 | wxFont(int size, | |
43 | int family, | |
44 | int style, | |
45 | int weight, | |
dabbc6a5 | 46 | bool underlined = false, |
0c5d3e1c VZ |
47 | const wxString& face = wxEmptyString, |
48 | wxFontEncoding encoding = wxFONTENCODING_DEFAULT) | |
49 | { | |
0c5d3e1c VZ |
50 | (void)Create(size, family, style, weight, underlined, face, encoding); |
51 | } | |
52 | ||
53 | bool Create(int size, | |
54 | int family, | |
55 | int style, | |
56 | int weight, | |
dabbc6a5 | 57 | bool underlined = false, |
0c5d3e1c | 58 | const wxString& face = wxEmptyString, |
7826e2dd | 59 | wxFontEncoding encoding = wxFONTENCODING_DEFAULT); |
30764ab5 | 60 | |
7826e2dd | 61 | // wxGTK-specific |
409d5a58 | 62 | bool Create(const wxString& fontname); |
0c5d3e1c VZ |
63 | |
64 | ~wxFont(); | |
65 | ||
66 | // implement base class pure virtuals | |
67 | virtual int GetPointSize() const; | |
68 | virtual int GetFamily() const; | |
69 | virtual int GetStyle() const; | |
70 | virtual int GetWeight() const; | |
71 | virtual wxString GetFaceName() const; | |
72 | virtual bool GetUnderlined() const; | |
73 | virtual wxFontEncoding GetEncoding() const; | |
3bf5a59b | 74 | virtual const wxNativeFontInfo *GetNativeFontInfo() const; |
53f6aab7 | 75 | virtual bool IsFixedWidth() const; |
0c5d3e1c VZ |
76 | |
77 | virtual void SetPointSize( int pointSize ); | |
78 | virtual void SetFamily( int family ); | |
79 | virtual void SetStyle( int style ); | |
80 | virtual void SetWeight( int weight ); | |
81 | virtual void SetFaceName( const wxString& faceName ); | |
82 | virtual void SetUnderlined( bool underlined ); | |
83 | virtual void SetEncoding(wxFontEncoding encoding); | |
84 | ||
dabbc6a5 | 85 | virtual void SetNoAntiAliasing( bool no = true ); |
5ac2e80c | 86 | virtual bool GetNoAntiAliasing() const ; |
9045ad9d | 87 | |
0c5d3e1c | 88 | // implementation from now on |
0c5d3e1c VZ |
89 | void Unshare(); |
90 | ||
0c5d3e1c VZ |
91 | // no data :-) |
92 | ||
93 | protected: | |
9045ad9d VZ |
94 | virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info ); |
95 | ||
0c5d3e1c VZ |
96 | // common part of all ctors |
97 | void Init(); | |
98 | ||
99 | private: | |
100 | DECLARE_DYNAMIC_CLASS(wxFont) | |
c801d85f KB |
101 | }; |
102 | ||
c801d85f | 103 | #endif // __GTKFONTH__ |