]>
Commit | Line | Data |
---|---|---|
0e320a79 DW |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: font.h | |
3 | // Purpose: wxFont class | |
21802234 | 4 | // Author: David Webster |
0e320a79 | 5 | // Modified by: |
21802234 | 6 | // Created: 10/06/99 |
0e320a79 | 7 | // RCS-ID: $Id$ |
21802234 | 8 | // Copyright: (c) David Webster |
65571936 | 9 | // Licence: wxWindows licence |
0e320a79 DW |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_FONT_H_ | |
13 | #define _WX_FONT_H_ | |
14 | ||
0e320a79 | 15 | #include "wx/gdiobj.h" |
e99762c0 | 16 | #include "wx/os2/private.h" |
0e320a79 | 17 | |
21802234 DW |
18 | WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString; |
19 | ||
20 | // ---------------------------------------------------------------------------- | |
21 | // wxFont | |
22 | // ---------------------------------------------------------------------------- | |
0e320a79 | 23 | |
21802234 | 24 | class WXDLLEXPORT wxFont : public wxFontBase |
0e320a79 | 25 | { |
0e320a79 | 26 | public: |
21802234 | 27 | // ctors and such |
f8855e47 | 28 | wxFont() { } |
e99762c0 DW |
29 | |
30 | wxFont( int nSize | |
31 | ,int nFamily | |
32 | ,int nStyle | |
33 | ,int nWeight | |
dabbc6a5 | 34 | ,bool bUnderlined = false |
e99762c0 DW |
35 | ,const wxString& rsFace = wxEmptyString |
36 | ,wxFontEncoding vEncoding = wxFONTENCODING_DEFAULT | |
37 | ) | |
21802234 | 38 | { |
cc95f4f9 DW |
39 | (void)Create( nSize |
40 | ,nFamily | |
41 | ,nStyle | |
42 | ,nWeight | |
43 | ,bUnderlined | |
44 | ,rsFace | |
45 | ,vEncoding | |
46 | ); | |
21802234 DW |
47 | } |
48 | ||
cc95f4f9 DW |
49 | wxFont( const wxNativeFontInfo& rInfo |
50 | ,WXHFONT hFont = 0 | |
51 | ) | |
52 | ||
53 | { | |
cc95f4f9 DW |
54 | (void)Create( rInfo |
55 | ,hFont | |
56 | ); | |
57 | } | |
58 | ||
59 | wxFont(const wxString& rsFontDesc); | |
377771d9 | 60 | |
e99762c0 DW |
61 | bool Create( int nSize |
62 | ,int nFamily | |
63 | ,int nStyle | |
64 | ,int nWeight | |
dabbc6a5 | 65 | ,bool bUnderlined = false |
e99762c0 DW |
66 | ,const wxString& rsFace = wxEmptyString |
67 | ,wxFontEncoding vEncoding = wxFONTENCODING_DEFAULT | |
68 | ); | |
cc95f4f9 DW |
69 | bool Create( const wxNativeFontInfo& rInfo |
70 | ,WXHFONT hFont = 0 | |
71 | ); | |
21802234 DW |
72 | |
73 | virtual ~wxFont(); | |
74 | ||
e99762c0 DW |
75 | // |
76 | // Implement base class pure virtuals | |
77 | // | |
cc95f4f9 DW |
78 | virtual int GetPointSize(void) const; |
79 | virtual int GetFamily(void) const; | |
80 | virtual int GetStyle(void) const; | |
81 | virtual int GetWeight(void) const; | |
82 | virtual bool GetUnderlined(void) const; | |
83 | virtual wxString GetFaceName(void) const; | |
84 | virtual wxFontEncoding GetEncoding(void) const; | |
3bf5a59b | 85 | virtual const wxNativeFontInfo* GetNativeFontInfo() const; |
e99762c0 DW |
86 | |
87 | virtual void SetPointSize(int nPointSize); | |
88 | virtual void SetFamily(int nFamily); | |
89 | virtual void SetStyle(int nStyle); | |
90 | virtual void SetWeight(int nWeight); | |
91 | virtual void SetFaceName(const wxString& rsFaceName); | |
92 | virtual void SetUnderlined(bool bUnderlined); | |
93 | virtual void SetEncoding(wxFontEncoding vEncoding); | |
e99762c0 | 94 | |
cc95f4f9 DW |
95 | // |
96 | // For internal use only! | |
97 | // | |
511ac294 | 98 | void SetPS(HPS hPS); |
cc95f4f9 DW |
99 | void SetFM( PFONTMETRICS pFM |
100 | ,int nNumFonts | |
101 | ); | |
e99762c0 DW |
102 | // |
103 | // Implementation only from now on | |
21802234 | 104 | // ------------------------------- |
e99762c0 | 105 | // |
e99762c0 DW |
106 | virtual bool IsFree(void) const; |
107 | virtual bool RealizeResource(void); | |
108 | virtual WXHANDLE GetResourceHandle(void); | |
dabbc6a5 | 109 | virtual bool FreeResource(bool bForce = false); |
0e320a79 | 110 | |
08399e45 | 111 | WXHFONT GetHFONT(void) const; |
9045ad9d | 112 | |
21802234 | 113 | protected: |
9045ad9d VZ |
114 | virtual void DoSetNativeFontInfo(const wxNativeFontInfo& rInfo); |
115 | ||
e99762c0 | 116 | void Unshare(void); |
0e320a79 | 117 | |
21802234 DW |
118 | private: |
119 | DECLARE_DYNAMIC_CLASS(wxFont) | |
e99762c0 | 120 | }; // end of wxFont |
0e320a79 | 121 | |
e99762c0 | 122 | #endif // _WX_FONT_H_ |