]>
Commit | Line | Data |
---|---|---|
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 | ||
18 | class WXDLLEXPORT wxDC; | |
19 | class WXDLLEXPORT wxPaintDC; | |
20 | class WXDLLEXPORT wxWindow; | |
21 | class WXDLLEXPORT wxFont; | |
22 | ||
23 | struct font_t; | |
24 | ||
25 | // ---------------------------------------------------------------------------- | |
26 | // wxFont | |
27 | // ---------------------------------------------------------------------------- | |
28 | ||
29 | class WXDLLEXPORT wxFont : public wxFontBase | |
30 | { | |
31 | public: | |
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 | ||
3cdd0895 | 61 | ~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); | |
78 | virtual void SetFaceName(const wxString& faceName); | |
79 | virtual void SetUnderlined(bool underlined); | |
80 | virtual void SetEncoding(wxFontEncoding encoding); | |
81 | ||
32b8ec41 VZ |
82 | struct font_t *GetMGLfont_t(float scale, bool antialiased); |
83 | ||
32b8ec41 | 84 | protected: |
6d7ee9e8 VS |
85 | // ref counting code |
86 | virtual wxObjectRefData *CreateRefData() const; | |
87 | virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; | |
88 | ||
32b8ec41 VZ |
89 | private: |
90 | DECLARE_DYNAMIC_CLASS(wxFont) | |
91 | }; | |
92 | ||
93 | #endif // __WX_FONT_H__ |