]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | ///////////////////////////////////////////////////////////////////////////// |
8ef94bfc | 2 | // Name: wx/gtk1/font.h |
c801d85f KB |
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 | |
b5dbe15d VS |
19 | class WXDLLIMPEXP_FWD_CORE wxDC; |
20 | class WXDLLIMPEXP_FWD_CORE wxPaintDC; | |
21 | class WXDLLIMPEXP_FWD_CORE wxWindow; | |
c801d85f | 22 | |
b5dbe15d | 23 | class WXDLLIMPEXP_FWD_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: |
0c5d3e1c | 32 | // ctors and such |
8628b7d4 | 33 | wxFont() { } |
409d5a58 VZ |
34 | |
35 | // wxGTK-specific | |
36 | wxFont(const wxString& fontname) | |
7826e2dd | 37 | { |
409d5a58 | 38 | Create(fontname); |
7826e2dd VZ |
39 | } |
40 | ||
41 | wxFont(const wxNativeFontInfo& info); | |
0c5d3e1c VZ |
42 | |
43 | wxFont(int size, | |
44 | int family, | |
45 | int style, | |
46 | int weight, | |
dabbc6a5 | 47 | bool underlined = false, |
0c5d3e1c VZ |
48 | const wxString& face = wxEmptyString, |
49 | wxFontEncoding encoding = wxFONTENCODING_DEFAULT) | |
50 | { | |
0c5d3e1c VZ |
51 | (void)Create(size, family, style, weight, underlined, face, encoding); |
52 | } | |
53 | ||
54 | bool Create(int size, | |
55 | int family, | |
56 | int style, | |
57 | int weight, | |
dabbc6a5 | 58 | bool underlined = false, |
0c5d3e1c | 59 | const wxString& face = wxEmptyString, |
7826e2dd | 60 | wxFontEncoding encoding = wxFONTENCODING_DEFAULT); |
30764ab5 | 61 | |
7826e2dd | 62 | // wxGTK-specific |
409d5a58 | 63 | bool Create(const wxString& fontname); |
0c5d3e1c | 64 | |
d3c7fc99 | 65 | virtual ~wxFont(); |
0c5d3e1c VZ |
66 | |
67 | // implement base class pure virtuals | |
68 | virtual int GetPointSize() const; | |
69 | virtual int GetFamily() const; | |
70 | virtual int GetStyle() const; | |
71 | virtual int GetWeight() const; | |
72 | virtual wxString GetFaceName() const; | |
73 | virtual bool GetUnderlined() const; | |
74 | virtual wxFontEncoding GetEncoding() const; | |
3bf5a59b | 75 | virtual const wxNativeFontInfo *GetNativeFontInfo() const; |
53f6aab7 | 76 | virtual bool IsFixedWidth() const; |
0c5d3e1c VZ |
77 | |
78 | virtual void SetPointSize( int pointSize ); | |
79 | virtual void SetFamily( int family ); | |
80 | virtual void SetStyle( int style ); | |
81 | virtual void SetWeight( int weight ); | |
85ab460e | 82 | virtual bool SetFaceName( const wxString& faceName ); |
0c5d3e1c VZ |
83 | virtual void SetUnderlined( bool underlined ); |
84 | virtual void SetEncoding(wxFontEncoding encoding); | |
85 | ||
dabbc6a5 | 86 | virtual void SetNoAntiAliasing( bool no = true ); |
5ac2e80c | 87 | virtual bool GetNoAntiAliasing() const ; |
9045ad9d | 88 | |
0c5d3e1c | 89 | // implementation from now on |
0c5d3e1c VZ |
90 | void Unshare(); |
91 | ||
92 | GdkFont* GetInternalFont(float scale = 1.0) const; | |
93 | ||
0c5d3e1c | 94 | protected: |
8f884a0d VZ |
95 | virtual wxGDIRefData *CreateGDIRefData() const; |
96 | virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; | |
97 | ||
9045ad9d VZ |
98 | virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info ); |
99 | ||
0c5d3e1c VZ |
100 | private: |
101 | DECLARE_DYNAMIC_CLASS(wxFont) | |
c801d85f KB |
102 | }; |
103 | ||
c801d85f | 104 | #endif // __GTKFONTH__ |