]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: font.h | |
3 | // Author: Vaclav Slavik | |
4 | // Id: $Id$ | |
5 | // Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com) | |
6 | // Licence: wxWindows licence | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | #ifndef __WX_FONT_H__ | |
10 | #define __WX_FONT_H__ | |
11 | ||
12 | #include "wx/hash.h" | |
13 | ||
14 | // ---------------------------------------------------------------------------- | |
15 | // classes | |
16 | // ---------------------------------------------------------------------------- | |
17 | ||
18 | class WXDLLIMPEXP_FWD_CORE wxDC; | |
19 | class WXDLLIMPEXP_FWD_CORE wxPaintDC; | |
20 | class WXDLLIMPEXP_FWD_CORE wxWindow; | |
21 | class WXDLLIMPEXP_FWD_CORE 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 | |
33 | wxFont() { } | |
34 | ||
35 | wxFont(const wxNativeFontInfo& info) | |
36 | { | |
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 | { | |
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 | ||
61 | virtual ~wxFont() {} | |
62 | ||
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; | |
71 | virtual bool IsFixedWidth() const; | |
72 | virtual const wxNativeFontInfo *GetNativeFontInfo() const; | |
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 bool SetFaceName(const wxString& faceName); | |
79 | virtual void SetUnderlined(bool underlined); | |
80 | virtual void SetEncoding(wxFontEncoding encoding); | |
81 | ||
82 | // Unofficial API, don't use | |
83 | virtual void SetNoAntiAliasing(bool no = true); | |
84 | virtual bool GetNoAntiAliasing() const; | |
85 | ||
86 | struct font_t *GetMGLfont_t(float scale, bool antialiased); | |
87 | ||
88 | protected: | |
89 | // ref counting code | |
90 | virtual wxGDIRefData *CreateGDIRefData() const; | |
91 | virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; | |
92 | ||
93 | private: | |
94 | DECLARE_DYNAMIC_CLASS(wxFont) | |
95 | }; | |
96 | ||
97 | #endif // __WX_FONT_H__ |