More steps towards using wxFontInfo in all ports
Replace AccountForCompatValues() with InfoFromLegacyParams() which directly constructs wxFontInfo from the old-style parameters, applying all the compatibility hacks internally. There are no real changes in this commit, just simplify the code further and make wxFontInfo more central.
This commit is contained in:
@@ -188,7 +188,6 @@ wxFont::wxFont(const wxSize& pixelSize,
|
||||
const wxString& face,
|
||||
wxFontEncoding encoding)
|
||||
{
|
||||
m_refData = new wxFontRefData();
|
||||
Create(pixelSize, family, style, weight, underlined, face, encoding);
|
||||
}
|
||||
|
||||
@@ -200,27 +199,19 @@ wxFont::wxFont(int size,
|
||||
const wxString& face,
|
||||
wxFontEncoding encoding)
|
||||
{
|
||||
m_refData = new wxFontRefData();
|
||||
Create(wxSize(0, size), (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding);
|
||||
}
|
||||
|
||||
|
||||
bool wxFont::Create(wxSize size, wxFontFamily family, wxFontStyle style,
|
||||
wxFontWeight weight, bool underlined, const wxString& face,
|
||||
wxFontEncoding WXUNUSED(encoding) )
|
||||
wxFontEncoding encoding )
|
||||
{
|
||||
int pointSize = size.GetHeight();
|
||||
AccountForCompatValues(pointSize, style, weight);
|
||||
UnRef();
|
||||
|
||||
if (!face.empty())
|
||||
M_FONTDATA.SetFaceName(face);
|
||||
else
|
||||
M_FONTDATA.SetFamily(family);
|
||||
|
||||
M_FONTDATA.SetStyle(style);
|
||||
M_FONTDATA.SetWeight(weight);
|
||||
M_FONTDATA.SetUnderlined(underlined);
|
||||
M_FONTDATA.SetPointSize(pointSize);
|
||||
m_refData = new wxFontRefData(InfoFromLegacyParams(size.GetHeight(), family,
|
||||
style, weight, underlined,
|
||||
face, encoding));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user