Use portable wxFont ctor instead of Mac-specific one

No real changes, just use wxFont ctor taking wxFontInfo instead of a
Mac-specific ctor.

This is more clear and will continue to work after Mac-specific ctor is
removed.
This commit is contained in:
Vadim Zeitlin
2018-09-12 19:25:57 +02:00
parent 27434db911
commit 0a23e8dfbe

View File

@@ -2895,17 +2895,7 @@ wxMacCoreGraphicsRenderer::CreateFont(double sizeInPixels,
// Notice that under Mac we always use 72 DPI so the font size in pixels is
// the same as the font size in points and we can pass it directly to wxFont
// ctor.
wxFont font((float)sizeInPixels,
wxFONTFAMILY_DEFAULT,
flags & wxFONTFLAG_ITALIC ? wxFONTSTYLE_ITALIC
: wxFONTSTYLE_NORMAL,
flags & wxFONTFLAG_BOLD ? wxFONTWEIGHT_BOLD
: wxFONTWEIGHT_NORMAL,
(flags & wxFONTFLAG_UNDERLINED) != 0,
facename);
if ( flags & wxFONTFLAG_STRIKETHROUGH )
font.MakeStrikethrough();
wxFont font(wxFontInfo(sizeInPixels).FaceName(facename).AllFlags(flags));
wxGraphicsFont f;
f.SetRefData(new wxMacCoreGraphicsFontData(this, font, col));