]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/palmos/font.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/palmos/font.h
3 // Purpose: wxFont class
4 // Author: William Osborne - minimal working wxPalmOS port
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/gdicmn.h"
17 // ----------------------------------------------------------------------------
19 // ----------------------------------------------------------------------------
21 class WXDLLEXPORT wxFont
: public wxFontBase
26 wxFont(const wxFont
& font
) : wxFontBase(font
) { Init(); Ref(font
); }
32 bool underlined
= false,
33 const wxString
& face
= wxEmptyString
,
34 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
38 (void)Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
41 wxFont(const wxSize
& pixelSize
,
45 bool underlined
= false,
46 const wxString
& face
= wxEmptyString
,
47 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
51 (void)Create(pixelSize
, family
, style
, weight
,
52 underlined
, face
, encoding
);
55 wxFont(const wxNativeFontInfo
& info
, WXHFONT hFont
= 0)
62 wxFont(const wxString
& fontDesc
);
68 bool underlined
= false,
69 const wxString
& face
= wxEmptyString
,
70 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
72 return DoCreate(size
, wxDefaultSize
, false, family
, style
,
73 weight
, underlined
, face
, encoding
);
76 bool Create(const wxSize
& pixelSize
,
80 bool underlined
= false,
81 const wxString
& face
= wxEmptyString
,
82 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
84 return DoCreate(-1, pixelSize
, true, family
, style
,
85 weight
, underlined
, face
, encoding
);
88 bool Create(const wxNativeFontInfo
& info
, WXHFONT hFont
= 0);
93 wxFont
& operator=(const wxFont
& font
);
95 // implement base class pure virtuals
96 virtual int GetPointSize() const;
97 virtual wxSize
GetPixelSize() const;
98 virtual bool IsUsingSizeInPixels() const;
99 virtual int GetFamily() const;
100 virtual int GetStyle() const;
101 virtual int GetWeight() const;
102 virtual bool GetUnderlined() const;
103 virtual wxString
GetFaceName() const;
104 virtual wxFontEncoding
GetEncoding() const;
105 virtual const wxNativeFontInfo
*GetNativeFontInfo() const;
107 virtual void SetPointSize(int pointSize
);
108 virtual void SetPixelSize(const wxSize
& pixelSize
);
109 virtual void SetFamily(int family
);
110 virtual void SetStyle(int style
);
111 virtual void SetWeight(int weight
);
112 virtual void SetFaceName(const wxString
& faceName
);
113 virtual void SetUnderlined(bool underlined
);
114 virtual void SetEncoding(wxFontEncoding encoding
);
116 virtual bool IsFixedWidth() const;
118 // implementation only from now on
119 // -------------------------------
121 virtual bool IsFree() const;
122 virtual bool RealizeResource();
123 virtual WXHANDLE
GetResourceHandle() const;
124 virtual bool FreeResource(bool force
= false);
127 // real font creation function, used in all cases
128 bool DoCreate(int size
,
129 const wxSize
& pixelSize
,
130 bool sizeUsingPixels
,
134 bool underlined
= false,
135 const wxString
& face
= wxEmptyString
,
136 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
138 virtual void DoSetNativeFontInfo(const wxNativeFontInfo
& info
);
140 // common part of all ctors
146 DECLARE_DYNAMIC_CLASS(wxFont
)
149 #endif // _WX_FONT_H_