]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/font.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFont class
4 // Author: David Webster
7 // Copyright: (c) David Webster
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
14 #include "wx/gdiobj.h"
15 #include "wx/os2/private.h"
17 WXDLLIMPEXP_DATA_CORE(extern const wxChar
*) wxEmptyString
;
19 // ----------------------------------------------------------------------------
21 // ----------------------------------------------------------------------------
23 class WXDLLIMPEXP_CORE wxFont
: public wxFontBase
29 wxFont(const wxFontInfo
& info
)
31 Create(info
.GetPointSize(),
39 if ( info
.IsUsingSizeInPixels() )
40 SetPixelSize(info
.GetPixelSize());
43 #if FUTURE_WXWIN_COMPATIBILITY_3_0
48 bool underlined
= false,
49 const wxString
& face
= wxEmptyString
,
50 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
52 (void)Create(size
, (wxFontFamily
)family
, (wxFontStyle
)style
, (wxFontWeight
)weight
, underlined
, face
, encoding
);
60 bool underlined
= false,
61 const wxString
& face
= wxEmptyString
,
62 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
64 Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
67 wxFont(const wxSize
& pixelSize
,
71 bool underlined
= false,
72 const wxString
& face
= wxEmptyString
,
73 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
75 Create(10, family
, style
, weight
, underlined
, face
, encoding
);
76 SetPixelSize(pixelSize
);
83 bool underlined
= false,
84 const wxString
& face
= wxEmptyString
,
85 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
87 wxFont( const wxNativeFontInfo
& rInfo
97 wxFont(const wxString
& rsFontDesc
);
99 bool Create( const wxNativeFontInfo
& rInfo
106 // Implement base class pure virtuals
108 virtual int GetPointSize(void) const;
109 virtual wxFontStyle
GetStyle() const;
110 virtual wxFontWeight
GetWeight() const;
111 virtual bool GetUnderlined(void) const;
112 virtual wxString
GetFaceName(void) const;
113 virtual wxFontEncoding
GetEncoding(void) const;
114 virtual const wxNativeFontInfo
* GetNativeFontInfo() const;
116 virtual void SetPointSize(int nPointSize
);
117 virtual void SetFamily(wxFontFamily family
);
118 virtual void SetStyle(wxFontStyle style
);
119 virtual void SetWeight(wxFontWeight weight
);
120 virtual bool SetFaceName(const wxString
& rsFaceName
);
121 virtual void SetUnderlined(bool bUnderlined
);
122 virtual void SetEncoding(wxFontEncoding vEncoding
);
124 wxDECLARE_COMMON_FONT_METHODS();
127 // For internal use only!
130 void SetFM( PFONTMETRICS pFM
134 // Implementation only from now on
135 // -------------------------------
137 virtual bool IsFree(void) const;
138 virtual bool RealizeResource(void);
139 virtual WXHANDLE
GetResourceHandle(void) const;
140 virtual bool FreeResource(bool bForce
= false);
142 WXHFONT
GetHFONT(void) const;
145 virtual void DoSetNativeFontInfo(const wxNativeFontInfo
& rInfo
);
146 virtual wxFontFamily
DoGetFamily() const;
148 // implement wxObject virtuals which are used by AllocExclusive()
149 virtual wxGDIRefData
*CreateGDIRefData() const;
150 virtual wxGDIRefData
*CloneGDIRefData(const wxGDIRefData
*data
) const;
153 DECLARE_DYNAMIC_CLASS(wxFont
)
156 #endif // _WX_FONT_H_