]>
git.saurik.com Git - wxWidgets.git/blob - src/qt/font.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFont class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "font.h"
18 IMPLEMENT_DYNAMIC_CLASS(wxFont
, wxGDIObject
)
20 wxFontRefData::wxFontRefData()
34 wxFontRefData::wxFontRefData(const wxFontRefData
& data
)
36 m_style
= data
.m_style
;
37 m_pointSize
= data
.m_pointSize
;
38 m_family
= data
.m_family
;
39 m_style
= data
.m_style
;
40 m_weight
= data
.m_weight
;
41 m_underlined
= data
.m_underlined
;
42 m_faceName
= data
.m_faceName
;
48 wxFontRefData::~wxFontRefData()
50 // TODO: delete font data
56 wxTheFontList
->Append(this);
59 wxFont::wxFont(int pointSize
, int family
, int style
, int weight
, bool underlined
, const wxString
& faceName
)
61 Create(pointSize
, family
, style
, weight
, underlined
, faceName
);
64 wxTheFontList
->Append(this);
67 bool wxFont::Create(int pointSize
, int family
, int style
, int weight
, bool underlined
, const wxString
& faceName
)
70 m_refData
= new wxFontRefData
;
72 M_FONTDATA
->m_family
= family
;
73 M_FONTDATA
->m_style
= style
;
74 M_FONTDATA
->m_weight
= weight
;
75 M_FONTDATA
->m_pointSize
= pointSize
;
76 M_FONTDATA
->m_underlined
= underlined
;
77 M_FONTDATA
->m_faceName
= faceName
;
87 wxTheFontList
->DeleteObject(this);
90 bool wxFont::RealizeResource()
92 // TODO: create the font (if there is a native font object)
96 void wxFont::Unshare()
98 // Don't change shared data
101 m_refData
= new wxFontRefData();
105 wxFontRefData
* ref
= new wxFontRefData(*(wxFontRefData
*)m_refData
);
111 void wxFont::SetPointSize(int pointSize
)
115 M_FONTDATA
->m_pointSize
= pointSize
;
120 void wxFont::SetFamily(int family
)
124 M_FONTDATA
->m_family
= family
;
129 void wxFont::SetStyle(int style
)
133 M_FONTDATA
->m_style
= style
;
138 void wxFont::SetWeight(int weight
)
142 M_FONTDATA
->m_weight
= weight
;
147 void wxFont::SetFaceName(const wxString
& faceName
)
151 M_FONTDATA
->m_faceName
= faceName
;
156 void wxFont::SetUnderlined(bool underlined
)
160 M_FONTDATA
->m_underlined
= underlined
;
165 wxString
wxFont::GetFamilyString() const
171 fam
= "wxDECORATIVE";
195 /* New font system */
196 wxString
wxFont::GetFaceName() const
200 str
= M_FONTDATA
->m_faceName
;
204 wxString
wxFont::GetStyleString() const
222 wxString
wxFont::GetWeightString() const