Change wxFontRefData ctor to take wxFontInfo in wxMSW

Apply the same change as was done for wxGTK in the previous commit to
wxMSW too, for the same reasons.
This commit is contained in:
Vadim Zeitlin
2018-09-12 23:17:06 +02:00
parent 7c9daf2e81
commit 34e01aa62d
2 changed files with 30 additions and 83 deletions

View File

@@ -44,8 +44,10 @@ public:
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
return DoCreate(size, wxDefaultSize, false, family, style,
weight, underlined, face, encoding);
AccountForCompatValues(size, style, weight);
wxFontInfo info(size);
return DoCreate(info, family, style, weight, underlined, face, encoding);
}
wxFont(const wxSize& pixelSize,
@@ -76,8 +78,8 @@ public:
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
return DoCreate(-1, pixelSize, true, family, style,
weight, underlined, face, encoding);
wxFontInfo info(pixelSize);
return DoCreate(info, family, style, weight, underlined, face, encoding);
}
bool Create(const wxNativeFontInfo& info, WXHFONT hFont = 0);
@@ -147,10 +149,8 @@ public:
WXHFONT GetHFONT() const;
protected:
// real font creation function, used in all cases
bool DoCreate(int size,
const wxSize& pixelSize,
bool sizeUsingPixels,
// Common helper of overloaded Create() methods.
bool DoCreate(wxFontInfo& info,
wxFontFamily family,
wxFontStyle style,
wxFontWeight weight,