From 0a23e8dfbe934193fb2a473527c1189e23b33f0d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 12 Sep 2018 19:25:57 +0200 Subject: [PATCH] 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. --- src/osx/carbon/graphics.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/osx/carbon/graphics.cpp b/src/osx/carbon/graphics.cpp index ec1b9643bb..a7d65952e3 100644 --- a/src/osx/carbon/graphics.cpp +++ b/src/osx/carbon/graphics.cpp @@ -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));