]>
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 |
8bbe427f | 7 | // Licence: wxWindows licence |
c801d85f KB |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
c801d85f KB |
10 | #ifndef __GTKFONTH__ |
11 | #define __GTKFONTH__ | |
12 | ||
12028905 | 13 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
0c5d3e1c | 14 | #pragma interface |
c801d85f KB |
15 | #endif |
16 | ||
c801d85f | 17 | #include "wx/hash.h" |
c801d85f | 18 | |
0c5d3e1c | 19 | // ---------------------------------------------------------------------------- |
c801d85f | 20 | // classes |
0c5d3e1c | 21 | // ---------------------------------------------------------------------------- |
c801d85f KB |
22 | |
23 | class wxDC; | |
24 | class wxPaintDC; | |
25 | class wxWindow; | |
26 | ||
27 | class wxFont; | |
c801d85f | 28 | |
0c5d3e1c | 29 | // ---------------------------------------------------------------------------- |
c801d85f | 30 | // wxFont |
0c5d3e1c | 31 | // ---------------------------------------------------------------------------- |
c801d85f | 32 | |
0c5d3e1c | 33 | class wxFont : public wxFontBase |
c801d85f | 34 | { |
358fc25c | 35 | public: |
0c5d3e1c VZ |
36 | // ctors and such |
37 | wxFont() { Init(); } | |
6788ecb8 | 38 | wxFont(const wxFont& font) : wxFontBase() { Init(); Ref(font); } |
409d5a58 VZ |
39 | |
40 | // wxGTK-specific | |
41 | wxFont(const wxString& fontname) | |
7826e2dd VZ |
42 | { |
43 | Init(); | |
0c5d3e1c | 44 | |
409d5a58 | 45 | Create(fontname); |
7826e2dd VZ |
46 | } |
47 | ||
48 | wxFont(const wxNativeFontInfo& info); | |
0c5d3e1c VZ |
49 | |
50 | wxFont(int size, | |
51 | int family, | |
52 | int style, | |
53 | int weight, | |
54 | bool underlined = FALSE, | |
55 | const wxString& face = wxEmptyString, | |
56 | wxFontEncoding encoding = wxFONTENCODING_DEFAULT) | |
57 | { | |
58 | Init(); | |
59 | ||
60 | (void)Create(size, family, style, weight, underlined, face, encoding); | |
61 | } | |
62 | ||
63 | bool Create(int size, | |
64 | int family, | |
65 | int style, | |
66 | int weight, | |
67 | bool underlined = FALSE, | |
68 | const wxString& face = wxEmptyString, | |
7826e2dd | 69 | wxFontEncoding encoding = wxFONTENCODING_DEFAULT); |
30764ab5 | 70 | |
7826e2dd | 71 | // wxGTK-specific |
409d5a58 | 72 | bool Create(const wxString& fontname); |
0c5d3e1c VZ |
73 | |
74 | ~wxFont(); | |
75 | ||
7826e2dd VZ |
76 | // assignment |
77 | wxFont& operator=(const wxFont& font); | |
78 | ||
0c5d3e1c VZ |
79 | // implement base class pure virtuals |
80 | virtual int GetPointSize() const; | |
81 | virtual int GetFamily() const; | |
82 | virtual int GetStyle() const; | |
83 | virtual int GetWeight() const; | |
84 | virtual wxString GetFaceName() const; | |
85 | virtual bool GetUnderlined() const; | |
86 | virtual wxFontEncoding GetEncoding() const; | |
7826e2dd | 87 | virtual wxNativeFontInfo *GetNativeFontInfo() const; |
53f6aab7 | 88 | virtual bool IsFixedWidth() const; |
0c5d3e1c VZ |
89 | |
90 | virtual void SetPointSize( int pointSize ); | |
91 | virtual void SetFamily( int family ); | |
92 | virtual void SetStyle( int style ); | |
93 | virtual void SetWeight( int weight ); | |
94 | virtual void SetFaceName( const wxString& faceName ); | |
95 | virtual void SetUnderlined( bool underlined ); | |
96 | virtual void SetEncoding(wxFontEncoding encoding); | |
97 | ||
2b5f62a0 VZ |
98 | virtual void SetNoAntiAliasing( bool no = TRUE ); |
99 | virtual bool GetNoAntiAliasing(); | |
9045ad9d | 100 | |
0c5d3e1c | 101 | // implementation from now on |
0c5d3e1c VZ |
102 | void Unshare(); |
103 | ||
138618ac | 104 | #ifndef __WXGTK20__ |
0c5d3e1c | 105 | GdkFont* GetInternalFont(float scale = 1.0) const; |
138618ac | 106 | #endif |
0c5d3e1c VZ |
107 | |
108 | // no data :-) | |
109 | ||
110 | protected: | |
9045ad9d VZ |
111 | virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info ); |
112 | ||
0c5d3e1c VZ |
113 | // common part of all ctors |
114 | void Init(); | |
115 | ||
116 | private: | |
117 | DECLARE_DYNAMIC_CLASS(wxFont) | |
c801d85f KB |
118 | }; |
119 | ||
c801d85f | 120 | #endif // __GTKFONTH__ |