]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/font.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFont class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/gdiobj.h"
16 #include "wx/os2/private.h"
18 WXDLLIMPEXP_DATA_CORE(extern const wxChar
*) wxEmptyString
;
20 // ----------------------------------------------------------------------------
22 // ----------------------------------------------------------------------------
24 class WXDLLIMPEXP_CORE wxFont
: public wxFontBase
30 wxFont(const wxFontInfo
& info
)
32 Create(info
.GetPointSize(),
40 if ( info
.IsUsingSizeInPixels() )
41 SetPixelSize(info
.GetPixelSize());
44 #if FUTURE_WXWIN_COMPATIBILITY_3_0
49 bool underlined
= false,
50 const wxString
& face
= wxEmptyString
,
51 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
53 (void)Create(size
, (wxFontFamily
)family
, (wxFontStyle
)style
, (wxFontWeight
)weight
, underlined
, face
, encoding
);
61 bool underlined
= false,
62 const wxString
& face
= wxEmptyString
,
63 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
65 Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
68 wxFont(const wxSize
& pixelSize
,
72 bool underlined
= false,
73 const wxString
& face
= wxEmptyString
,
74 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
76 Create(10, family
, style
, weight
, underlined
, face
, encoding
);
77 SetPixelSize(pixelSize
);
84 bool underlined
= false,
85 const wxString
& face
= wxEmptyString
,
86 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
88 wxFont( const wxNativeFontInfo
& rInfo
98 wxFont(const wxString
& rsFontDesc
);
100 bool Create( const wxNativeFontInfo
& rInfo
107 // Implement base class pure virtuals
109 virtual int GetPointSize(void) const;
110 virtual wxFontStyle
GetStyle() const;
111 virtual wxFontWeight
GetWeight() const;
112 virtual bool GetUnderlined(void) const;
113 virtual wxString
GetFaceName(void) const;
114 virtual wxFontEncoding
GetEncoding(void) const;
115 virtual const wxNativeFontInfo
* GetNativeFontInfo() const;
117 virtual void SetPointSize(int nPointSize
);
118 virtual void SetFamily(wxFontFamily family
);
119 virtual void SetStyle(wxFontStyle style
);
120 virtual void SetWeight(wxFontWeight weight
);
121 virtual bool SetFaceName(const wxString
& rsFaceName
);
122 virtual void SetUnderlined(bool bUnderlined
);
123 virtual void SetEncoding(wxFontEncoding vEncoding
);
125 wxDECLARE_COMMON_FONT_METHODS();
128 // For internal use only!
131 void SetFM( PFONTMETRICS pFM
135 // Implementation only from now on
136 // -------------------------------
138 virtual bool IsFree(void) const;
139 virtual bool RealizeResource(void);
140 virtual WXHANDLE
GetResourceHandle(void) const;
141 virtual bool FreeResource(bool bForce
= false);
143 WXHFONT
GetHFONT(void) const;
146 virtual void DoSetNativeFontInfo(const wxNativeFontInfo
& rInfo
);
147 virtual wxFontFamily
DoGetFamily() const;
149 // implement wxObject virtuals which are used by AllocExclusive()
150 virtual wxGDIRefData
*CreateGDIRefData() const;
151 virtual wxGDIRefData
*CloneGDIRefData(const wxGDIRefData
*data
) const;
154 DECLARE_DYNAMIC_CLASS(wxFont
)
157 #endif // _WX_FONT_H_