]>
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 #if FUTURE_WXWIN_COMPATIBILITY_3_0
35 bool underlined
= false,
36 const wxString
& face
= wxEmptyString
,
37 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
39 (void)Create(size
, (wxFontFamily
)family
, (wxFontStyle
)style
, (wxFontWeight
)weight
, underlined
, face
, encoding
);
47 bool underlined
= false,
48 const wxString
& face
= wxEmptyString
,
49 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
51 Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
54 wxFont(const wxSize
& pixelSize
,
58 bool underlined
= false,
59 const wxString
& face
= wxEmptyString
,
60 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
62 Create(10, family
, style
, weight
, underlined
, face
, encoding
);
63 SetPixelSize(pixelSize
);
68 int flags
= wxFONTFLAG_DEFAULT
,
69 const wxString
& face
= wxEmptyString
,
70 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
72 Create(pointSize
, family
,
73 GetStyleFromFlags(flags
),
74 GetWeightFromFlags(flags
),
75 GetUnderlinedFromFlags(flags
),
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_