]>
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 | ||
b5dbe15d VS |
18 | class WXDLLIMPEXP_FWD_CORE wxDC; |
19 | class WXDLLIMPEXP_FWD_CORE wxPaintDC; | |
20 | class WXDLLIMPEXP_FWD_CORE wxWindow; | |
21 | class WXDLLIMPEXP_FWD_CORE wxFont; | |
32b8ec41 VZ |
22 | |
23 | struct font_t; | |
24 | ||
25 | // ---------------------------------------------------------------------------- | |
26 | // wxFont | |
27 | // ---------------------------------------------------------------------------- | |
28 | ||
53a2db12 | 29 | class WXDLLIMPEXP_CORE wxFont : public wxFontBase |
32b8ec41 VZ |
30 | { |
31 | public: | |
32 | // ctors and such | |
f8855e47 | 33 | wxFont() { } |
32b8ec41 VZ |
34 | |
35 | wxFont(const wxNativeFontInfo& info) | |
36 | { | |
0c14b6c3 | 37 | (void)Create(info); |
32b8ec41 VZ |
38 | } |
39 | ||
0c14b6c3 | 40 | #if FUTURE_WXWIN_COMPATIBILITY_3_0 |
32b8ec41 VZ |
41 | wxFont(int size, |
42 | int family, | |
43 | int style, | |
44 | int weight, | |
0c14b6c3 | 45 | bool underlined = false, |
32b8ec41 VZ |
46 | const wxString& face = wxEmptyString, |
47 | wxFontEncoding encoding = wxFONTENCODING_DEFAULT) | |
48 | { | |
0c14b6c3 FM |
49 | (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); |
50 | } | |
51 | #endif | |
52 | ||
53 | wxFont(int size, | |
54 | wxFontFamily family, | |
55 | wxFontStyle style, | |
56 | wxFontWeight weight, | |
57 | bool underlined = false, | |
58 | const wxString& face = wxEmptyString, | |
59 | wxFontEncoding encoding = wxFONTENCODING_DEFAULT) | |
60 | { | |
61 | Create(size, family, style, weight, underlined, face, encoding); | |
32b8ec41 VZ |
62 | } |
63 | ||
64 | bool Create(int size, | |
0c14b6c3 FM |
65 | wxFontFamily family, |
66 | wxFontStyle style, | |
67 | wxFontWeight weight, | |
68 | bool underlined = false, | |
32b8ec41 VZ |
69 | const wxString& face = wxEmptyString, |
70 | wxFontEncoding encoding = wxFONTENCODING_DEFAULT); | |
71 | ||
72 | bool Create(const wxNativeFontInfo& fontinfo); | |
73 | ||
d3c7fc99 | 74 | virtual ~wxFont() {} |
32b8ec41 | 75 | |
32b8ec41 VZ |
76 | // implement base class pure virtuals |
77 | virtual int GetPointSize() const; | |
0c14b6c3 FM |
78 | virtual wxFontFamily GetFamily() const; |
79 | virtual wxFontStyle GetStyle() const; | |
80 | virtual wxFontWeight GetWeight() const; | |
32b8ec41 VZ |
81 | virtual wxString GetFaceName() const; |
82 | virtual bool GetUnderlined() const; | |
83 | virtual wxFontEncoding GetEncoding() const; | |
f3437beb | 84 | virtual bool IsFixedWidth() const; |
3bf5a59b | 85 | virtual const wxNativeFontInfo *GetNativeFontInfo() const; |
32b8ec41 VZ |
86 | |
87 | virtual void SetPointSize(int pointSize); | |
0c14b6c3 FM |
88 | virtual void SetFamily(wxFontFamily family); |
89 | virtual void SetStyle(wxFontStyle style); | |
90 | virtual void SetWeight(wxFontWeight weight); | |
85ab460e | 91 | virtual bool SetFaceName(const wxString& faceName); |
32b8ec41 VZ |
92 | virtual void SetUnderlined(bool underlined); |
93 | virtual void SetEncoding(wxFontEncoding encoding); | |
94 | ||
0c14b6c3 FM |
95 | WXDECLARE_COMPAT_SETTERS |
96 | ||
d7ae4a62 VS |
97 | // Unofficial API, don't use |
98 | virtual void SetNoAntiAliasing(bool no = true); | |
99 | virtual bool GetNoAntiAliasing() const; | |
100 | ||
32b8ec41 VZ |
101 | struct font_t *GetMGLfont_t(float scale, bool antialiased); |
102 | ||
32b8ec41 | 103 | protected: |
6d7ee9e8 | 104 | // ref counting code |
8f884a0d VZ |
105 | virtual wxGDIRefData *CreateGDIRefData() const; |
106 | virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; | |
6d7ee9e8 | 107 | |
32b8ec41 VZ |
108 | private: |
109 | DECLARE_DYNAMIC_CLASS(wxFont) | |
110 | }; | |
111 | ||
112 | #endif // __WX_FONT_H__ |