]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: font.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
58614078 | 5 | // Id: $Id$ |
c801d85f | 6 | // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem |
8bbe427f | 7 | // Licence: wxWindows licence |
c801d85f KB |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
c801d85f KB |
10 | #ifndef __GTKFONTH__ |
11 | #define __GTKFONTH__ | |
12 | ||
ab7ce33c | 13 | #if defined(__GNUG__) && !defined(__APPLE__) |
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); | |
30764ab5 | 97 | virtual void SetNativeFontInfo( const wxNativeFontInfo& info ); |
0c5d3e1c | 98 | |
2b5f62a0 VZ |
99 | virtual void SetNoAntiAliasing( bool no = TRUE ); |
100 | virtual bool GetNoAntiAliasing(); | |
101 | ||
0c5d3e1c | 102 | // implementation from now on |
0c5d3e1c VZ |
103 | void Unshare(); |
104 | ||
105 | GdkFont* GetInternalFont(float scale = 1.0) const; | |
106 | ||
107 | // no data :-) | |
108 | ||
109 | protected: | |
110 | // common part of all ctors | |
111 | void Init(); | |
112 | ||
113 | private: | |
114 | DECLARE_DYNAMIC_CLASS(wxFont) | |
c801d85f KB |
115 | }; |
116 | ||
c801d85f | 117 | #endif // __GTKFONTH__ |