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:
Vadim Zeitlin
2018-09-14 19:26:26 +02:00
parent 7866c293e8
commit 9627798496
9 changed files with 127 additions and 100 deletions

View File

@@ -44,10 +44,13 @@ public:
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
AccountForCompatValues(size, style, weight);
wxFontInfo info(size);
return DoCreate(info, family, style, weight, underlined, face, encoding);
return DoCreate(InfoFromLegacyParams(size,
family,
style,
weight,
underlined,
face,
encoding));
}
wxFont(const wxSize& pixelSize,
@@ -78,8 +81,13 @@ public:
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
wxFontInfo info(pixelSize);
return DoCreate(info, family, style, weight, underlined, face, encoding);
return DoCreate(InfoFromLegacyParams(pixelSize,
family,
style,
weight,
underlined,
face,
encoding));
}
bool Create(const wxNativeFontInfo& info, WXHFONT hFont = 0);
@@ -150,13 +158,7 @@ public:
protected:
// Common helper of overloaded Create() methods.
bool DoCreate(wxFontInfo& info,
wxFontFamily family,
wxFontStyle style,
wxFontWeight weight,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
bool DoCreate(const wxFontInfo& info);
virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info) wxOVERRIDE;
virtual wxFontFamily DoGetFamily() const wxOVERRIDE;