]>
Commit | Line | Data |
---|---|---|
0dbd6262 SC |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: font.h | |
3 | // Purpose: wxFont class | |
519cb848 | 4 | // Author: Julian Smart |
0dbd6262 | 5 | // Modified by: |
519cb848 | 6 | // Created: 01/02/97 |
0dbd6262 | 7 | // RCS-ID: $Id$ |
519cb848 SC |
8 | // Copyright: (c) Julian Smart |
9 | // Licence: wxWindows licence | |
0dbd6262 SC |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_FONT_H_ | |
13 | #define _WX_FONT_H_ | |
14 | ||
12028905 | 15 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
519cb848 | 16 | #pragma interface "font.h" |
0dbd6262 SC |
17 | #endif |
18 | ||
519cb848 SC |
19 | // ---------------------------------------------------------------------------- |
20 | // wxFont | |
21 | // ---------------------------------------------------------------------------- | |
22 | ||
23 | class WXDLLEXPORT wxFont : public wxFontBase | |
0dbd6262 | 24 | { |
0dbd6262 | 25 | public: |
519cb848 SC |
26 | // ctors and such |
27 | wxFont() { Init(); } | |
f2af4afb GD |
28 | wxFont(const wxFont& font) |
29 | : wxFontBase() | |
30 | { | |
31 | Init(); | |
32 | Ref(font); | |
33 | } | |
519cb848 SC |
34 | |
35 | wxFont(int size, | |
36 | int family, | |
37 | int style, | |
38 | int weight, | |
39 | bool underlined = FALSE, | |
40 | const wxString& face = wxEmptyString, | |
41 | wxFontEncoding encoding = wxFONTENCODING_DEFAULT) | |
42 | { | |
43 | Init(); | |
44 | ||
45 | (void)Create(size, family, style, weight, underlined, face, encoding); | |
46 | } | |
47 | ||
3b7e6277 GD |
48 | wxFont(const wxNativeFontInfo& info) |
49 | { | |
50 | Init(); | |
51 | ||
52 | (void)Create(info); | |
53 | } | |
54 | ||
55 | wxFont(const wxString& fontDesc); | |
56 | ||
519cb848 SC |
57 | bool Create(int size, |
58 | int family, | |
59 | int style, | |
60 | int weight, | |
61 | bool underlined = FALSE, | |
62 | const wxString& face = wxEmptyString, | |
63 | wxFontEncoding encoding = wxFONTENCODING_DEFAULT); | |
64 | ||
3b7e6277 GD |
65 | bool Create(const wxNativeFontInfo& info); |
66 | ||
519cb848 SC |
67 | virtual ~wxFont(); |
68 | ||
69 | // assignment | |
70 | wxFont& operator=(const wxFont& font); | |
71 | ||
72 | // implement base class pure virtuals | |
73 | virtual int GetPointSize() const; | |
74 | virtual int GetFamily() const; | |
75 | virtual int GetStyle() const; | |
76 | virtual int GetWeight() const; | |
77 | virtual bool GetUnderlined() const; | |
78 | virtual wxString GetFaceName() const; | |
79 | virtual wxFontEncoding GetEncoding() const; | |
3bf5a59b | 80 | virtual const wxNativeFontInfo *GetNativeFontInfo() const; |
519cb848 SC |
81 | |
82 | virtual void SetPointSize(int pointSize); | |
83 | virtual void SetFamily(int family); | |
84 | virtual void SetStyle(int style); | |
85 | virtual void SetWeight(int weight); | |
86 | virtual void SetFaceName(const wxString& faceName); | |
87 | virtual void SetUnderlined(bool underlined); | |
88 | virtual void SetEncoding(wxFontEncoding encoding); | |
89 | ||
90 | // implementation only from now on | |
91 | // ------------------------------- | |
92 | ||
519cb848 | 93 | virtual bool RealizeResource(); |
0dbd6262 | 94 | |
ac17f9b1 SC |
95 | // Unofficial API, don't use |
96 | virtual void SetNoAntiAliasing( bool noAA = TRUE ) ; | |
97 | virtual bool GetNoAntiAliasing() ; | |
fcb35beb VZ |
98 | |
99 | // Mac-specific, risks to change, don't use in portable code | |
100 | short GetMacFontNum() const; | |
101 | short GetMacFontSize() const; | |
102 | wxByte GetMacFontStyle() const; | |
103 | wxUint32 GetMacATSUFontID() const; | |
104 | ||
519cb848 SC |
105 | protected: |
106 | // common part of all ctors | |
107 | void Init(); | |
0dbd6262 | 108 | |
519cb848 | 109 | void Unshare(); |
0dbd6262 | 110 | |
519cb848 SC |
111 | private: |
112 | DECLARE_DYNAMIC_CLASS(wxFont) | |
0dbd6262 SC |
113 | }; |
114 | ||
115 | #endif | |
116 | // _WX_FONT_H_ |